@redditech/agent-protocol 0.0.0-stage → 0.2.0
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/CHANGELOG.md +89 -0
- package/LICENSE +21 -0
- package/README.md +394 -2
- package/dist/adl.d.ts +141 -0
- package/dist/adl.js +3601 -0
- package/dist/agent-stack-fixtures.d.ts +743 -0
- package/dist/agent-stack-fixtures.js +1554 -0
- package/dist/ai-catalog.d.ts +128 -0
- package/dist/ai-catalog.js +373 -0
- package/dist/attestation-reputation.d.ts +102 -0
- package/dist/attestation-reputation.js +279 -0
- package/dist/audd-rail-config.d.ts +102 -0
- package/dist/audd-rail-config.js +294 -0
- package/dist/browser-wallet-approval.d.ts +293 -0
- package/dist/browser-wallet-approval.js +1201 -0
- package/dist/discovery-source.d.ts +115 -0
- package/dist/discovery-source.js +251 -0
- package/dist/evidence-archive.d.ts +73 -0
- package/dist/evidence-archive.js +238 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/mpp-tempo-receipt-shapes.d.ts +201 -0
- package/dist/mpp-tempo-receipt-shapes.js +330 -0
- package/dist/okf-adapter.d.ts +229 -0
- package/dist/okf-adapter.js +556 -0
- package/dist/okf-conformance.d.ts +208 -0
- package/dist/okf-conformance.js +651 -0
- package/dist/okf-instruction-safety.d.ts +192 -0
- package/dist/okf-instruction-safety.js +509 -0
- package/dist/onboarding-analyser-handoff.d.ts +391 -0
- package/dist/onboarding-analyser-handoff.js +959 -0
- package/dist/onboarding-state-machine.d.ts +228 -0
- package/dist/onboarding-state-machine.js +432 -0
- package/dist/payment-records.d.ts +181 -0
- package/dist/payment-records.js +599 -0
- package/dist/policy.d.ts +33 -0
- package/dist/policy.js +45 -0
- package/dist/provider-trust.d.ts +113 -0
- package/dist/provider-trust.js +346 -0
- package/dist/quasar-registry-compatibility.d.ts +113 -0
- package/dist/quasar-registry-compatibility.js +214 -0
- package/dist/ranking-explainability.d.ts +202 -0
- package/dist/ranking-explainability.js +302 -0
- package/dist/receipt-v2.d.ts +202 -0
- package/dist/receipt-v2.js +418 -0
- package/dist/repo-explorer-evidence-manifest.d.ts +387 -0
- package/dist/repo-explorer-evidence-manifest.js +1187 -0
- package/dist/source-diagnostics.d.ts +84 -0
- package/dist/source-diagnostics.js +193 -0
- package/dist/source-trust-conformance-matrix.d.ts +207 -0
- package/dist/source-trust-conformance-matrix.js +672 -0
- package/examples/ard-no-spend-ai-catalog.json +51 -0
- package/examples/ard-no-spend-demo.mjs +355 -0
- package/examples/interpretation-guide-scenarios.mjs +302 -0
- package/package.json +144 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"specVersion": "1.0",
|
|
3
|
+
"host": {
|
|
4
|
+
"identifier": "reddi.local",
|
|
5
|
+
"displayName": "Reddi Local Fixtures",
|
|
6
|
+
"domain": "reddi.local"
|
|
7
|
+
},
|
|
8
|
+
"entries": [
|
|
9
|
+
{
|
|
10
|
+
"identifier": "urn:ai:reddi.local:specialists:listing-writer",
|
|
11
|
+
"mediaType": "application/rap-specialist+json",
|
|
12
|
+
"displayName": "Listing Writer Specialist",
|
|
13
|
+
"description": "Turns a short operator brief into a deterministic marketplace listing draft.",
|
|
14
|
+
"data": {
|
|
15
|
+
"endpoint": "fixture://specialists/listing-writer",
|
|
16
|
+
"inputSchema": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["brief"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"brief": { "type": "string" }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"capabilities": ["listing_draft", "marketplace_copy", "operator_review"],
|
|
25
|
+
"payment": {
|
|
26
|
+
"protocol": "rap",
|
|
27
|
+
"quoteMode": "preflight",
|
|
28
|
+
"asset": "AUDD",
|
|
29
|
+
"network": "solana-devnet",
|
|
30
|
+
"amount": "2500000"
|
|
31
|
+
},
|
|
32
|
+
"trustManifest": {
|
|
33
|
+
"identity": "urn:ai:reddi.local:specialists:listing-writer",
|
|
34
|
+
"provenance": ["file://examples/ard-no-spend-ai-catalog.json"],
|
|
35
|
+
"attestations": ["fixture://attestations/listing-writer-self-test"],
|
|
36
|
+
"verification": ["fixture://verification/local-demo"]
|
|
37
|
+
},
|
|
38
|
+
"metadata": {
|
|
39
|
+
"rap": {
|
|
40
|
+
"sourceId": "source:ard-local-catalog",
|
|
41
|
+
"specialistId": "specialist:listing-writer",
|
|
42
|
+
"payment": {
|
|
43
|
+
"protocol": "rap",
|
|
44
|
+
"quoteMode": "preflight",
|
|
45
|
+
"assets": [{ "asset": "AUDD", "network": "solana-devnet" }]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
// ARD no-spend quickstart: Discover -> Decide -> Prove on local fixtures.
|
|
2
|
+
//
|
|
3
|
+
// Discover a specialist from an AI Catalog, decide with a buyer-side discovery
|
|
4
|
+
// policy, call a local fixture specialist, and prove the call with a
|
|
5
|
+
// provider-signed reddi.receipt.v2 that the buyer verifies offline.
|
|
6
|
+
//
|
|
7
|
+
// Nothing here spends, opens a wallet, calls an RPC endpoint or a provider, or
|
|
8
|
+
// reads a credential. The provider key is derived from a public label inside
|
|
9
|
+
// this file, and the transaction signature in the receipt is a made-up fixture
|
|
10
|
+
// value: no payment was made and none is claimed.
|
|
11
|
+
import { createHash, createPrivateKey, createPublicKey, sign } from 'node:crypto';
|
|
12
|
+
import { readFile } from 'node:fs/promises';
|
|
13
|
+
import { dirname, join } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
AUDD_DETERMINISTIC_FIXTURE_MINT,
|
|
18
|
+
createAiCatalogSnapshot,
|
|
19
|
+
createEvidenceArchiveRecord,
|
|
20
|
+
createLocalEvidenceArchive,
|
|
21
|
+
hashReddiReceiptV2Body,
|
|
22
|
+
signReddiReceiptV2,
|
|
23
|
+
validateAiCatalog,
|
|
24
|
+
validateEvidenceArchiveRecord,
|
|
25
|
+
validateReddiReceiptV2,
|
|
26
|
+
verifyReddiReceiptV2,
|
|
27
|
+
} from '../dist/index.js';
|
|
28
|
+
import {
|
|
29
|
+
createAiCatalogDiscoveryCandidates,
|
|
30
|
+
evaluateDiscoveryCandidatePolicyPreflight,
|
|
31
|
+
} from '../dist/discovery-source.js';
|
|
32
|
+
import { createSourceAwareCandidateDiagnostics } from '../dist/source-diagnostics.js';
|
|
33
|
+
import {
|
|
34
|
+
applyAttestationToReputation,
|
|
35
|
+
createAttestationRecord,
|
|
36
|
+
createInitialReputationState,
|
|
37
|
+
} from '../dist/attestation-reputation.js';
|
|
38
|
+
|
|
39
|
+
const createdAt = '2026-06-19T07:45:00.000Z';
|
|
40
|
+
const jobId = 'job:ard-no-spend-001';
|
|
41
|
+
const evidenceId = 'evidence:ard-no-spend-001';
|
|
42
|
+
const sourceId = 'source:ard-local-catalog';
|
|
43
|
+
const specialistId = 'specialist:listing-writer';
|
|
44
|
+
const declaredModel = 'fixture/listing-writer-v1';
|
|
45
|
+
const network = 'solana-devnet';
|
|
46
|
+
const amount = '2500000';
|
|
47
|
+
const catalogPath = join(dirname(fileURLToPath(import.meta.url)), 'ard-no-spend-ai-catalog.json');
|
|
48
|
+
const catalog = JSON.parse(await readFile(catalogPath, 'utf8'));
|
|
49
|
+
|
|
50
|
+
const BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
51
|
+
function base58(bytes) {
|
|
52
|
+
let value = BigInt(`0x${Buffer.from(bytes).toString('hex') || '0'}`);
|
|
53
|
+
let out = '';
|
|
54
|
+
while (value > 0n) {
|
|
55
|
+
out = BASE58[Number(value % 58n)] + out;
|
|
56
|
+
value /= 58n;
|
|
57
|
+
}
|
|
58
|
+
for (const byte of bytes) {
|
|
59
|
+
if (byte !== 0) break;
|
|
60
|
+
out = `1${out}`;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A fixture ed25519 identity derived from a public label. Never use this pattern for a real key. */
|
|
66
|
+
function fixtureIdentity(label) {
|
|
67
|
+
const seed = createHash('sha256').update(label).digest();
|
|
68
|
+
const privateKey = createPrivateKey({
|
|
69
|
+
key: Buffer.concat([Buffer.from('302e020100300506032b657004220420', 'hex'), seed]),
|
|
70
|
+
format: 'der',
|
|
71
|
+
type: 'pkcs8',
|
|
72
|
+
});
|
|
73
|
+
const publicKey = createPublicKey(privateKey).export({ format: 'der', type: 'spki' }).subarray(-32);
|
|
74
|
+
return { address: base58(publicKey), signer: (message) => sign(null, Buffer.from(message), privateKey) };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function assertOk(result, label) {
|
|
78
|
+
if (!result.ok) {
|
|
79
|
+
throw new Error(`${label}:${JSON.stringify(result.errors ?? result, null, 2)}`);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function errorCodes(result) {
|
|
85
|
+
return result.ok ? [] : [...new Set(result.errors.map((item) => item.code))];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// --- Discover -----------------------------------------------------------------
|
|
89
|
+
const catalogValidation = assertOk(validateAiCatalog(catalog, {
|
|
90
|
+
rawSnapshotRef: 'file://examples/ard-no-spend-ai-catalog.json',
|
|
91
|
+
}), 'catalog_validation');
|
|
92
|
+
const snapshot = createAiCatalogSnapshot(catalog, {
|
|
93
|
+
rawSnapshotRef: 'file://examples/ard-no-spend-ai-catalog.json',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const normalized = assertOk(createAiCatalogDiscoveryCandidates(snapshot, {
|
|
97
|
+
sourceKind: 'direct-ai-catalog',
|
|
98
|
+
relevanceScores: {
|
|
99
|
+
'urn:ai:reddi.local:specialists:listing-writer': 0.93,
|
|
100
|
+
},
|
|
101
|
+
trustOptionsByResourceId: {
|
|
102
|
+
'urn:ai:reddi.local:specialists:listing-writer': {
|
|
103
|
+
verification: {
|
|
104
|
+
status: 'verified',
|
|
105
|
+
verifier: 'rap:local-demo-fixture',
|
|
106
|
+
checkedAt: createdAt,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
}), 'candidate_normalization');
|
|
111
|
+
|
|
112
|
+
const provider = fixtureIdentity('reddi:ard-no-spend:fixture-provider');
|
|
113
|
+
const otherProvider = fixtureIdentity('reddi:ard-no-spend:another-provider');
|
|
114
|
+
|
|
115
|
+
const candidate = {
|
|
116
|
+
...normalized.candidates[0],
|
|
117
|
+
quote: {
|
|
118
|
+
amount,
|
|
119
|
+
asset: 'AUDD',
|
|
120
|
+
network,
|
|
121
|
+
expiresAt: '2026-06-19T08:45:00.000Z',
|
|
122
|
+
payee: provider.address,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// --- Decide -------------------------------------------------------------------
|
|
127
|
+
const discoveryPolicy = {
|
|
128
|
+
allowedSourceKinds: ['direct-ai-catalog'],
|
|
129
|
+
requireVerifiedTrust: true,
|
|
130
|
+
allowedAssets: ['AUDD'],
|
|
131
|
+
allowedNetworks: [network],
|
|
132
|
+
maxQuote: { amount: '3000000', asset: 'AUDD', network },
|
|
133
|
+
};
|
|
134
|
+
const discoveryDecision = evaluateDiscoveryCandidatePolicyPreflight(candidate, discoveryPolicy);
|
|
135
|
+
const diagnostics = createSourceAwareCandidateDiagnostics(candidate, {
|
|
136
|
+
policyDecision: discoveryDecision,
|
|
137
|
+
reputation: { receiptCount: 0, attestationCount: 0 },
|
|
138
|
+
});
|
|
139
|
+
if (!discoveryDecision.allowed) {
|
|
140
|
+
throw new Error(`discovery_policy_denied:${discoveryDecision.reasonCodes.join(',')}`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// --- Call a local fixture specialist ------------------------------------------
|
|
144
|
+
const requestBody = JSON.stringify({
|
|
145
|
+
brief: 'Create a public marketplace listing for a local RAP-compatible documentation specialist.',
|
|
146
|
+
});
|
|
147
|
+
const responseBody = JSON.stringify({
|
|
148
|
+
title: 'RAP Documentation Listing Writer',
|
|
149
|
+
summary: 'Local fixture drafted a listing for the brief.',
|
|
150
|
+
reviewRequired: true,
|
|
151
|
+
noSpend: true,
|
|
152
|
+
});
|
|
153
|
+
const requestHash = hashReddiReceiptV2Body(requestBody);
|
|
154
|
+
const responseHash = hashReddiReceiptV2Body(responseBody);
|
|
155
|
+
|
|
156
|
+
// --- Prove: the provider signs a receipt, the buyer verifies it offline --------
|
|
157
|
+
// A made-up transaction signature: this quickstart pays nothing.
|
|
158
|
+
const fixtureTxSignature = base58(createHash('sha512').update('reddi:ard-no-spend:fixture-transaction').digest());
|
|
159
|
+
const payment = {
|
|
160
|
+
network,
|
|
161
|
+
txSignature: fixtureTxSignature,
|
|
162
|
+
currency: 'AUDD',
|
|
163
|
+
mint: AUDD_DETERMINISTIC_FIXTURE_MINT,
|
|
164
|
+
amount,
|
|
165
|
+
fee: { amount: '0' },
|
|
166
|
+
settlement: 'direct',
|
|
167
|
+
};
|
|
168
|
+
const signedReceipt = await signReddiReceiptV2({
|
|
169
|
+
schemaVersion: 'reddi.receipt.v2',
|
|
170
|
+
providerId: provider.address,
|
|
171
|
+
declaredModel,
|
|
172
|
+
requestHash,
|
|
173
|
+
responseHash,
|
|
174
|
+
payment,
|
|
175
|
+
jobId,
|
|
176
|
+
issuedAt: createdAt,
|
|
177
|
+
}, provider.signer);
|
|
178
|
+
|
|
179
|
+
// The buyer passes only what it knows itself: who it chose, what it sent and
|
|
180
|
+
// received, and the payment it would have made.
|
|
181
|
+
const buyerExpectation = {
|
|
182
|
+
providerId: provider.address,
|
|
183
|
+
declaredModel,
|
|
184
|
+
requestHash,
|
|
185
|
+
responseHash,
|
|
186
|
+
payment: { network, txSignature: fixtureTxSignature, currency: 'AUDD', mint: AUDD_DETERMINISTIC_FIXTURE_MINT, amount, settlement: 'direct' },
|
|
187
|
+
};
|
|
188
|
+
const verification = assertOk(verifyReddiReceiptV2(signedReceipt, buyerExpectation), 'receipt_verification');
|
|
189
|
+
|
|
190
|
+
// --- Evidence, attestation, reputation ----------------------------------------
|
|
191
|
+
// The archive refuses signature-shaped fields, so the evidence names the signed
|
|
192
|
+
// receipt by hash and keeps the receipt itself beside it.
|
|
193
|
+
const evidencePayload = {
|
|
194
|
+
signedReceiptHash: `sha256:${hashReddiReceiptV2Body(JSON.stringify(signedReceipt))}`,
|
|
195
|
+
sourceId,
|
|
196
|
+
specialistId,
|
|
197
|
+
};
|
|
198
|
+
const evidence = createEvidenceArchiveRecord({
|
|
199
|
+
id: evidenceId,
|
|
200
|
+
receiptId: jobId,
|
|
201
|
+
sourceId,
|
|
202
|
+
requestHash: `sha256:${requestHash}`,
|
|
203
|
+
responseHash: `sha256:${responseHash}`,
|
|
204
|
+
evidenceRef: 'file://artifacts/ard-no-spend/evidence-001.json',
|
|
205
|
+
createdAt,
|
|
206
|
+
evidencePayload,
|
|
207
|
+
metadata: { publicLabel: 'ARD no-spend quickstart fixture' },
|
|
208
|
+
});
|
|
209
|
+
const archive = createLocalEvidenceArchive([evidence]);
|
|
210
|
+
|
|
211
|
+
const attestation = createAttestationRecord({
|
|
212
|
+
schemaVersion: 'reddi.attestation.v1',
|
|
213
|
+
id: 'attestation:ard-no-spend-001',
|
|
214
|
+
receiptId: jobId,
|
|
215
|
+
evidenceId: evidence.id,
|
|
216
|
+
evidenceRef: evidence.evidenceRef,
|
|
217
|
+
evidenceHash: evidence.evidenceHash,
|
|
218
|
+
attestor: { id: 'attestor:local-fixture', type: 'local-fixture' },
|
|
219
|
+
trustBoundary: 'self_attested',
|
|
220
|
+
verdict: 'passed',
|
|
221
|
+
workStatus: 'completed',
|
|
222
|
+
confidence: 82,
|
|
223
|
+
rubric: {
|
|
224
|
+
dimensions: [
|
|
225
|
+
{ id: 'evidence_integrity', score: 88, weight: 1, summary: 'Signed receipt and evidence hashes are present.', reasonCodes: ['evidence_attached'] },
|
|
226
|
+
{ id: 'policy_compliance', score: 92, weight: 1, summary: 'Discovery policy allowed the fixture call.', reasonCodes: ['policy_allowed'] },
|
|
227
|
+
{ id: 'delivery_quality', score: 84, weight: 1, summary: 'Fixture produced a deterministic listing draft.', reasonCodes: ['specialist_completed'] },
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
createdAt,
|
|
231
|
+
});
|
|
232
|
+
const reputation = applyAttestationToReputation(
|
|
233
|
+
attestation,
|
|
234
|
+
createInitialReputationState({ id: specialistId, type: 'specialist' }, createdAt),
|
|
235
|
+
{ now: createdAt },
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
// --- Failure states: each one must refuse --------------------------------------
|
|
239
|
+
const policyDenial = evaluateDiscoveryCandidatePolicyPreflight(candidate, {
|
|
240
|
+
...discoveryPolicy,
|
|
241
|
+
maxQuote: { amount: '1000', asset: 'AUDD', network },
|
|
242
|
+
});
|
|
243
|
+
const unsupportedNetwork = evaluateDiscoveryCandidatePolicyPreflight(candidate, {
|
|
244
|
+
...discoveryPolicy,
|
|
245
|
+
allowedNetworks: ['solana-mainnet-beta'],
|
|
246
|
+
maxQuote: { amount: '3000000', asset: 'AUDD', network: 'solana-mainnet-beta' },
|
|
247
|
+
});
|
|
248
|
+
const tamperedResponse = verifyReddiReceiptV2(signedReceipt, {
|
|
249
|
+
...buyerExpectation,
|
|
250
|
+
responseHash: hashReddiReceiptV2Body(`${responseBody} `),
|
|
251
|
+
});
|
|
252
|
+
const wrongProvider = verifyReddiReceiptV2(signedReceipt, { ...buyerExpectation, providerId: otherProvider.address });
|
|
253
|
+
const editedAfterSigning = verifyReddiReceiptV2({
|
|
254
|
+
...signedReceipt,
|
|
255
|
+
receipt: { ...signedReceipt.receipt, declaredModel: 'fixture/a-bigger-model' },
|
|
256
|
+
});
|
|
257
|
+
const differentPayment = verifyReddiReceiptV2(signedReceipt, {
|
|
258
|
+
...buyerExpectation,
|
|
259
|
+
payment: { ...buyerExpectation.payment, amount: '1' },
|
|
260
|
+
});
|
|
261
|
+
const removedVersion = validateReddiReceiptV2({ ...signedReceipt.receipt, schemaVersion: 'reddi.receipt.v1' });
|
|
262
|
+
const missingEvidence = validateEvidenceArchiveRecord(evidence);
|
|
263
|
+
const unsafeMetadata = validateEvidenceArchiveRecord({
|
|
264
|
+
...evidence,
|
|
265
|
+
metadata: {
|
|
266
|
+
publicLabel: 'unsafe metadata fixture',
|
|
267
|
+
api_key: 'redacted',
|
|
268
|
+
},
|
|
269
|
+
}, evidencePayload);
|
|
270
|
+
|
|
271
|
+
console.log(JSON.stringify({
|
|
272
|
+
ok: true,
|
|
273
|
+
mode: 'no-spend',
|
|
274
|
+
catalog: {
|
|
275
|
+
valid: catalogValidation.ok,
|
|
276
|
+
rawSnapshotRef: snapshot.rawSnapshotRef,
|
|
277
|
+
publisher: snapshot.publisher,
|
|
278
|
+
resourceCount: snapshot.resources.length,
|
|
279
|
+
},
|
|
280
|
+
discovery: {
|
|
281
|
+
candidate: {
|
|
282
|
+
identifier: candidate.identifier,
|
|
283
|
+
name: candidate.name,
|
|
284
|
+
sourceKind: candidate.sourceKind,
|
|
285
|
+
publisher: candidate.publisher,
|
|
286
|
+
trustStatus: candidate.providerTrust?.verification.status,
|
|
287
|
+
relevanceScore: candidate.relevance?.score,
|
|
288
|
+
},
|
|
289
|
+
policyDecision: {
|
|
290
|
+
allowed: discoveryDecision.allowed,
|
|
291
|
+
reasonCodes: discoveryDecision.reasonCodes,
|
|
292
|
+
},
|
|
293
|
+
diagnostics: {
|
|
294
|
+
capability: diagnostics.capabilityMatch.summary,
|
|
295
|
+
publisher: diagnostics.publisherIdentity.summary,
|
|
296
|
+
trust: diagnostics.trustEvidence.summary,
|
|
297
|
+
payment: diagnostics.paymentFit.summary,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
receipt: {
|
|
301
|
+
schemaVersion: verification.receipt.schemaVersion,
|
|
302
|
+
verified: verification.ok,
|
|
303
|
+
providerId: verification.receipt.providerId,
|
|
304
|
+
declaredModel: verification.receipt.declaredModel,
|
|
305
|
+
jobId: verification.receipt.jobId,
|
|
306
|
+
requestHash: verification.receipt.requestHash,
|
|
307
|
+
responseHash: verification.receipt.responseHash,
|
|
308
|
+
payment: {
|
|
309
|
+
currency: verification.receipt.payment.currency,
|
|
310
|
+
network: verification.receipt.payment.network,
|
|
311
|
+
amount: verification.receipt.payment.amount,
|
|
312
|
+
settlement: verification.receipt.payment.settlement,
|
|
313
|
+
fixtureTransaction: true,
|
|
314
|
+
},
|
|
315
|
+
reading: 'The provider declared this model and this payment. It is not proof of which model ran, and no payment was made.',
|
|
316
|
+
},
|
|
317
|
+
evidence: {
|
|
318
|
+
evidenceId: evidence.id,
|
|
319
|
+
receiptId: evidence.receiptId,
|
|
320
|
+
evidenceRef: evidence.evidenceRef,
|
|
321
|
+
evidenceHash: evidence.evidenceHash,
|
|
322
|
+
archiveHasEvidence: archive.has(evidence.id),
|
|
323
|
+
},
|
|
324
|
+
attestation: {
|
|
325
|
+
id: attestation.id,
|
|
326
|
+
verdict: attestation.verdict,
|
|
327
|
+
trustBoundary: attestation.trustBoundary,
|
|
328
|
+
reputationScore: reputation.ok ? reputation.state.score : undefined,
|
|
329
|
+
routingImpact: reputation.ok ? reputation.state.routingImpact : undefined,
|
|
330
|
+
},
|
|
331
|
+
failures: {
|
|
332
|
+
policyDenial: { allowed: policyDenial.allowed, reasonCodes: policyDenial.reasonCodes },
|
|
333
|
+
unsupportedNetwork: { allowed: unsupportedNetwork.allowed, reasonCodes: unsupportedNetwork.reasonCodes },
|
|
334
|
+
tamperedResponse: { ok: tamperedResponse.ok, errorCodes: errorCodes(tamperedResponse) },
|
|
335
|
+
wrongProvider: { ok: wrongProvider.ok, errorCodes: errorCodes(wrongProvider) },
|
|
336
|
+
editedAfterSigning: { ok: editedAfterSigning.ok, errorCodes: errorCodes(editedAfterSigning) },
|
|
337
|
+
differentPayment: { ok: differentPayment.ok, errorCodes: errorCodes(differentPayment) },
|
|
338
|
+
removedReceiptVersion: { ok: removedVersion.ok, errorCodes: errorCodes(removedVersion) },
|
|
339
|
+
missingEvidence: { ok: missingEvidence.ok, errorCodes: errorCodes(missingEvidence) },
|
|
340
|
+
unsafeMetadata: { ok: unsafeMetadata.ok, errorCodes: errorCodes(unsafeMetadata) },
|
|
341
|
+
},
|
|
342
|
+
boundaries: {
|
|
343
|
+
hostedService: false,
|
|
344
|
+
paidProvider: false,
|
|
345
|
+
walletAccess: false,
|
|
346
|
+
rpcCall: false,
|
|
347
|
+
splTransfer: false,
|
|
348
|
+
quasarCustody: false,
|
|
349
|
+
settlementFinalityProof: false,
|
|
350
|
+
modelExecutionProof: false,
|
|
351
|
+
trustUpgrade: false,
|
|
352
|
+
reputationMutation: false,
|
|
353
|
+
livePayment: false,
|
|
354
|
+
},
|
|
355
|
+
}, null, 2));
|