@postcept/receipt 1.2.0 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/schema/receipt.schema.json +72 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postcept/receipt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Independently verify a Postcept Receipt, the signed proof that an AI agent's high-risk action actually happened in the system of record. Runs anywhere, needs only the public key.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Postcept",
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"@noble/ed25519": "^3.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"ajv": "^8.20.0",
|
|
58
|
+
"ajv-formats": "^3.0.1",
|
|
57
59
|
"typescript": "^5.5.3"
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"id": { "type": "string", "description": "Receipt id, e.g. pcpt_rcpt_..." },
|
|
21
21
|
"org_id": {
|
|
22
22
|
"type": ["string", "null"],
|
|
23
|
-
"description": "The organization the receipt belongs to (signed
|
|
23
|
+
"description": "The organization the receipt belongs to (signed from v2)."
|
|
24
24
|
},
|
|
25
25
|
"operation_id": { "type": "string", "description": "Stable id for the agent operation." },
|
|
26
26
|
"agent_id": { "type": "string" },
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"connectors_checked": {
|
|
33
33
|
"type": "array",
|
|
34
34
|
"items": { "type": "string" },
|
|
35
|
-
"description": "The systems of record actually consulted (e.g. [\"stripe\"]), by connector identity."
|
|
35
|
+
"description": "The systems of record actually consulted (e.g. [\"stripe\"]), by connector identity. A relay-backed verification names the relay, e.g. [\"relay:rly_...\"]."
|
|
36
36
|
},
|
|
37
37
|
"postconditions": {
|
|
38
38
|
"type": "array",
|
|
@@ -50,18 +50,78 @@
|
|
|
50
50
|
},
|
|
51
51
|
"test": {
|
|
52
52
|
"type": "boolean",
|
|
53
|
-
"description": "True for sandbox
|
|
53
|
+
"description": "True for sandbox verifications. Signed, so a test receipt cannot be presented as live."
|
|
54
|
+
},
|
|
55
|
+
"algorithm": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"const": "ed25519",
|
|
58
|
+
"description": "Signature scheme. Bound into the signed body from v3."
|
|
54
59
|
},
|
|
55
|
-
"algorithm": { "type": "string", "const": "ed25519" },
|
|
56
60
|
"version": {
|
|
57
61
|
"type": "string",
|
|
58
|
-
"enum": ["1", "2"],
|
|
59
|
-
"description": "Signing-body version. Absent is treated as \"1\"."
|
|
62
|
+
"enum": ["1", "2", "3"],
|
|
63
|
+
"description": "Signing-body version. Absent is treated as \"1\". v3 binds the signature metadata, the outcome contract, the lifecycle decision and the observation role into the signed body."
|
|
64
|
+
},
|
|
65
|
+
"signing_key_id": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Key fingerprint, e.g. ed25519:... Bound into the signed body from v3."
|
|
60
68
|
},
|
|
61
|
-
"signing_key_id": { "type": "string", "description": "Key fingerprint, e.g. ed25519:..." },
|
|
62
69
|
"signature": {
|
|
63
70
|
"type": "string",
|
|
64
|
-
"description": "Base64 Ed25519 signature over the canonical signing body for this version."
|
|
71
|
+
"description": "Base64 Ed25519 signature over the canonical signing body for this version. This is the evaluation role, signed by Postcept."
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
"supersedes": {
|
|
75
|
+
"type": ["string", "null"],
|
|
76
|
+
"description": "The receipt this one replaces after re-verification found the truth changed. Signed from v3. Earlier receipts are never mutated."
|
|
77
|
+
},
|
|
78
|
+
"superseded_by": {
|
|
79
|
+
"type": ["string", "null"],
|
|
80
|
+
"description": "Set when serving a receipt that a later one replaced. Not part of any signing body."
|
|
81
|
+
},
|
|
82
|
+
"contract_digest": {
|
|
83
|
+
"type": ["string", "null"],
|
|
84
|
+
"description": "sha256 digest of the versioned Outcome Contract this verification was judged by. Signed from v3."
|
|
85
|
+
},
|
|
86
|
+
"lifecycle": {
|
|
87
|
+
"type": ["string", "null"],
|
|
88
|
+
"enum": [
|
|
89
|
+
"unobserved",
|
|
90
|
+
"observed",
|
|
91
|
+
"pending_finality",
|
|
92
|
+
"finalized",
|
|
93
|
+
"reversed",
|
|
94
|
+
"indeterminate",
|
|
95
|
+
"unreachable",
|
|
96
|
+
null
|
|
97
|
+
],
|
|
98
|
+
"description": "Where the action sits in the provider's lifecycle, separate from the outcome. Signed from v3."
|
|
99
|
+
},
|
|
100
|
+
"safe_to_claim_complete": {
|
|
101
|
+
"type": ["boolean", "null"],
|
|
102
|
+
"description": "The one boolean an agent may act on. True only when the outcome is verified, the provider state is terminal, and every required postcondition actually ran. Signed from v3."
|
|
103
|
+
},
|
|
104
|
+
"correlation_strength": {
|
|
105
|
+
"type": ["string", "null"],
|
|
106
|
+
"enum": ["deterministic", "heuristic", "uncorrelatable", null],
|
|
107
|
+
"description": "How the claim was located in the system of record. Signed from v3."
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"observation_relay_id": {
|
|
111
|
+
"type": ["string", "null"],
|
|
112
|
+
"description": "Observation role. The customer-side relay that read the system of record. Present only on relay-backed receipts."
|
|
113
|
+
},
|
|
114
|
+
"observation_key_id": {
|
|
115
|
+
"type": ["string", "null"],
|
|
116
|
+
"description": "Observation role. The relay key that signed the observation envelope."
|
|
117
|
+
},
|
|
118
|
+
"observation_digest": {
|
|
119
|
+
"type": ["string", "null"],
|
|
120
|
+
"description": "Observation role. sha256 over the relay's canonical observation envelope, so the envelope can be checked against this receipt."
|
|
121
|
+
},
|
|
122
|
+
"observation_signature": {
|
|
123
|
+
"type": ["string", "null"],
|
|
124
|
+
"description": "Observation role. The relay's own Ed25519 signature over the observation envelope. Verified with verifyObservation(receipt, envelope, relayKey). Together with the evaluation signature this is the dual-signature guarantee: the relay observed the source, Postcept evaluated it, and neither can forge the other's statement."
|
|
65
125
|
}
|
|
66
126
|
},
|
|
67
127
|
"$defs": {
|
|
@@ -75,6 +135,10 @@
|
|
|
75
135
|
"enum": ["existence", "match", "state", "duplicate", "policy", null]
|
|
76
136
|
},
|
|
77
137
|
"status": { "type": "string", "enum": ["passed", "failed", "skipped"] },
|
|
138
|
+
"detail": {
|
|
139
|
+
"type": ["string", "null"],
|
|
140
|
+
"description": "Human-readable explanation. Carried on the receipt, not part of the signing body."
|
|
141
|
+
},
|
|
78
142
|
"expected": { "type": ["string", "null"] },
|
|
79
143
|
"actual": { "type": ["string", "null"] }
|
|
80
144
|
}
|