@hlos-ai/schemas 0.4.2 → 0.7.1

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/dist/index.d.ts CHANGED
@@ -1,6 +1,87 @@
1
1
  import { z } from 'zod';
2
- import { ReceiptId } from './ids.js';
3
- export { CorrelationId, CorrelationIdSchema, CrossingId, CrossingIdSchema, IdempotencyKey, IdempotencyKeySchema, PassportId, PassportIdSchema, ReceiptIdSchema, WalletId, WalletIdSchema, generateCrossingId, generateId, generatePassportId, generateReceiptId, generateWalletId } from './ids.js';
2
+ export { C as CONTENT_HASH_LENGTH, h as RECEIPT_HASH_GOLDEN_FIXTURE, R as RECEIPT_TYPE_URI, a as RECEIPT_VERSION, g as ReceiptHashSchema, S as SIGNATURE_LENGTH, b as SignedReceiptV0, d as SignedReceiptV0LooseSchema, c as SignedReceiptV0Schema, f as computeContentHash, e as computeReceiptHash, i as isSignedReceiptV0, j as jcsCanonicalize } from './receipt-hash-B3OwdB1v.js';
3
+ import { DispatchId, DispatchIdBrand } from './ids.js';
4
+ export { CorrelationId, CorrelationIdSchema, CrossingId, CrossingIdSchema, DispatchIdSchema, IdempotencyKey, IdempotencyKeySchema, PassportId, PassportIdSchema, ReceiptId, ReceiptIdSchema, WalletId, WalletIdSchema, generateCrossingId, generateDispatchId, generateId, generatePassportId, generateReceiptId, generateWalletId } from './ids.js';
5
+
6
+ declare const AAR_ENVELOPE_TYPE: "https://hlos.ai/schema/AAREnvelopeV0";
7
+ declare const AAR_ENVELOPE_VERSION: 0;
8
+ /**
9
+ * Agent Action Receipt Envelope V0
10
+ *
11
+ * Wraps inner receipts or artifacts in a uniform, verifiable envelope.
12
+ *
13
+ * V0 intentionally uses z.unknown() for inner payloads.
14
+ * Wiring PRs must narrow by content_type before production issuance.
15
+ */
16
+ declare const AAREnvelopeV0Schema: z.ZodObject<{
17
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/AAREnvelopeV0">;
18
+ version: z.ZodLiteral<0>;
19
+ content_type: z.ZodString;
20
+ content_hash: z.ZodString;
21
+ inner: z.ZodUnknown;
22
+ signer_id: z.ZodString;
23
+ signature: z.ZodString;
24
+ issued_at: z.ZodString;
25
+ previous_aar_hash: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ '@type': "https://hlos.ai/schema/AAREnvelopeV0";
28
+ version: 0;
29
+ content_type: string;
30
+ content_hash: string;
31
+ signer_id: string;
32
+ signature: string;
33
+ issued_at: string;
34
+ previous_aar_hash: string;
35
+ inner?: unknown;
36
+ }, {
37
+ '@type': "https://hlos.ai/schema/AAREnvelopeV0";
38
+ version: 0;
39
+ content_type: string;
40
+ content_hash: string;
41
+ signer_id: string;
42
+ signature: string;
43
+ issued_at: string;
44
+ previous_aar_hash: string;
45
+ inner?: unknown;
46
+ }>;
47
+ declare const AAREnvelopeV0TypedSchema: <T extends z.ZodTypeAny>(contentType: string, innerSchema: T) => z.ZodObject<{
48
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/AAREnvelopeV0">;
49
+ version: z.ZodLiteral<0>;
50
+ content_hash: z.ZodString;
51
+ signer_id: z.ZodString;
52
+ signature: z.ZodString;
53
+ issued_at: z.ZodString;
54
+ previous_aar_hash: z.ZodString;
55
+ } & {
56
+ content_type: z.ZodLiteral<string>;
57
+ inner: T;
58
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
59
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/AAREnvelopeV0">;
60
+ version: z.ZodLiteral<0>;
61
+ content_hash: z.ZodString;
62
+ signer_id: z.ZodString;
63
+ signature: z.ZodString;
64
+ issued_at: z.ZodString;
65
+ previous_aar_hash: z.ZodString;
66
+ } & {
67
+ content_type: z.ZodLiteral<string>;
68
+ inner: T;
69
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
70
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/AAREnvelopeV0">;
71
+ version: z.ZodLiteral<0>;
72
+ content_hash: z.ZodString;
73
+ signer_id: z.ZodString;
74
+ signature: z.ZodString;
75
+ issued_at: z.ZodString;
76
+ previous_aar_hash: z.ZodString;
77
+ } & {
78
+ content_type: z.ZodLiteral<string>;
79
+ inner: T;
80
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
81
+ type AAREnvelopeV0 = z.infer<typeof AAREnvelopeV0Schema>;
82
+
83
+ type VerifyKey = CryptoKey | Uint8Array;
84
+ declare function verifyAAR(envelope: unknown, publicKey: VerifyKey): Promise<AAREnvelopeV0>;
4
85
 
5
86
  /**
6
87
  * @hlos-ai/schemas - Surface Types
@@ -151,148 +232,6 @@ declare const ErrorResponseSchema: z.ZodObject<{
151
232
  };
152
233
  }>;
153
234
 
154
- /**
155
- * @hlos-ai/schemas - SignedReceiptV0
156
- *
157
- * Canonical receipt format for HLOS Kernel v2 mutations.
158
- * All mutating operations emit this receipt type.
159
- *
160
- * FROZEN: Breaking changes require version bump.
161
- */
162
-
163
- /**
164
- * Receipt type URI (JSON-LD style).
165
- */
166
- declare const RECEIPT_TYPE_URI: "https://hlos.ai/schema/SignedReceiptV0";
167
- /**
168
- * Current receipt format version.
169
- * This is a NUMBER, not semver.
170
- */
171
- declare const RECEIPT_VERSION: 0;
172
- /**
173
- * SignedReceiptV0: Canonical receipt for all v2 mutations.
174
- *
175
- * Content is JCS-canonicalized, SHA-256 hashed, Ed25519 signed.
176
- *
177
- * @template T - The content type (mutation-specific payload)
178
- */
179
- interface SignedReceiptV0<T = unknown> {
180
- /**
181
- * Type URI for JSON-LD compatibility.
182
- */
183
- '@type': typeof RECEIPT_TYPE_URI;
184
- /**
185
- * Format version (number, not semver).
186
- * Increment for breaking format changes.
187
- */
188
- version: typeof RECEIPT_VERSION;
189
- /**
190
- * Unique receipt identifier.
191
- */
192
- receipt_id: ReceiptId | string;
193
- /**
194
- * The mutation payload (JCS-canonicalized before hashing).
195
- */
196
- content: T;
197
- /**
198
- * SHA-256 hash of JCS(content), base64url encoded.
199
- *
200
- * IMPORTANT: This is base64url of the raw 32-byte digest,
201
- * NOT hex encoding. Matches signature input format.
202
- */
203
- content_hash: string;
204
- /**
205
- * Ed25519 signature over the raw 32-byte content_hash digest.
206
- * base64url encoded.
207
- *
208
- * Signing process:
209
- * 1. canonicalize = JCS(content)
210
- * 2. digest = SHA-256(canonicalize) → 32 bytes
211
- * 3. signature = Ed25519.sign(private_key, digest)
212
- * 4. encode = base64url(signature)
213
- */
214
- signature: string;
215
- /**
216
- * Key identifier for signature verification.
217
- * Resolves via JWKS endpoint: GET /api/v2/.well-known/keys
218
- */
219
- key_id: string;
220
- /**
221
- * ISO 8601 timestamp when receipt was issued.
222
- */
223
- issued_at: string;
224
- }
225
- /**
226
- * Strict base64url length constants:
227
- * - SHA-256 digest (32 bytes) = 43 chars base64url (no padding)
228
- * - Ed25519 signature (64 bytes) = 86 chars base64url (no padding)
229
- */
230
- declare const CONTENT_HASH_LENGTH = 43;
231
- declare const SIGNATURE_LENGTH = 86;
232
- declare const SignedReceiptV0Schema: <T extends z.ZodType>(contentSchema: T) => z.ZodObject<{
233
- '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedReceiptV0">;
234
- version: z.ZodLiteral<0>;
235
- receipt_id: z.ZodString;
236
- content: T;
237
- content_hash: z.ZodString;
238
- signature: z.ZodString;
239
- key_id: z.ZodString;
240
- issued_at: z.ZodString;
241
- }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
242
- '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedReceiptV0">;
243
- version: z.ZodLiteral<0>;
244
- receipt_id: z.ZodString;
245
- content: T;
246
- content_hash: z.ZodString;
247
- signature: z.ZodString;
248
- key_id: z.ZodString;
249
- issued_at: z.ZodString;
250
- }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
251
- '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedReceiptV0">;
252
- version: z.ZodLiteral<0>;
253
- receipt_id: z.ZodString;
254
- content: T;
255
- content_hash: z.ZodString;
256
- signature: z.ZodString;
257
- key_id: z.ZodString;
258
- issued_at: z.ZodString;
259
- }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
260
- /**
261
- * Loose schema for unknown content types.
262
- */
263
- declare const SignedReceiptV0LooseSchema: z.ZodObject<{
264
- '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedReceiptV0">;
265
- version: z.ZodLiteral<0>;
266
- receipt_id: z.ZodString;
267
- content: z.ZodUnknown;
268
- content_hash: z.ZodString;
269
- signature: z.ZodString;
270
- key_id: z.ZodString;
271
- issued_at: z.ZodString;
272
- }, "strip", z.ZodTypeAny, {
273
- '@type': "https://hlos.ai/schema/SignedReceiptV0";
274
- version: 0;
275
- receipt_id: string;
276
- content_hash: string;
277
- signature: string;
278
- key_id: string;
279
- issued_at: string;
280
- content?: unknown;
281
- }, {
282
- '@type': "https://hlos.ai/schema/SignedReceiptV0";
283
- version: 0;
284
- receipt_id: string;
285
- content_hash: string;
286
- signature: string;
287
- key_id: string;
288
- issued_at: string;
289
- content?: unknown;
290
- }>;
291
- /**
292
- * Check if a value is a SignedReceiptV0.
293
- */
294
- declare function isSignedReceiptV0(value: unknown): value is SignedReceiptV0;
295
-
296
235
  /**
297
236
  * @hlos-ai/schemas - Shared Contract Types
298
237
  *
@@ -1295,116 +1234,335 @@ declare const Base64urlSha256Schema: z.ZodString;
1295
1234
  */
1296
1235
  declare const Base64urlEd25519SigSchema: z.ZodString;
1297
1236
 
1237
+ declare const CHAIN_STAGE_ORDER: readonly ["CR", "LAT", "EGP", "SA"];
1238
+ declare const ChainStageTypeSchema: z.ZodEnum<["CR", "LAT", "EGP", "SA"]>;
1239
+ type ChainStageType = z.infer<typeof ChainStageTypeSchema>;
1240
+ declare const CustodyReceiptContentSchema: z.ZodObject<{
1241
+ type: z.ZodLiteral<"CustodyReceipt">;
1242
+ stage_type: z.ZodLiteral<"CR">;
1243
+ stage_version: z.ZodLiteral<0>;
1244
+ stage_index: z.ZodLiteral<0>;
1245
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1246
+ previous_receipt_hash: z.ZodNull;
1247
+ actor_passport_id: z.ZodString;
1248
+ surface: z.ZodString;
1249
+ task_scope: z.ZodString;
1250
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1251
+ }, "strict", z.ZodTypeAny, {
1252
+ type: "CustodyReceipt";
1253
+ settlement_authority: "hlos.ai";
1254
+ stage_type: "CR";
1255
+ stage_version: 0;
1256
+ stage_index: 0;
1257
+ dispatch_id: string & {
1258
+ readonly [DispatchIdBrand]: true;
1259
+ };
1260
+ previous_receipt_hash: null;
1261
+ actor_passport_id: string;
1262
+ surface: string;
1263
+ task_scope: string;
1264
+ }, {
1265
+ type: "CustodyReceipt";
1266
+ settlement_authority: "hlos.ai";
1267
+ stage_type: "CR";
1268
+ stage_version: 0;
1269
+ stage_index: 0;
1270
+ dispatch_id: string;
1271
+ previous_receipt_hash: null;
1272
+ actor_passport_id: string;
1273
+ surface: string;
1274
+ task_scope: string;
1275
+ }>;
1276
+ type CustodyReceiptContent = z.infer<typeof CustodyReceiptContentSchema>;
1277
+ declare const LiabilityAttestationContentSchema: z.ZodObject<{
1278
+ type: z.ZodLiteral<"LiabilityAttestation">;
1279
+ stage_type: z.ZodLiteral<"LAT">;
1280
+ stage_version: z.ZodLiteral<0>;
1281
+ stage_index: z.ZodLiteral<1>;
1282
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1283
+ previous_receipt_hash: z.ZodString;
1284
+ chain_root_content_hash: z.ZodString;
1285
+ policy_snapshot_hash: z.ZodString;
1286
+ capabilities_granted: z.ZodArray<z.ZodString, "many">;
1287
+ authorization_scope: z.ZodString;
1288
+ /** Receipt issuer authority (HLOS issues all chain artifacts). */
1289
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1290
+ }, "strict", z.ZodTypeAny, {
1291
+ type: "LiabilityAttestation";
1292
+ settlement_authority: "hlos.ai";
1293
+ stage_type: "LAT";
1294
+ stage_version: 0;
1295
+ stage_index: 1;
1296
+ dispatch_id: string & {
1297
+ readonly [DispatchIdBrand]: true;
1298
+ };
1299
+ previous_receipt_hash: string;
1300
+ chain_root_content_hash: string;
1301
+ policy_snapshot_hash: string;
1302
+ capabilities_granted: string[];
1303
+ authorization_scope: string;
1304
+ }, {
1305
+ type: "LiabilityAttestation";
1306
+ settlement_authority: "hlos.ai";
1307
+ stage_type: "LAT";
1308
+ stage_version: 0;
1309
+ stage_index: 1;
1310
+ dispatch_id: string;
1311
+ previous_receipt_hash: string;
1312
+ chain_root_content_hash: string;
1313
+ policy_snapshot_hash: string;
1314
+ capabilities_granted: string[];
1315
+ authorization_scope: string;
1316
+ }>;
1317
+ type LiabilityAttestationContent = z.infer<typeof LiabilityAttestationContentSchema>;
1318
+ declare const EconomicGateProofContentSchema: z.ZodObject<{
1319
+ type: z.ZodLiteral<"EconomicGateProof">;
1320
+ stage_type: z.ZodLiteral<"EGP">;
1321
+ stage_version: z.ZodLiteral<0>;
1322
+ stage_index: z.ZodLiteral<2>;
1323
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1324
+ previous_receipt_hash: z.ZodString;
1325
+ chain_root_content_hash: z.ZodString;
1326
+ wallet_id: z.ZodString;
1327
+ hold_id: z.ZodOptional<z.ZodString>;
1328
+ amount_mills: z.ZodNumber;
1329
+ currency: z.ZodLiteral<"USD">;
1330
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1331
+ }, "strict", z.ZodTypeAny, {
1332
+ type: "EconomicGateProof";
1333
+ settlement_authority: "hlos.ai";
1334
+ currency: "USD";
1335
+ stage_type: "EGP";
1336
+ stage_version: 0;
1337
+ stage_index: 2;
1338
+ dispatch_id: string & {
1339
+ readonly [DispatchIdBrand]: true;
1340
+ };
1341
+ previous_receipt_hash: string;
1342
+ chain_root_content_hash: string;
1343
+ wallet_id: string;
1344
+ amount_mills: number;
1345
+ hold_id?: string | undefined;
1346
+ }, {
1347
+ type: "EconomicGateProof";
1348
+ settlement_authority: "hlos.ai";
1349
+ currency: "USD";
1350
+ stage_type: "EGP";
1351
+ stage_version: 0;
1352
+ stage_index: 2;
1353
+ dispatch_id: string;
1354
+ previous_receipt_hash: string;
1355
+ chain_root_content_hash: string;
1356
+ wallet_id: string;
1357
+ amount_mills: number;
1358
+ hold_id?: string | undefined;
1359
+ }>;
1360
+ type EconomicGateProofContent = z.infer<typeof EconomicGateProofContentSchema>;
1361
+ declare const SettlementAnchorContentSchema: z.ZodObject<{
1362
+ type: z.ZodLiteral<"SettlementAnchor">;
1363
+ stage_type: z.ZodLiteral<"SA">;
1364
+ stage_version: z.ZodLiteral<0>;
1365
+ stage_index: z.ZodLiteral<3>;
1366
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1367
+ previous_receipt_hash: z.ZodString;
1368
+ chain_root_content_hash: z.ZodString;
1369
+ settlement_receipt_hash: z.ZodString;
1370
+ crossing_id: z.ZodOptional<z.ZodString>;
1371
+ final_amount_mills: z.ZodNumber;
1372
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1373
+ }, "strict", z.ZodTypeAny, {
1374
+ type: "SettlementAnchor";
1375
+ settlement_authority: "hlos.ai";
1376
+ stage_type: "SA";
1377
+ stage_version: 0;
1378
+ stage_index: 3;
1379
+ dispatch_id: string & {
1380
+ readonly [DispatchIdBrand]: true;
1381
+ };
1382
+ previous_receipt_hash: string;
1383
+ chain_root_content_hash: string;
1384
+ settlement_receipt_hash: string;
1385
+ final_amount_mills: number;
1386
+ crossing_id?: string | undefined;
1387
+ }, {
1388
+ type: "SettlementAnchor";
1389
+ settlement_authority: "hlos.ai";
1390
+ stage_type: "SA";
1391
+ stage_version: 0;
1392
+ stage_index: 3;
1393
+ dispatch_id: string;
1394
+ previous_receipt_hash: string;
1395
+ chain_root_content_hash: string;
1396
+ settlement_receipt_hash: string;
1397
+ final_amount_mills: number;
1398
+ crossing_id?: string | undefined;
1399
+ }>;
1400
+ type SettlementAnchorContent = z.infer<typeof SettlementAnchorContentSchema>;
1401
+ declare const DispatchChainContentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1402
+ type: z.ZodLiteral<"CustodyReceipt">;
1403
+ stage_type: z.ZodLiteral<"CR">;
1404
+ stage_version: z.ZodLiteral<0>;
1405
+ stage_index: z.ZodLiteral<0>;
1406
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1407
+ previous_receipt_hash: z.ZodNull;
1408
+ actor_passport_id: z.ZodString;
1409
+ surface: z.ZodString;
1410
+ task_scope: z.ZodString;
1411
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1412
+ }, "strict", z.ZodTypeAny, {
1413
+ type: "CustodyReceipt";
1414
+ settlement_authority: "hlos.ai";
1415
+ stage_type: "CR";
1416
+ stage_version: 0;
1417
+ stage_index: 0;
1418
+ dispatch_id: string & {
1419
+ readonly [DispatchIdBrand]: true;
1420
+ };
1421
+ previous_receipt_hash: null;
1422
+ actor_passport_id: string;
1423
+ surface: string;
1424
+ task_scope: string;
1425
+ }, {
1426
+ type: "CustodyReceipt";
1427
+ settlement_authority: "hlos.ai";
1428
+ stage_type: "CR";
1429
+ stage_version: 0;
1430
+ stage_index: 0;
1431
+ dispatch_id: string;
1432
+ previous_receipt_hash: null;
1433
+ actor_passport_id: string;
1434
+ surface: string;
1435
+ task_scope: string;
1436
+ }>, z.ZodObject<{
1437
+ type: z.ZodLiteral<"LiabilityAttestation">;
1438
+ stage_type: z.ZodLiteral<"LAT">;
1439
+ stage_version: z.ZodLiteral<0>;
1440
+ stage_index: z.ZodLiteral<1>;
1441
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1442
+ previous_receipt_hash: z.ZodString;
1443
+ chain_root_content_hash: z.ZodString;
1444
+ policy_snapshot_hash: z.ZodString;
1445
+ capabilities_granted: z.ZodArray<z.ZodString, "many">;
1446
+ authorization_scope: z.ZodString;
1447
+ /** Receipt issuer authority (HLOS issues all chain artifacts). */
1448
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1449
+ }, "strict", z.ZodTypeAny, {
1450
+ type: "LiabilityAttestation";
1451
+ settlement_authority: "hlos.ai";
1452
+ stage_type: "LAT";
1453
+ stage_version: 0;
1454
+ stage_index: 1;
1455
+ dispatch_id: string & {
1456
+ readonly [DispatchIdBrand]: true;
1457
+ };
1458
+ previous_receipt_hash: string;
1459
+ chain_root_content_hash: string;
1460
+ policy_snapshot_hash: string;
1461
+ capabilities_granted: string[];
1462
+ authorization_scope: string;
1463
+ }, {
1464
+ type: "LiabilityAttestation";
1465
+ settlement_authority: "hlos.ai";
1466
+ stage_type: "LAT";
1467
+ stage_version: 0;
1468
+ stage_index: 1;
1469
+ dispatch_id: string;
1470
+ previous_receipt_hash: string;
1471
+ chain_root_content_hash: string;
1472
+ policy_snapshot_hash: string;
1473
+ capabilities_granted: string[];
1474
+ authorization_scope: string;
1475
+ }>, z.ZodObject<{
1476
+ type: z.ZodLiteral<"EconomicGateProof">;
1477
+ stage_type: z.ZodLiteral<"EGP">;
1478
+ stage_version: z.ZodLiteral<0>;
1479
+ stage_index: z.ZodLiteral<2>;
1480
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1481
+ previous_receipt_hash: z.ZodString;
1482
+ chain_root_content_hash: z.ZodString;
1483
+ wallet_id: z.ZodString;
1484
+ hold_id: z.ZodOptional<z.ZodString>;
1485
+ amount_mills: z.ZodNumber;
1486
+ currency: z.ZodLiteral<"USD">;
1487
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1488
+ }, "strict", z.ZodTypeAny, {
1489
+ type: "EconomicGateProof";
1490
+ settlement_authority: "hlos.ai";
1491
+ currency: "USD";
1492
+ stage_type: "EGP";
1493
+ stage_version: 0;
1494
+ stage_index: 2;
1495
+ dispatch_id: string & {
1496
+ readonly [DispatchIdBrand]: true;
1497
+ };
1498
+ previous_receipt_hash: string;
1499
+ chain_root_content_hash: string;
1500
+ wallet_id: string;
1501
+ amount_mills: number;
1502
+ hold_id?: string | undefined;
1503
+ }, {
1504
+ type: "EconomicGateProof";
1505
+ settlement_authority: "hlos.ai";
1506
+ currency: "USD";
1507
+ stage_type: "EGP";
1508
+ stage_version: 0;
1509
+ stage_index: 2;
1510
+ dispatch_id: string;
1511
+ previous_receipt_hash: string;
1512
+ chain_root_content_hash: string;
1513
+ wallet_id: string;
1514
+ amount_mills: number;
1515
+ hold_id?: string | undefined;
1516
+ }>, z.ZodObject<{
1517
+ type: z.ZodLiteral<"SettlementAnchor">;
1518
+ stage_type: z.ZodLiteral<"SA">;
1519
+ stage_version: z.ZodLiteral<0>;
1520
+ stage_index: z.ZodLiteral<3>;
1521
+ dispatch_id: z.ZodEffects<z.ZodString, DispatchId, string>;
1522
+ previous_receipt_hash: z.ZodString;
1523
+ chain_root_content_hash: z.ZodString;
1524
+ settlement_receipt_hash: z.ZodString;
1525
+ crossing_id: z.ZodOptional<z.ZodString>;
1526
+ final_amount_mills: z.ZodNumber;
1527
+ settlement_authority: z.ZodLiteral<"hlos.ai">;
1528
+ }, "strict", z.ZodTypeAny, {
1529
+ type: "SettlementAnchor";
1530
+ settlement_authority: "hlos.ai";
1531
+ stage_type: "SA";
1532
+ stage_version: 0;
1533
+ stage_index: 3;
1534
+ dispatch_id: string & {
1535
+ readonly [DispatchIdBrand]: true;
1536
+ };
1537
+ previous_receipt_hash: string;
1538
+ chain_root_content_hash: string;
1539
+ settlement_receipt_hash: string;
1540
+ final_amount_mills: number;
1541
+ crossing_id?: string | undefined;
1542
+ }, {
1543
+ type: "SettlementAnchor";
1544
+ settlement_authority: "hlos.ai";
1545
+ stage_type: "SA";
1546
+ stage_version: 0;
1547
+ stage_index: 3;
1548
+ dispatch_id: string;
1549
+ previous_receipt_hash: string;
1550
+ chain_root_content_hash: string;
1551
+ settlement_receipt_hash: string;
1552
+ final_amount_mills: number;
1553
+ crossing_id?: string | undefined;
1554
+ }>]>;
1555
+ type DispatchChainContent = z.infer<typeof DispatchChainContentSchema>;
1298
1556
  /**
1299
- * @hlos-ai/schemas - Receipt Hash Computation
1300
- *
1301
- * Canonical hash computation for HLOS receipts.
1302
- *
1303
- * receipt_hash = base64url(SHA-256(JCS(receipt)))
1304
- *
1305
- * This is the hash that:
1306
- * - BazaarReceiptEnvelope references (hash-first, per BRIDGE_SPEC.md §1.1)
1307
- * - Notary Attestation (NA) binds to (per BRIDGE_SPEC.md §4.3)
1308
- * - Surfaces use to reference kernel receipts unambiguously
1309
- *
1310
- * IMPORTANT: receipt_hash is computed over the ENTIRE SignedReceiptV0 envelope
1311
- * (including content, content_hash, signature, key_id, etc.), NOT just content.
1312
- * This binds the hash to a specific signed receipt version.
1313
- *
1314
- * Requires @noble/hashes as peer dependency.
1315
- *
1316
- * @see BRIDGE_SPEC.md §1.3 for canonical hashing requirements
1317
- */
1318
-
1319
- /**
1320
- * JCS (RFC 8785) canonical JSON serialization.
1321
- *
1322
- * Per RFC 8785:
1323
- * - Object keys are lexicographically sorted
1324
- * - Numbers use ES6 serialization
1325
- * - Rejects: undefined, functions, symbols, bigint, non-finite numbers
1326
- *
1327
- * @throws Error if value contains non-canonicalizable types
1328
- */
1329
- declare function jcsCanonicalize(value: unknown): string;
1330
- /**
1331
- * Compute receipt_hash for a SignedReceiptV0.
1332
- *
1333
- * receipt_hash = base64url(SHA-256(JCS(receipt)))
1334
- *
1335
- * The hash is over the ENTIRE receipt envelope (content, content_hash,
1336
- * signature, key_id, @type, version, receipt_id, issued_at).
1337
- *
1338
- * This is the canonical hash format per BRIDGE_SPEC.md §1.3:
1339
- * 1. Canonicalize the receipt using RFC 8785 JCS
1340
- * 2. Hash canonical bytes using SHA-256
1341
- * 3. Encode as base64url (no padding)
1342
- *
1343
- * @param receipt - A fully-formed SignedReceiptV0 (must already be signed)
1344
- * @returns 43-char base64url string (32-byte SHA-256 digest)
1345
- *
1346
- * @example
1347
- * ```typescript
1348
- * const receipt = issueReceiptV0(content);
1349
- * const hash = computeReceiptHash(receipt);
1350
- * // hash is e.g. "z8A2kCNck4rPL4ugNe-Fbxputdi3PkjkVpSrIBhojU0"
1351
- * ```
1352
- */
1353
- declare function computeReceiptHash(receipt: SignedReceiptV0): string;
1354
- /**
1355
- * Compute content_hash for arbitrary content.
1356
- *
1357
- * content_hash = base64url(SHA-256(JCS(content)))
1358
- *
1359
- * This is the hash stored in SignedReceiptV0.content_hash.
1360
- * It hashes only the content field, NOT the entire receipt.
1361
- *
1362
- * @param content - The content to hash (will be JCS-canonicalized)
1363
- * @returns 43-char base64url string (32-byte SHA-256 digest)
1364
- */
1365
- declare function computeContentHash(content: unknown): string;
1366
- /**
1367
- * Zod schema for receipt_hash field.
1368
- * base64url(SHA-256(JCS(receipt))) — always 43 chars.
1557
+ * Assert that a stage's previous_receipt_hash matches the expected prior receipt_hash.
1558
+ * @throws Error if hashes don't match
1369
1559
  */
1370
- declare const ReceiptHashSchema: z.ZodString;
1560
+ declare function assertValidChainLink(expectedPreviousHash: string | null, actualPreviousHash: string | null, stageType: ChainStageType): void;
1371
1561
  /**
1372
- * Golden receipt fixture for hash conformance testing.
1373
- *
1374
- * This is a deterministic SignedReceiptV0 with fixed field values.
1375
- * The receipt_hash computed over this fixture is FROZEN.
1376
- *
1377
- * If your computeReceiptHash() produces a different result for this input,
1378
- * your implementation is non-conformant. DO NOT CHANGE these values.
1562
+ * Assert that a stage's chain_root_content_hash matches the CR's content_hash.
1563
+ * @throws Error if root hash doesn't match
1379
1564
  */
1380
- declare const RECEIPT_HASH_GOLDEN_FIXTURE: {
1381
- readonly receipt: {
1382
- '@type': "https://hlos.ai/schema/SignedReceiptV0";
1383
- version: 0;
1384
- receipt_id: string;
1385
- content: {
1386
- type: "CrossingSettled";
1387
- crossingId: string;
1388
- settlement_authority: string;
1389
- };
1390
- content_hash: string;
1391
- signature: string;
1392
- key_id: string;
1393
- issued_at: string;
1394
- };
1395
- /**
1396
- * Expected JCS canonical form of the receipt.
1397
- * Keys are lexicographically sorted at all levels.
1398
- */
1399
- readonly expectedJcs: "{\"@type\":\"https://hlos.ai/schema/SignedReceiptV0\",\"content\":{\"crossingId\":\"cross_test123abc456def789ghi\",\"settlement_authority\":\"hlos.ai\",\"type\":\"CrossingSettled\"},\"content_hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"issued_at\":\"2026-01-27T00:00:00.000Z\",\"key_id\":\"hlos-v2-1\",\"receipt_id\":\"rcpt_01HZGOLDENTEST000000000000\",\"signature\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"version\":0}";
1400
- /**
1401
- * Expected receipt_hash (FROZEN).
1402
- * Compute: JCS canonicalize receipt → SHA-256 → base64url (no padding)
1403
- *
1404
- * DO NOT CHANGE unless the receipt fixture above changes.
1405
- */
1406
- readonly expectedReceiptHash: "uLiQVUeVKcE35Rdje2fArZQfTcECDgwK6UbmQB_36Pg";
1407
- };
1565
+ declare function assertRootHash(actualRootHash: string, expectedRootHash: string, stageType: ChainStageType): void;
1408
1566
 
1409
1567
  /**
1410
1568
  * @hlos-ai/schemas - Finality Schemas
@@ -1582,18 +1740,18 @@ declare const NotaryRequestSchema: z.ZodObject<{
1582
1740
  validity_window_seconds: z.ZodOptional<z.ZodNumber>;
1583
1741
  }, "strip", z.ZodTypeAny, {
1584
1742
  settlement_authority: "hlos.ai";
1743
+ crossing_id: string;
1585
1744
  receipt_hash: string;
1586
1745
  receipt_type: string;
1587
1746
  receipt_version: number;
1588
- crossing_id: string;
1589
1747
  timestamp: string;
1590
1748
  validity_window_seconds?: number | undefined;
1591
1749
  }, {
1592
1750
  settlement_authority: "hlos.ai";
1751
+ crossing_id: string;
1593
1752
  receipt_hash: string;
1594
1753
  receipt_type: string;
1595
1754
  receipt_version: number;
1596
- crossing_id: string;
1597
1755
  timestamp: string;
1598
1756
  validity_window_seconds?: number | undefined;
1599
1757
  }>;
@@ -1827,4 +1985,2124 @@ declare const FINALITY_GOLDEN_FIXTURES: {
1827
1985
  };
1828
1986
  };
1829
1987
 
1830
- export { type AgentListItem, AgentListItemSchema, type AgentPassportStubResponse, AgentPassportStubResponseSchema, type AgentStatus, AgentStatusSchema, type AgentType, AgentTypeSchema, type AgentsListResponse, AgentsListResponseSchema, type ApiResponse, type ArtifactRef, ArtifactRefSchema, type AvailabilityType, AvailabilityTypeSchema, BASE64URL_SHA256_REGEX, Base64urlEd25519SigSchema, Base64urlSha256Schema, CONTENT_HASH_LENGTH, type CredentialSource, CredentialSourceSchema, type CrossingHashInputV0, CrossingHashInputV0Schema, CrossingIdFormatSchema, type CrossingSettledReceipt, CrossingSettledReceiptSchema, type CrossingSnapshotV0, CrossingSnapshotV0Schema, ERROR_CODE_STATUS, type ErrorResponse, ErrorResponseSchema, FINALITY_GOLDEN_FIXTURES, FinalityLevel, type FundingSource, FundingSourceSchema, GOLDEN_FIXTURES, type KernelError, type KernelErrorCode, KernelErrorCodeSchema, KernelErrorSchema, type KernelOk, KernelOkSchema, type LogInclusionProof, LogInclusionProofSchema, NA_ID_PREFIX, type NotarizeResponse, NotarizeResponseSchema, type NotarizeStatus, NotarizeStatusSchema, type NotaryAttestation, NotaryAttestationIdFormatSchema, NotaryAttestationSchema, type NotaryRequest, NotaryRequestSchema, PassportIdFormatSchema, type ProviderRole, ProviderRoleSchema, RECEIPT_HASH_GOLDEN_FIXTURE, RECEIPT_TYPE_URI, RECEIPT_VERSION, type RPID, RPIDSchema, ReceiptHashSchema, ReceiptId, ReceiptIdFormatSchema, type RelyingPartyId, RelyingPartyIdSchema, type RotationEpoch, RotationEpochSchema, SETTLEMENT_AUTHORITY, SIGNATURE_LENGTH, SURFACES, type SignedReceiptV0, SignedReceiptV0LooseSchema, SignedReceiptV0Schema, type Stack, type StackConnection, StackConnectionSchema, type StackProvider, StackProviderSchema, StackSchema, type SuccessResponse, SuccessResponseSchema, type Surface, SurfaceSchema, type TransactionContext, type TransactionContextHash, TransactionContextHashSchema, TransactionContextSchema, W_GOLDEN_FIXTURES, W_RPID_DOMAIN, W_TXCTX_DOMAIN, WalletIdFormatSchema, base64urlToBytes, bytesToBase64url, computeContentHash, computeReceiptHash, deriveFundingSource, encodeEpoch, error, isCrossingHashInputV0, isCrossingSettledReceipt, isNotaryAttestation, isNotaryRequest, isSignedReceiptV0, jcsCanonicalize, kernelError, kernelOk, success, validateTimeWindow };
1988
+ /**
1989
+ * @hlos-ai/schemas - Evaluation Artifact (EPIC 10)
1990
+ *
1991
+ * Canonical schema for evaluation trial results. Used by:
1992
+ * - Kernel invariant graders (CR ∧ LAT ∧ EGP bound by SA)
1993
+ * - Settlement reliability framework (pass^k)
1994
+ * - CI production gates
1995
+ *
1996
+ * @packageDocumentation
1997
+ */
1998
+
1999
+ declare const EvalTranscriptStepSchema: z.ZodObject<{
2000
+ step_index: z.ZodNumber;
2001
+ stage: z.ZodUnion<[z.ZodEnum<["CR", "LAT", "EGP", "SA"]>, z.ZodLiteral<"HTTP">]>;
2002
+ input_hash: z.ZodString;
2003
+ output_hash: z.ZodNullable<z.ZodString>;
2004
+ verdict: z.ZodEnum<["pass", "fail", "skip"]>;
2005
+ error: z.ZodNullable<z.ZodString>;
2006
+ elapsed_ms: z.ZodNumber;
2007
+ }, "strict", z.ZodTypeAny, {
2008
+ error: string | null;
2009
+ step_index: number;
2010
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2011
+ input_hash: string;
2012
+ output_hash: string | null;
2013
+ verdict: "pass" | "fail" | "skip";
2014
+ elapsed_ms: number;
2015
+ }, {
2016
+ error: string | null;
2017
+ step_index: number;
2018
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2019
+ input_hash: string;
2020
+ output_hash: string | null;
2021
+ verdict: "pass" | "fail" | "skip";
2022
+ elapsed_ms: number;
2023
+ }>;
2024
+ type EvalTranscriptStep = z.infer<typeof EvalTranscriptStepSchema>;
2025
+ /**
2026
+ * Result from a single grader.
2027
+ */
2028
+ declare const EvalGraderResultSchema: z.ZodObject<{
2029
+ grader_id: z.ZodString;
2030
+ verdict: z.ZodEnum<["pass", "fail"]>;
2031
+ confidence: z.ZodNumber;
2032
+ details: z.ZodNullable<z.ZodString>;
2033
+ }, "strict", z.ZodTypeAny, {
2034
+ details: string | null;
2035
+ verdict: "pass" | "fail";
2036
+ grader_id: string;
2037
+ confidence: number;
2038
+ }, {
2039
+ details: string | null;
2040
+ verdict: "pass" | "fail";
2041
+ grader_id: string;
2042
+ confidence: number;
2043
+ }>;
2044
+ type EvalGraderResult = z.infer<typeof EvalGraderResultSchema>;
2045
+ /**
2046
+ * Compact failure record for debugging without log scraping.
2047
+ */
2048
+ declare const EvalFailureSchema: z.ZodObject<{
2049
+ step_index: z.ZodNumber;
2050
+ grader_id: z.ZodString;
2051
+ code: z.ZodString;
2052
+ message: z.ZodNullable<z.ZodString>;
2053
+ }, "strict", z.ZodTypeAny, {
2054
+ code: string;
2055
+ message: string | null;
2056
+ step_index: number;
2057
+ grader_id: string;
2058
+ }, {
2059
+ code: string;
2060
+ message: string | null;
2061
+ step_index: number;
2062
+ grader_id: string;
2063
+ }>;
2064
+ type EvalFailure = z.infer<typeof EvalFailureSchema>;
2065
+ /**
2066
+ * Unified evaluation artifact — the canonical record for a trial run.
2067
+ *
2068
+ * Metrics:
2069
+ * - pass_rate: successes / total_runs (empirical)
2070
+ * - consecutive_pass_rate: longest consecutive pass streak / total_runs
2071
+ * (observed max streak ratio, NOT "probability of k consecutive")
2072
+ */
2073
+ declare const EvalArtifactSchema: z.ZodObject<{
2074
+ schema_version: z.ZodLiteral<1>;
2075
+ trial_id: z.ZodString;
2076
+ seed: z.ZodNullable<z.ZodString>;
2077
+ suite: z.ZodString;
2078
+ environment: z.ZodEnum<["local", "ci", "staging", "production"]>;
2079
+ started_at: z.ZodString;
2080
+ completed_at: z.ZodNullable<z.ZodString>;
2081
+ duration_ms: z.ZodNullable<z.ZodNumber>;
2082
+ transcript: z.ZodArray<z.ZodObject<{
2083
+ step_index: z.ZodNumber;
2084
+ stage: z.ZodUnion<[z.ZodEnum<["CR", "LAT", "EGP", "SA"]>, z.ZodLiteral<"HTTP">]>;
2085
+ input_hash: z.ZodString;
2086
+ output_hash: z.ZodNullable<z.ZodString>;
2087
+ verdict: z.ZodEnum<["pass", "fail", "skip"]>;
2088
+ error: z.ZodNullable<z.ZodString>;
2089
+ elapsed_ms: z.ZodNumber;
2090
+ }, "strict", z.ZodTypeAny, {
2091
+ error: string | null;
2092
+ step_index: number;
2093
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2094
+ input_hash: string;
2095
+ output_hash: string | null;
2096
+ verdict: "pass" | "fail" | "skip";
2097
+ elapsed_ms: number;
2098
+ }, {
2099
+ error: string | null;
2100
+ step_index: number;
2101
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2102
+ input_hash: string;
2103
+ output_hash: string | null;
2104
+ verdict: "pass" | "fail" | "skip";
2105
+ elapsed_ms: number;
2106
+ }>, "many">;
2107
+ grader_results: z.ZodArray<z.ZodObject<{
2108
+ grader_id: z.ZodString;
2109
+ verdict: z.ZodEnum<["pass", "fail"]>;
2110
+ confidence: z.ZodNumber;
2111
+ details: z.ZodNullable<z.ZodString>;
2112
+ }, "strict", z.ZodTypeAny, {
2113
+ details: string | null;
2114
+ verdict: "pass" | "fail";
2115
+ grader_id: string;
2116
+ confidence: number;
2117
+ }, {
2118
+ details: string | null;
2119
+ verdict: "pass" | "fail";
2120
+ grader_id: string;
2121
+ confidence: number;
2122
+ }>, "many">;
2123
+ failures: z.ZodArray<z.ZodObject<{
2124
+ step_index: z.ZodNumber;
2125
+ grader_id: z.ZodString;
2126
+ code: z.ZodString;
2127
+ message: z.ZodNullable<z.ZodString>;
2128
+ }, "strict", z.ZodTypeAny, {
2129
+ code: string;
2130
+ message: string | null;
2131
+ step_index: number;
2132
+ grader_id: string;
2133
+ }, {
2134
+ code: string;
2135
+ message: string | null;
2136
+ step_index: number;
2137
+ grader_id: string;
2138
+ }>, "many">;
2139
+ pass_rate: z.ZodNumber;
2140
+ consecutive_pass_rate: z.ZodNumber;
2141
+ k: z.ZodNumber;
2142
+ }, "strict", z.ZodTypeAny, {
2143
+ schema_version: 1;
2144
+ trial_id: string;
2145
+ seed: string | null;
2146
+ suite: string;
2147
+ environment: "local" | "ci" | "staging" | "production";
2148
+ started_at: string;
2149
+ completed_at: string | null;
2150
+ duration_ms: number | null;
2151
+ transcript: {
2152
+ error: string | null;
2153
+ step_index: number;
2154
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2155
+ input_hash: string;
2156
+ output_hash: string | null;
2157
+ verdict: "pass" | "fail" | "skip";
2158
+ elapsed_ms: number;
2159
+ }[];
2160
+ grader_results: {
2161
+ details: string | null;
2162
+ verdict: "pass" | "fail";
2163
+ grader_id: string;
2164
+ confidence: number;
2165
+ }[];
2166
+ failures: {
2167
+ code: string;
2168
+ message: string | null;
2169
+ step_index: number;
2170
+ grader_id: string;
2171
+ }[];
2172
+ pass_rate: number;
2173
+ consecutive_pass_rate: number;
2174
+ k: number;
2175
+ }, {
2176
+ schema_version: 1;
2177
+ trial_id: string;
2178
+ seed: string | null;
2179
+ suite: string;
2180
+ environment: "local" | "ci" | "staging" | "production";
2181
+ started_at: string;
2182
+ completed_at: string | null;
2183
+ duration_ms: number | null;
2184
+ transcript: {
2185
+ error: string | null;
2186
+ step_index: number;
2187
+ stage: "CR" | "LAT" | "EGP" | "SA" | "HTTP";
2188
+ input_hash: string;
2189
+ output_hash: string | null;
2190
+ verdict: "pass" | "fail" | "skip";
2191
+ elapsed_ms: number;
2192
+ }[];
2193
+ grader_results: {
2194
+ details: string | null;
2195
+ verdict: "pass" | "fail";
2196
+ grader_id: string;
2197
+ confidence: number;
2198
+ }[];
2199
+ failures: {
2200
+ code: string;
2201
+ message: string | null;
2202
+ step_index: number;
2203
+ grader_id: string;
2204
+ }[];
2205
+ pass_rate: number;
2206
+ consecutive_pass_rate: number;
2207
+ k: number;
2208
+ }>;
2209
+ type EvalArtifact = z.infer<typeof EvalArtifactSchema>;
2210
+ /**
2211
+ * Golden fixtures for conformance testing.
2212
+ * DO NOT MODIFY unless schema_version changes.
2213
+ */
2214
+ declare const EVAL_GOLDEN_FIXTURES: {
2215
+ /**
2216
+ * Valid 4-step transcript (CR→LAT→EGP→SA, all pass).
2217
+ */
2218
+ readonly valid_full_pass: {
2219
+ schema_version: 1;
2220
+ trial_id: string;
2221
+ seed: string;
2222
+ suite: string;
2223
+ environment: "ci";
2224
+ started_at: string;
2225
+ completed_at: string;
2226
+ duration_ms: number;
2227
+ transcript: ({
2228
+ step_index: number;
2229
+ stage: "CR";
2230
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2231
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2232
+ verdict: "pass";
2233
+ error: null;
2234
+ elapsed_ms: number;
2235
+ } | {
2236
+ step_index: number;
2237
+ stage: "LAT";
2238
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2239
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2240
+ verdict: "pass";
2241
+ error: null;
2242
+ elapsed_ms: number;
2243
+ } | {
2244
+ step_index: number;
2245
+ stage: "EGP";
2246
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2247
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2248
+ verdict: "pass";
2249
+ error: null;
2250
+ elapsed_ms: number;
2251
+ } | {
2252
+ step_index: number;
2253
+ stage: "SA";
2254
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2255
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2256
+ verdict: "pass";
2257
+ error: null;
2258
+ elapsed_ms: number;
2259
+ })[];
2260
+ grader_results: {
2261
+ grader_id: string;
2262
+ verdict: "pass";
2263
+ confidence: number;
2264
+ details: null;
2265
+ }[];
2266
+ failures: never[];
2267
+ pass_rate: number;
2268
+ consecutive_pass_rate: number;
2269
+ k: number;
2270
+ };
2271
+ /**
2272
+ * Single failure: LAT grader fails (broken CR→LAT binding).
2273
+ */
2274
+ readonly lat_failure: {
2275
+ schema_version: 1;
2276
+ trial_id: string;
2277
+ seed: string;
2278
+ suite: string;
2279
+ environment: "ci";
2280
+ started_at: string;
2281
+ completed_at: string;
2282
+ duration_ms: number;
2283
+ transcript: ({
2284
+ step_index: number;
2285
+ stage: "CR";
2286
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2287
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2288
+ verdict: "pass";
2289
+ error: null;
2290
+ elapsed_ms: number;
2291
+ } | {
2292
+ step_index: number;
2293
+ stage: "LAT";
2294
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2295
+ output_hash: null;
2296
+ verdict: "fail";
2297
+ error: string;
2298
+ elapsed_ms: number;
2299
+ } | {
2300
+ step_index: number;
2301
+ stage: "EGP";
2302
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2303
+ output_hash: null;
2304
+ verdict: "skip";
2305
+ error: null;
2306
+ elapsed_ms: number;
2307
+ } | {
2308
+ step_index: number;
2309
+ stage: "SA";
2310
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2311
+ output_hash: null;
2312
+ verdict: "skip";
2313
+ error: null;
2314
+ elapsed_ms: number;
2315
+ })[];
2316
+ grader_results: ({
2317
+ grader_id: string;
2318
+ verdict: "pass";
2319
+ confidence: number;
2320
+ details: null;
2321
+ } | {
2322
+ grader_id: string;
2323
+ verdict: "fail";
2324
+ confidence: number;
2325
+ details: string;
2326
+ } | {
2327
+ grader_id: string;
2328
+ verdict: "pass";
2329
+ confidence: number;
2330
+ details: string;
2331
+ })[];
2332
+ failures: {
2333
+ step_index: number;
2334
+ grader_id: string;
2335
+ code: string;
2336
+ message: string;
2337
+ }[];
2338
+ pass_rate: number;
2339
+ consecutive_pass_rate: number;
2340
+ k: number;
2341
+ };
2342
+ /**
2343
+ * Partial artifact: run crashed mid-flight.
2344
+ */
2345
+ readonly partial_crash: {
2346
+ schema_version: 1;
2347
+ trial_id: string;
2348
+ seed: null;
2349
+ suite: string;
2350
+ environment: "local";
2351
+ started_at: string;
2352
+ completed_at: null;
2353
+ duration_ms: null;
2354
+ transcript: {
2355
+ step_index: number;
2356
+ stage: "CR";
2357
+ input_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2358
+ output_hash: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
2359
+ verdict: "pass";
2360
+ error: null;
2361
+ elapsed_ms: number;
2362
+ }[];
2363
+ grader_results: {
2364
+ grader_id: string;
2365
+ verdict: "pass";
2366
+ confidence: number;
2367
+ details: null;
2368
+ }[];
2369
+ failures: never[];
2370
+ pass_rate: number;
2371
+ consecutive_pass_rate: number;
2372
+ k: number;
2373
+ };
2374
+ };
2375
+
2376
+ /**
2377
+ * @hlos-ai/schemas - Settlement Execute Contract (EPIC 10 / K2 Bridge)
2378
+ *
2379
+ * Zod schemas for POST /api/v2/settlement/execute.
2380
+ *
2381
+ * Design invariants:
2382
+ * - Response returns the four kernel artifacts (cr, lat, egp, sa) in their
2383
+ * existing shapes, so gradeKernelInvariant() works with zero branching.
2384
+ * - Hashes are always explicit and version-tagged (no silent V1/V2 drift).
2385
+ * - All public IDs are externally stable (ULID/UUID), never internal DB row IDs.
2386
+ * - Failure responses include partial artifacts and timing for EvalArtifact
2387
+ * creation (nullable completed_at / duration_ms support).
2388
+ *
2389
+ * @packageDocumentation
2390
+ */
2391
+
2392
+ declare const SettlementExecuteRequestSchema: z.ZodObject<{
2393
+ idempotency_key: z.ZodString;
2394
+ seed: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2395
+ hash_version: z.ZodDefault<z.ZodEnum<["v1", "v2"]>>;
2396
+ mode: z.ZodDefault<z.ZodEnum<["execute", "dry_run"]>>;
2397
+ flow: z.ZodObject<{
2398
+ wallet_id: z.ZodString;
2399
+ sku: z.ZodString;
2400
+ amount: z.ZodString;
2401
+ currency: z.ZodLiteral<"USD">;
2402
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2403
+ }, "strip", z.ZodTypeAny, {
2404
+ amount: string;
2405
+ currency: "USD";
2406
+ wallet_id: string;
2407
+ sku: string;
2408
+ metadata?: Record<string, unknown> | undefined;
2409
+ }, {
2410
+ amount: string;
2411
+ currency: "USD";
2412
+ wallet_id: string;
2413
+ sku: string;
2414
+ metadata?: Record<string, unknown> | undefined;
2415
+ }>;
2416
+ }, "strict", z.ZodTypeAny, {
2417
+ idempotency_key: string;
2418
+ hash_version: "v1" | "v2";
2419
+ mode: "execute" | "dry_run";
2420
+ flow: {
2421
+ amount: string;
2422
+ currency: "USD";
2423
+ wallet_id: string;
2424
+ sku: string;
2425
+ metadata?: Record<string, unknown> | undefined;
2426
+ };
2427
+ seed?: string | null | undefined;
2428
+ }, {
2429
+ idempotency_key: string;
2430
+ flow: {
2431
+ amount: string;
2432
+ currency: "USD";
2433
+ wallet_id: string;
2434
+ sku: string;
2435
+ metadata?: Record<string, unknown> | undefined;
2436
+ };
2437
+ seed?: string | null | undefined;
2438
+ hash_version?: "v1" | "v2" | undefined;
2439
+ mode?: "execute" | "dry_run" | undefined;
2440
+ }>;
2441
+ type SettlementExecuteRequest = z.infer<typeof SettlementExecuteRequestSchema>;
2442
+ declare const SettlementExecuteSuccessSchema: z.ZodObject<{
2443
+ schema_version: z.ZodLiteral<1>;
2444
+ flow_id: z.ZodString;
2445
+ suite_id: z.ZodString;
2446
+ seed: z.ZodNullable<z.ZodString>;
2447
+ hash_version: z.ZodEnum<["v1", "v2"]>;
2448
+ artifacts: z.ZodObject<{} & {
2449
+ cr: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2450
+ lat: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2451
+ egp: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2452
+ sa: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2453
+ }, "strip", z.ZodTypeAny, {
2454
+ cr: Record<string, unknown>;
2455
+ lat: Record<string, unknown>;
2456
+ egp: Record<string, unknown>;
2457
+ sa: Record<string, unknown>;
2458
+ }, {
2459
+ cr: Record<string, unknown>;
2460
+ lat: Record<string, unknown>;
2461
+ egp: Record<string, unknown>;
2462
+ sa: Record<string, unknown>;
2463
+ }>;
2464
+ hashes: z.ZodObject<{} & {
2465
+ cr_hash: z.ZodString;
2466
+ lat_hash: z.ZodString;
2467
+ egp_hash: z.ZodString;
2468
+ sa_hash: z.ZodString;
2469
+ }, "strip", z.ZodTypeAny, {
2470
+ cr_hash: string;
2471
+ lat_hash: string;
2472
+ egp_hash: string;
2473
+ sa_hash: string;
2474
+ }, {
2475
+ cr_hash: string;
2476
+ lat_hash: string;
2477
+ egp_hash: string;
2478
+ sa_hash: string;
2479
+ }>;
2480
+ signatures: z.ZodObject<{
2481
+ settlement: z.ZodObject<{
2482
+ cr_sig: z.ZodObject<{
2483
+ alg: z.ZodLiteral<"ed25519">;
2484
+ sig: z.ZodString;
2485
+ pub: z.ZodString;
2486
+ }, "strip", z.ZodTypeAny, {
2487
+ alg: "ed25519";
2488
+ sig: string;
2489
+ pub: string;
2490
+ }, {
2491
+ alg: "ed25519";
2492
+ sig: string;
2493
+ pub: string;
2494
+ }>;
2495
+ lat_sig: z.ZodObject<{
2496
+ alg: z.ZodLiteral<"ed25519">;
2497
+ sig: z.ZodString;
2498
+ pub: z.ZodString;
2499
+ }, "strip", z.ZodTypeAny, {
2500
+ alg: "ed25519";
2501
+ sig: string;
2502
+ pub: string;
2503
+ }, {
2504
+ alg: "ed25519";
2505
+ sig: string;
2506
+ pub: string;
2507
+ }>;
2508
+ sa_sig: z.ZodObject<{
2509
+ alg: z.ZodLiteral<"ed25519">;
2510
+ sig: z.ZodString;
2511
+ pub: z.ZodString;
2512
+ }, "strip", z.ZodTypeAny, {
2513
+ alg: "ed25519";
2514
+ sig: string;
2515
+ pub: string;
2516
+ }, {
2517
+ alg: "ed25519";
2518
+ sig: string;
2519
+ pub: string;
2520
+ }>;
2521
+ }, "strip", z.ZodTypeAny, {
2522
+ cr_sig: {
2523
+ alg: "ed25519";
2524
+ sig: string;
2525
+ pub: string;
2526
+ };
2527
+ lat_sig: {
2528
+ alg: "ed25519";
2529
+ sig: string;
2530
+ pub: string;
2531
+ };
2532
+ sa_sig: {
2533
+ alg: "ed25519";
2534
+ sig: string;
2535
+ pub: string;
2536
+ };
2537
+ }, {
2538
+ cr_sig: {
2539
+ alg: "ed25519";
2540
+ sig: string;
2541
+ pub: string;
2542
+ };
2543
+ lat_sig: {
2544
+ alg: "ed25519";
2545
+ sig: string;
2546
+ pub: string;
2547
+ };
2548
+ sa_sig: {
2549
+ alg: "ed25519";
2550
+ sig: string;
2551
+ pub: string;
2552
+ };
2553
+ }>;
2554
+ notary: z.ZodObject<{
2555
+ status: z.ZodEnum<["skipped", "verified", "failed"]>;
2556
+ run_notary: z.ZodNullable<z.ZodObject<{
2557
+ subject_hash: z.ZodString;
2558
+ sig: z.ZodString;
2559
+ pub: z.ZodString;
2560
+ }, "strip", z.ZodTypeAny, {
2561
+ sig: string;
2562
+ pub: string;
2563
+ subject_hash: string;
2564
+ }, {
2565
+ sig: string;
2566
+ pub: string;
2567
+ subject_hash: string;
2568
+ }>>;
2569
+ graph_notary: z.ZodNullable<z.ZodObject<{
2570
+ subject_hash: z.ZodString;
2571
+ sig: z.ZodString;
2572
+ pub: z.ZodString;
2573
+ }, "strip", z.ZodTypeAny, {
2574
+ sig: string;
2575
+ pub: string;
2576
+ subject_hash: string;
2577
+ }, {
2578
+ sig: string;
2579
+ pub: string;
2580
+ subject_hash: string;
2581
+ }>>;
2582
+ }, "strip", z.ZodTypeAny, {
2583
+ status: "skipped" | "verified" | "failed";
2584
+ run_notary: {
2585
+ sig: string;
2586
+ pub: string;
2587
+ subject_hash: string;
2588
+ } | null;
2589
+ graph_notary: {
2590
+ sig: string;
2591
+ pub: string;
2592
+ subject_hash: string;
2593
+ } | null;
2594
+ }, {
2595
+ status: "skipped" | "verified" | "failed";
2596
+ run_notary: {
2597
+ sig: string;
2598
+ pub: string;
2599
+ subject_hash: string;
2600
+ } | null;
2601
+ graph_notary: {
2602
+ sig: string;
2603
+ pub: string;
2604
+ subject_hash: string;
2605
+ } | null;
2606
+ }>;
2607
+ }, "strip", z.ZodTypeAny, {
2608
+ notary: {
2609
+ status: "skipped" | "verified" | "failed";
2610
+ run_notary: {
2611
+ sig: string;
2612
+ pub: string;
2613
+ subject_hash: string;
2614
+ } | null;
2615
+ graph_notary: {
2616
+ sig: string;
2617
+ pub: string;
2618
+ subject_hash: string;
2619
+ } | null;
2620
+ };
2621
+ settlement: {
2622
+ cr_sig: {
2623
+ alg: "ed25519";
2624
+ sig: string;
2625
+ pub: string;
2626
+ };
2627
+ lat_sig: {
2628
+ alg: "ed25519";
2629
+ sig: string;
2630
+ pub: string;
2631
+ };
2632
+ sa_sig: {
2633
+ alg: "ed25519";
2634
+ sig: string;
2635
+ pub: string;
2636
+ };
2637
+ };
2638
+ }, {
2639
+ notary: {
2640
+ status: "skipped" | "verified" | "failed";
2641
+ run_notary: {
2642
+ sig: string;
2643
+ pub: string;
2644
+ subject_hash: string;
2645
+ } | null;
2646
+ graph_notary: {
2647
+ sig: string;
2648
+ pub: string;
2649
+ subject_hash: string;
2650
+ } | null;
2651
+ };
2652
+ settlement: {
2653
+ cr_sig: {
2654
+ alg: "ed25519";
2655
+ sig: string;
2656
+ pub: string;
2657
+ };
2658
+ lat_sig: {
2659
+ alg: "ed25519";
2660
+ sig: string;
2661
+ pub: string;
2662
+ };
2663
+ sa_sig: {
2664
+ alg: "ed25519";
2665
+ sig: string;
2666
+ pub: string;
2667
+ };
2668
+ };
2669
+ }>;
2670
+ receipt: z.ZodObject<{
2671
+ receipt_id: z.ZodString;
2672
+ status: z.ZodEnum<["stored", "pending"]>;
2673
+ receipt_hash: z.ZodString;
2674
+ }, "strip", z.ZodTypeAny, {
2675
+ status: "stored" | "pending";
2676
+ receipt_id: string;
2677
+ receipt_hash: string;
2678
+ }, {
2679
+ status: "stored" | "pending";
2680
+ receipt_id: string;
2681
+ receipt_hash: string;
2682
+ }>;
2683
+ run: z.ZodObject<{
2684
+ run_id: z.ZodString;
2685
+ final_state_hash: z.ZodString;
2686
+ terminal_event_hash: z.ZodString;
2687
+ sealed_at: z.ZodString;
2688
+ }, "strip", z.ZodTypeAny, {
2689
+ run_id: string;
2690
+ final_state_hash: string;
2691
+ terminal_event_hash: string;
2692
+ sealed_at: string;
2693
+ }, {
2694
+ run_id: string;
2695
+ final_state_hash: string;
2696
+ terminal_event_hash: string;
2697
+ sealed_at: string;
2698
+ }>;
2699
+ timing: z.ZodObject<{
2700
+ started_at: z.ZodString;
2701
+ } & {
2702
+ completed_at: z.ZodString;
2703
+ duration_ms: z.ZodNumber;
2704
+ }, "strip", z.ZodTypeAny, {
2705
+ started_at: string;
2706
+ completed_at: string;
2707
+ duration_ms: number;
2708
+ }, {
2709
+ started_at: string;
2710
+ completed_at: string;
2711
+ duration_ms: number;
2712
+ }>;
2713
+ }, "strip", z.ZodTypeAny, {
2714
+ schema_version: 1;
2715
+ seed: string | null;
2716
+ hash_version: "v1" | "v2";
2717
+ flow_id: string;
2718
+ suite_id: string;
2719
+ artifacts: {
2720
+ cr: Record<string, unknown>;
2721
+ lat: Record<string, unknown>;
2722
+ egp: Record<string, unknown>;
2723
+ sa: Record<string, unknown>;
2724
+ };
2725
+ hashes: {
2726
+ cr_hash: string;
2727
+ lat_hash: string;
2728
+ egp_hash: string;
2729
+ sa_hash: string;
2730
+ };
2731
+ signatures: {
2732
+ notary: {
2733
+ status: "skipped" | "verified" | "failed";
2734
+ run_notary: {
2735
+ sig: string;
2736
+ pub: string;
2737
+ subject_hash: string;
2738
+ } | null;
2739
+ graph_notary: {
2740
+ sig: string;
2741
+ pub: string;
2742
+ subject_hash: string;
2743
+ } | null;
2744
+ };
2745
+ settlement: {
2746
+ cr_sig: {
2747
+ alg: "ed25519";
2748
+ sig: string;
2749
+ pub: string;
2750
+ };
2751
+ lat_sig: {
2752
+ alg: "ed25519";
2753
+ sig: string;
2754
+ pub: string;
2755
+ };
2756
+ sa_sig: {
2757
+ alg: "ed25519";
2758
+ sig: string;
2759
+ pub: string;
2760
+ };
2761
+ };
2762
+ };
2763
+ receipt: {
2764
+ status: "stored" | "pending";
2765
+ receipt_id: string;
2766
+ receipt_hash: string;
2767
+ };
2768
+ run: {
2769
+ run_id: string;
2770
+ final_state_hash: string;
2771
+ terminal_event_hash: string;
2772
+ sealed_at: string;
2773
+ };
2774
+ timing: {
2775
+ started_at: string;
2776
+ completed_at: string;
2777
+ duration_ms: number;
2778
+ };
2779
+ }, {
2780
+ schema_version: 1;
2781
+ seed: string | null;
2782
+ hash_version: "v1" | "v2";
2783
+ flow_id: string;
2784
+ suite_id: string;
2785
+ artifacts: {
2786
+ cr: Record<string, unknown>;
2787
+ lat: Record<string, unknown>;
2788
+ egp: Record<string, unknown>;
2789
+ sa: Record<string, unknown>;
2790
+ };
2791
+ hashes: {
2792
+ cr_hash: string;
2793
+ lat_hash: string;
2794
+ egp_hash: string;
2795
+ sa_hash: string;
2796
+ };
2797
+ signatures: {
2798
+ notary: {
2799
+ status: "skipped" | "verified" | "failed";
2800
+ run_notary: {
2801
+ sig: string;
2802
+ pub: string;
2803
+ subject_hash: string;
2804
+ } | null;
2805
+ graph_notary: {
2806
+ sig: string;
2807
+ pub: string;
2808
+ subject_hash: string;
2809
+ } | null;
2810
+ };
2811
+ settlement: {
2812
+ cr_sig: {
2813
+ alg: "ed25519";
2814
+ sig: string;
2815
+ pub: string;
2816
+ };
2817
+ lat_sig: {
2818
+ alg: "ed25519";
2819
+ sig: string;
2820
+ pub: string;
2821
+ };
2822
+ sa_sig: {
2823
+ alg: "ed25519";
2824
+ sig: string;
2825
+ pub: string;
2826
+ };
2827
+ };
2828
+ };
2829
+ receipt: {
2830
+ status: "stored" | "pending";
2831
+ receipt_id: string;
2832
+ receipt_hash: string;
2833
+ };
2834
+ run: {
2835
+ run_id: string;
2836
+ final_state_hash: string;
2837
+ terminal_event_hash: string;
2838
+ sealed_at: string;
2839
+ };
2840
+ timing: {
2841
+ started_at: string;
2842
+ completed_at: string;
2843
+ duration_ms: number;
2844
+ };
2845
+ }>;
2846
+ type SettlementExecuteSuccess = z.infer<typeof SettlementExecuteSuccessSchema>;
2847
+ declare const SettlementExecuteErrorSchema: z.ZodObject<{
2848
+ schema_version: z.ZodLiteral<1>;
2849
+ flow_id: z.ZodString;
2850
+ suite_id: z.ZodString;
2851
+ seed: z.ZodNullable<z.ZodString>;
2852
+ hash_version: z.ZodEnum<["v1", "v2"]>;
2853
+ error: z.ZodObject<{
2854
+ code: z.ZodEnum<["INSUFFICIENT_FUNDS", "POLICY_DENIED", "INVARIANT_FAILED", "INVALID_AMOUNT_FORMAT", "INVALID_AMOUNT_NEGATIVE", "INVALID_JSON", "INTERNAL"]>;
2855
+ message: z.ZodString;
2856
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2857
+ }, "strip", z.ZodTypeAny, {
2858
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
2859
+ message: string;
2860
+ details?: Record<string, unknown> | undefined;
2861
+ }, {
2862
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
2863
+ message: string;
2864
+ details?: Record<string, unknown> | undefined;
2865
+ }>;
2866
+ partial: z.ZodObject<{
2867
+ artifacts: z.ZodObject<{
2868
+ cr: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2869
+ lat: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2870
+ egp: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2871
+ sa: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2872
+ }, "strip", z.ZodTypeAny, {
2873
+ cr: Record<string, unknown> | null;
2874
+ lat: Record<string, unknown> | null;
2875
+ egp: Record<string, unknown> | null;
2876
+ sa: Record<string, unknown> | null;
2877
+ }, {
2878
+ cr: Record<string, unknown> | null;
2879
+ lat: Record<string, unknown> | null;
2880
+ egp: Record<string, unknown> | null;
2881
+ sa: Record<string, unknown> | null;
2882
+ }>;
2883
+ hashes: z.ZodObject<{
2884
+ cr_hash: z.ZodNullable<z.ZodString>;
2885
+ lat_hash: z.ZodNullable<z.ZodString>;
2886
+ egp_hash: z.ZodNullable<z.ZodString>;
2887
+ sa_hash: z.ZodNullable<z.ZodString>;
2888
+ }, "strip", z.ZodTypeAny, {
2889
+ cr_hash: string | null;
2890
+ lat_hash: string | null;
2891
+ egp_hash: string | null;
2892
+ sa_hash: string | null;
2893
+ }, {
2894
+ cr_hash: string | null;
2895
+ lat_hash: string | null;
2896
+ egp_hash: string | null;
2897
+ sa_hash: string | null;
2898
+ }>;
2899
+ }, "strip", z.ZodTypeAny, {
2900
+ artifacts: {
2901
+ cr: Record<string, unknown> | null;
2902
+ lat: Record<string, unknown> | null;
2903
+ egp: Record<string, unknown> | null;
2904
+ sa: Record<string, unknown> | null;
2905
+ };
2906
+ hashes: {
2907
+ cr_hash: string | null;
2908
+ lat_hash: string | null;
2909
+ egp_hash: string | null;
2910
+ sa_hash: string | null;
2911
+ };
2912
+ }, {
2913
+ artifacts: {
2914
+ cr: Record<string, unknown> | null;
2915
+ lat: Record<string, unknown> | null;
2916
+ egp: Record<string, unknown> | null;
2917
+ sa: Record<string, unknown> | null;
2918
+ };
2919
+ hashes: {
2920
+ cr_hash: string | null;
2921
+ lat_hash: string | null;
2922
+ egp_hash: string | null;
2923
+ sa_hash: string | null;
2924
+ };
2925
+ }>;
2926
+ timing: z.ZodObject<{
2927
+ started_at: z.ZodString;
2928
+ completed_at: z.ZodNullable<z.ZodString>;
2929
+ duration_ms: z.ZodNullable<z.ZodNumber>;
2930
+ }, "strip", z.ZodTypeAny, {
2931
+ started_at: string;
2932
+ completed_at: string | null;
2933
+ duration_ms: number | null;
2934
+ }, {
2935
+ started_at: string;
2936
+ completed_at: string | null;
2937
+ duration_ms: number | null;
2938
+ }>;
2939
+ }, "strip", z.ZodTypeAny, {
2940
+ error: {
2941
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
2942
+ message: string;
2943
+ details?: Record<string, unknown> | undefined;
2944
+ };
2945
+ schema_version: 1;
2946
+ seed: string | null;
2947
+ hash_version: "v1" | "v2";
2948
+ flow_id: string;
2949
+ suite_id: string;
2950
+ timing: {
2951
+ started_at: string;
2952
+ completed_at: string | null;
2953
+ duration_ms: number | null;
2954
+ };
2955
+ partial: {
2956
+ artifacts: {
2957
+ cr: Record<string, unknown> | null;
2958
+ lat: Record<string, unknown> | null;
2959
+ egp: Record<string, unknown> | null;
2960
+ sa: Record<string, unknown> | null;
2961
+ };
2962
+ hashes: {
2963
+ cr_hash: string | null;
2964
+ lat_hash: string | null;
2965
+ egp_hash: string | null;
2966
+ sa_hash: string | null;
2967
+ };
2968
+ };
2969
+ }, {
2970
+ error: {
2971
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
2972
+ message: string;
2973
+ details?: Record<string, unknown> | undefined;
2974
+ };
2975
+ schema_version: 1;
2976
+ seed: string | null;
2977
+ hash_version: "v1" | "v2";
2978
+ flow_id: string;
2979
+ suite_id: string;
2980
+ timing: {
2981
+ started_at: string;
2982
+ completed_at: string | null;
2983
+ duration_ms: number | null;
2984
+ };
2985
+ partial: {
2986
+ artifacts: {
2987
+ cr: Record<string, unknown> | null;
2988
+ lat: Record<string, unknown> | null;
2989
+ egp: Record<string, unknown> | null;
2990
+ sa: Record<string, unknown> | null;
2991
+ };
2992
+ hashes: {
2993
+ cr_hash: string | null;
2994
+ lat_hash: string | null;
2995
+ egp_hash: string | null;
2996
+ sa_hash: string | null;
2997
+ };
2998
+ };
2999
+ }>;
3000
+ type SettlementExecuteError = z.infer<typeof SettlementExecuteErrorSchema>;
3001
+ /**
3002
+ * Parse a settlement execute response.
3003
+ * Success has `artifacts` at top level; error has `error` + `partial`.
3004
+ *
3005
+ * Usage in E2E gate:
3006
+ * const parsed = SettlementExecuteResponseSchema.safeParse(responseBody);
3007
+ * if (!parsed.success) throw new Error('Contract drift detected');
3008
+ * if ('error' in parsed.data) {
3009
+ * // handle failure — still produces EvalArtifact via partial
3010
+ * } else {
3011
+ * gradeKernelInvariant(parsed.data.artifacts);
3012
+ * }
3013
+ */
3014
+ declare const SettlementExecuteResponseSchema: z.ZodUnion<[z.ZodObject<{
3015
+ schema_version: z.ZodLiteral<1>;
3016
+ flow_id: z.ZodString;
3017
+ suite_id: z.ZodString;
3018
+ seed: z.ZodNullable<z.ZodString>;
3019
+ hash_version: z.ZodEnum<["v1", "v2"]>;
3020
+ artifacts: z.ZodObject<{} & {
3021
+ cr: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3022
+ lat: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3023
+ egp: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3024
+ sa: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3025
+ }, "strip", z.ZodTypeAny, {
3026
+ cr: Record<string, unknown>;
3027
+ lat: Record<string, unknown>;
3028
+ egp: Record<string, unknown>;
3029
+ sa: Record<string, unknown>;
3030
+ }, {
3031
+ cr: Record<string, unknown>;
3032
+ lat: Record<string, unknown>;
3033
+ egp: Record<string, unknown>;
3034
+ sa: Record<string, unknown>;
3035
+ }>;
3036
+ hashes: z.ZodObject<{} & {
3037
+ cr_hash: z.ZodString;
3038
+ lat_hash: z.ZodString;
3039
+ egp_hash: z.ZodString;
3040
+ sa_hash: z.ZodString;
3041
+ }, "strip", z.ZodTypeAny, {
3042
+ cr_hash: string;
3043
+ lat_hash: string;
3044
+ egp_hash: string;
3045
+ sa_hash: string;
3046
+ }, {
3047
+ cr_hash: string;
3048
+ lat_hash: string;
3049
+ egp_hash: string;
3050
+ sa_hash: string;
3051
+ }>;
3052
+ signatures: z.ZodObject<{
3053
+ settlement: z.ZodObject<{
3054
+ cr_sig: z.ZodObject<{
3055
+ alg: z.ZodLiteral<"ed25519">;
3056
+ sig: z.ZodString;
3057
+ pub: z.ZodString;
3058
+ }, "strip", z.ZodTypeAny, {
3059
+ alg: "ed25519";
3060
+ sig: string;
3061
+ pub: string;
3062
+ }, {
3063
+ alg: "ed25519";
3064
+ sig: string;
3065
+ pub: string;
3066
+ }>;
3067
+ lat_sig: z.ZodObject<{
3068
+ alg: z.ZodLiteral<"ed25519">;
3069
+ sig: z.ZodString;
3070
+ pub: z.ZodString;
3071
+ }, "strip", z.ZodTypeAny, {
3072
+ alg: "ed25519";
3073
+ sig: string;
3074
+ pub: string;
3075
+ }, {
3076
+ alg: "ed25519";
3077
+ sig: string;
3078
+ pub: string;
3079
+ }>;
3080
+ sa_sig: z.ZodObject<{
3081
+ alg: z.ZodLiteral<"ed25519">;
3082
+ sig: z.ZodString;
3083
+ pub: z.ZodString;
3084
+ }, "strip", z.ZodTypeAny, {
3085
+ alg: "ed25519";
3086
+ sig: string;
3087
+ pub: string;
3088
+ }, {
3089
+ alg: "ed25519";
3090
+ sig: string;
3091
+ pub: string;
3092
+ }>;
3093
+ }, "strip", z.ZodTypeAny, {
3094
+ cr_sig: {
3095
+ alg: "ed25519";
3096
+ sig: string;
3097
+ pub: string;
3098
+ };
3099
+ lat_sig: {
3100
+ alg: "ed25519";
3101
+ sig: string;
3102
+ pub: string;
3103
+ };
3104
+ sa_sig: {
3105
+ alg: "ed25519";
3106
+ sig: string;
3107
+ pub: string;
3108
+ };
3109
+ }, {
3110
+ cr_sig: {
3111
+ alg: "ed25519";
3112
+ sig: string;
3113
+ pub: string;
3114
+ };
3115
+ lat_sig: {
3116
+ alg: "ed25519";
3117
+ sig: string;
3118
+ pub: string;
3119
+ };
3120
+ sa_sig: {
3121
+ alg: "ed25519";
3122
+ sig: string;
3123
+ pub: string;
3124
+ };
3125
+ }>;
3126
+ notary: z.ZodObject<{
3127
+ status: z.ZodEnum<["skipped", "verified", "failed"]>;
3128
+ run_notary: z.ZodNullable<z.ZodObject<{
3129
+ subject_hash: z.ZodString;
3130
+ sig: z.ZodString;
3131
+ pub: z.ZodString;
3132
+ }, "strip", z.ZodTypeAny, {
3133
+ sig: string;
3134
+ pub: string;
3135
+ subject_hash: string;
3136
+ }, {
3137
+ sig: string;
3138
+ pub: string;
3139
+ subject_hash: string;
3140
+ }>>;
3141
+ graph_notary: z.ZodNullable<z.ZodObject<{
3142
+ subject_hash: z.ZodString;
3143
+ sig: z.ZodString;
3144
+ pub: z.ZodString;
3145
+ }, "strip", z.ZodTypeAny, {
3146
+ sig: string;
3147
+ pub: string;
3148
+ subject_hash: string;
3149
+ }, {
3150
+ sig: string;
3151
+ pub: string;
3152
+ subject_hash: string;
3153
+ }>>;
3154
+ }, "strip", z.ZodTypeAny, {
3155
+ status: "skipped" | "verified" | "failed";
3156
+ run_notary: {
3157
+ sig: string;
3158
+ pub: string;
3159
+ subject_hash: string;
3160
+ } | null;
3161
+ graph_notary: {
3162
+ sig: string;
3163
+ pub: string;
3164
+ subject_hash: string;
3165
+ } | null;
3166
+ }, {
3167
+ status: "skipped" | "verified" | "failed";
3168
+ run_notary: {
3169
+ sig: string;
3170
+ pub: string;
3171
+ subject_hash: string;
3172
+ } | null;
3173
+ graph_notary: {
3174
+ sig: string;
3175
+ pub: string;
3176
+ subject_hash: string;
3177
+ } | null;
3178
+ }>;
3179
+ }, "strip", z.ZodTypeAny, {
3180
+ notary: {
3181
+ status: "skipped" | "verified" | "failed";
3182
+ run_notary: {
3183
+ sig: string;
3184
+ pub: string;
3185
+ subject_hash: string;
3186
+ } | null;
3187
+ graph_notary: {
3188
+ sig: string;
3189
+ pub: string;
3190
+ subject_hash: string;
3191
+ } | null;
3192
+ };
3193
+ settlement: {
3194
+ cr_sig: {
3195
+ alg: "ed25519";
3196
+ sig: string;
3197
+ pub: string;
3198
+ };
3199
+ lat_sig: {
3200
+ alg: "ed25519";
3201
+ sig: string;
3202
+ pub: string;
3203
+ };
3204
+ sa_sig: {
3205
+ alg: "ed25519";
3206
+ sig: string;
3207
+ pub: string;
3208
+ };
3209
+ };
3210
+ }, {
3211
+ notary: {
3212
+ status: "skipped" | "verified" | "failed";
3213
+ run_notary: {
3214
+ sig: string;
3215
+ pub: string;
3216
+ subject_hash: string;
3217
+ } | null;
3218
+ graph_notary: {
3219
+ sig: string;
3220
+ pub: string;
3221
+ subject_hash: string;
3222
+ } | null;
3223
+ };
3224
+ settlement: {
3225
+ cr_sig: {
3226
+ alg: "ed25519";
3227
+ sig: string;
3228
+ pub: string;
3229
+ };
3230
+ lat_sig: {
3231
+ alg: "ed25519";
3232
+ sig: string;
3233
+ pub: string;
3234
+ };
3235
+ sa_sig: {
3236
+ alg: "ed25519";
3237
+ sig: string;
3238
+ pub: string;
3239
+ };
3240
+ };
3241
+ }>;
3242
+ receipt: z.ZodObject<{
3243
+ receipt_id: z.ZodString;
3244
+ status: z.ZodEnum<["stored", "pending"]>;
3245
+ receipt_hash: z.ZodString;
3246
+ }, "strip", z.ZodTypeAny, {
3247
+ status: "stored" | "pending";
3248
+ receipt_id: string;
3249
+ receipt_hash: string;
3250
+ }, {
3251
+ status: "stored" | "pending";
3252
+ receipt_id: string;
3253
+ receipt_hash: string;
3254
+ }>;
3255
+ run: z.ZodObject<{
3256
+ run_id: z.ZodString;
3257
+ final_state_hash: z.ZodString;
3258
+ terminal_event_hash: z.ZodString;
3259
+ sealed_at: z.ZodString;
3260
+ }, "strip", z.ZodTypeAny, {
3261
+ run_id: string;
3262
+ final_state_hash: string;
3263
+ terminal_event_hash: string;
3264
+ sealed_at: string;
3265
+ }, {
3266
+ run_id: string;
3267
+ final_state_hash: string;
3268
+ terminal_event_hash: string;
3269
+ sealed_at: string;
3270
+ }>;
3271
+ timing: z.ZodObject<{
3272
+ started_at: z.ZodString;
3273
+ } & {
3274
+ completed_at: z.ZodString;
3275
+ duration_ms: z.ZodNumber;
3276
+ }, "strip", z.ZodTypeAny, {
3277
+ started_at: string;
3278
+ completed_at: string;
3279
+ duration_ms: number;
3280
+ }, {
3281
+ started_at: string;
3282
+ completed_at: string;
3283
+ duration_ms: number;
3284
+ }>;
3285
+ }, "strip", z.ZodTypeAny, {
3286
+ schema_version: 1;
3287
+ seed: string | null;
3288
+ hash_version: "v1" | "v2";
3289
+ flow_id: string;
3290
+ suite_id: string;
3291
+ artifacts: {
3292
+ cr: Record<string, unknown>;
3293
+ lat: Record<string, unknown>;
3294
+ egp: Record<string, unknown>;
3295
+ sa: Record<string, unknown>;
3296
+ };
3297
+ hashes: {
3298
+ cr_hash: string;
3299
+ lat_hash: string;
3300
+ egp_hash: string;
3301
+ sa_hash: string;
3302
+ };
3303
+ signatures: {
3304
+ notary: {
3305
+ status: "skipped" | "verified" | "failed";
3306
+ run_notary: {
3307
+ sig: string;
3308
+ pub: string;
3309
+ subject_hash: string;
3310
+ } | null;
3311
+ graph_notary: {
3312
+ sig: string;
3313
+ pub: string;
3314
+ subject_hash: string;
3315
+ } | null;
3316
+ };
3317
+ settlement: {
3318
+ cr_sig: {
3319
+ alg: "ed25519";
3320
+ sig: string;
3321
+ pub: string;
3322
+ };
3323
+ lat_sig: {
3324
+ alg: "ed25519";
3325
+ sig: string;
3326
+ pub: string;
3327
+ };
3328
+ sa_sig: {
3329
+ alg: "ed25519";
3330
+ sig: string;
3331
+ pub: string;
3332
+ };
3333
+ };
3334
+ };
3335
+ receipt: {
3336
+ status: "stored" | "pending";
3337
+ receipt_id: string;
3338
+ receipt_hash: string;
3339
+ };
3340
+ run: {
3341
+ run_id: string;
3342
+ final_state_hash: string;
3343
+ terminal_event_hash: string;
3344
+ sealed_at: string;
3345
+ };
3346
+ timing: {
3347
+ started_at: string;
3348
+ completed_at: string;
3349
+ duration_ms: number;
3350
+ };
3351
+ }, {
3352
+ schema_version: 1;
3353
+ seed: string | null;
3354
+ hash_version: "v1" | "v2";
3355
+ flow_id: string;
3356
+ suite_id: string;
3357
+ artifacts: {
3358
+ cr: Record<string, unknown>;
3359
+ lat: Record<string, unknown>;
3360
+ egp: Record<string, unknown>;
3361
+ sa: Record<string, unknown>;
3362
+ };
3363
+ hashes: {
3364
+ cr_hash: string;
3365
+ lat_hash: string;
3366
+ egp_hash: string;
3367
+ sa_hash: string;
3368
+ };
3369
+ signatures: {
3370
+ notary: {
3371
+ status: "skipped" | "verified" | "failed";
3372
+ run_notary: {
3373
+ sig: string;
3374
+ pub: string;
3375
+ subject_hash: string;
3376
+ } | null;
3377
+ graph_notary: {
3378
+ sig: string;
3379
+ pub: string;
3380
+ subject_hash: string;
3381
+ } | null;
3382
+ };
3383
+ settlement: {
3384
+ cr_sig: {
3385
+ alg: "ed25519";
3386
+ sig: string;
3387
+ pub: string;
3388
+ };
3389
+ lat_sig: {
3390
+ alg: "ed25519";
3391
+ sig: string;
3392
+ pub: string;
3393
+ };
3394
+ sa_sig: {
3395
+ alg: "ed25519";
3396
+ sig: string;
3397
+ pub: string;
3398
+ };
3399
+ };
3400
+ };
3401
+ receipt: {
3402
+ status: "stored" | "pending";
3403
+ receipt_id: string;
3404
+ receipt_hash: string;
3405
+ };
3406
+ run: {
3407
+ run_id: string;
3408
+ final_state_hash: string;
3409
+ terminal_event_hash: string;
3410
+ sealed_at: string;
3411
+ };
3412
+ timing: {
3413
+ started_at: string;
3414
+ completed_at: string;
3415
+ duration_ms: number;
3416
+ };
3417
+ }>, z.ZodObject<{
3418
+ schema_version: z.ZodLiteral<1>;
3419
+ flow_id: z.ZodString;
3420
+ suite_id: z.ZodString;
3421
+ seed: z.ZodNullable<z.ZodString>;
3422
+ hash_version: z.ZodEnum<["v1", "v2"]>;
3423
+ error: z.ZodObject<{
3424
+ code: z.ZodEnum<["INSUFFICIENT_FUNDS", "POLICY_DENIED", "INVARIANT_FAILED", "INVALID_AMOUNT_FORMAT", "INVALID_AMOUNT_NEGATIVE", "INVALID_JSON", "INTERNAL"]>;
3425
+ message: z.ZodString;
3426
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3427
+ }, "strip", z.ZodTypeAny, {
3428
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
3429
+ message: string;
3430
+ details?: Record<string, unknown> | undefined;
3431
+ }, {
3432
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
3433
+ message: string;
3434
+ details?: Record<string, unknown> | undefined;
3435
+ }>;
3436
+ partial: z.ZodObject<{
3437
+ artifacts: z.ZodObject<{
3438
+ cr: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3439
+ lat: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3440
+ egp: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3441
+ sa: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3442
+ }, "strip", z.ZodTypeAny, {
3443
+ cr: Record<string, unknown> | null;
3444
+ lat: Record<string, unknown> | null;
3445
+ egp: Record<string, unknown> | null;
3446
+ sa: Record<string, unknown> | null;
3447
+ }, {
3448
+ cr: Record<string, unknown> | null;
3449
+ lat: Record<string, unknown> | null;
3450
+ egp: Record<string, unknown> | null;
3451
+ sa: Record<string, unknown> | null;
3452
+ }>;
3453
+ hashes: z.ZodObject<{
3454
+ cr_hash: z.ZodNullable<z.ZodString>;
3455
+ lat_hash: z.ZodNullable<z.ZodString>;
3456
+ egp_hash: z.ZodNullable<z.ZodString>;
3457
+ sa_hash: z.ZodNullable<z.ZodString>;
3458
+ }, "strip", z.ZodTypeAny, {
3459
+ cr_hash: string | null;
3460
+ lat_hash: string | null;
3461
+ egp_hash: string | null;
3462
+ sa_hash: string | null;
3463
+ }, {
3464
+ cr_hash: string | null;
3465
+ lat_hash: string | null;
3466
+ egp_hash: string | null;
3467
+ sa_hash: string | null;
3468
+ }>;
3469
+ }, "strip", z.ZodTypeAny, {
3470
+ artifacts: {
3471
+ cr: Record<string, unknown> | null;
3472
+ lat: Record<string, unknown> | null;
3473
+ egp: Record<string, unknown> | null;
3474
+ sa: Record<string, unknown> | null;
3475
+ };
3476
+ hashes: {
3477
+ cr_hash: string | null;
3478
+ lat_hash: string | null;
3479
+ egp_hash: string | null;
3480
+ sa_hash: string | null;
3481
+ };
3482
+ }, {
3483
+ artifacts: {
3484
+ cr: Record<string, unknown> | null;
3485
+ lat: Record<string, unknown> | null;
3486
+ egp: Record<string, unknown> | null;
3487
+ sa: Record<string, unknown> | null;
3488
+ };
3489
+ hashes: {
3490
+ cr_hash: string | null;
3491
+ lat_hash: string | null;
3492
+ egp_hash: string | null;
3493
+ sa_hash: string | null;
3494
+ };
3495
+ }>;
3496
+ timing: z.ZodObject<{
3497
+ started_at: z.ZodString;
3498
+ completed_at: z.ZodNullable<z.ZodString>;
3499
+ duration_ms: z.ZodNullable<z.ZodNumber>;
3500
+ }, "strip", z.ZodTypeAny, {
3501
+ started_at: string;
3502
+ completed_at: string | null;
3503
+ duration_ms: number | null;
3504
+ }, {
3505
+ started_at: string;
3506
+ completed_at: string | null;
3507
+ duration_ms: number | null;
3508
+ }>;
3509
+ }, "strip", z.ZodTypeAny, {
3510
+ error: {
3511
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
3512
+ message: string;
3513
+ details?: Record<string, unknown> | undefined;
3514
+ };
3515
+ schema_version: 1;
3516
+ seed: string | null;
3517
+ hash_version: "v1" | "v2";
3518
+ flow_id: string;
3519
+ suite_id: string;
3520
+ timing: {
3521
+ started_at: string;
3522
+ completed_at: string | null;
3523
+ duration_ms: number | null;
3524
+ };
3525
+ partial: {
3526
+ artifacts: {
3527
+ cr: Record<string, unknown> | null;
3528
+ lat: Record<string, unknown> | null;
3529
+ egp: Record<string, unknown> | null;
3530
+ sa: Record<string, unknown> | null;
3531
+ };
3532
+ hashes: {
3533
+ cr_hash: string | null;
3534
+ lat_hash: string | null;
3535
+ egp_hash: string | null;
3536
+ sa_hash: string | null;
3537
+ };
3538
+ };
3539
+ }, {
3540
+ error: {
3541
+ code: "INSUFFICIENT_FUNDS" | "POLICY_DENIED" | "INVARIANT_FAILED" | "INVALID_AMOUNT_FORMAT" | "INVALID_AMOUNT_NEGATIVE" | "INVALID_JSON" | "INTERNAL";
3542
+ message: string;
3543
+ details?: Record<string, unknown> | undefined;
3544
+ };
3545
+ schema_version: 1;
3546
+ seed: string | null;
3547
+ hash_version: "v1" | "v2";
3548
+ flow_id: string;
3549
+ suite_id: string;
3550
+ timing: {
3551
+ started_at: string;
3552
+ completed_at: string | null;
3553
+ duration_ms: number | null;
3554
+ };
3555
+ partial: {
3556
+ artifacts: {
3557
+ cr: Record<string, unknown> | null;
3558
+ lat: Record<string, unknown> | null;
3559
+ egp: Record<string, unknown> | null;
3560
+ sa: Record<string, unknown> | null;
3561
+ };
3562
+ hashes: {
3563
+ cr_hash: string | null;
3564
+ lat_hash: string | null;
3565
+ egp_hash: string | null;
3566
+ sa_hash: string | null;
3567
+ };
3568
+ };
3569
+ }>]>;
3570
+ type SettlementExecuteResponse = z.infer<typeof SettlementExecuteResponseSchema>;
3571
+ declare function isSettlementExecuteSuccess(response: SettlementExecuteResponse): response is SettlementExecuteSuccess;
3572
+ declare function isSettlementExecuteError(response: SettlementExecuteResponse): response is SettlementExecuteError;
3573
+
3574
+ /**
3575
+ * @hlos-ai/schemas - SignedRejectionReceiptV0
3576
+ *
3577
+ * Canonical SRR artifact for terminal negative finality.
3578
+ * Fresh U-family substrate contract — NOT a continuation of K-08.
3579
+ *
3580
+ * Lineage: K-08 uses @type '.../SignedRejectionReceipt', version 1, ksrr_ IDs.
3581
+ * This contract uses V0, version 0, srr_ IDs. Informed by K-08 field matrix
3582
+ * and signing semantics but is its own artifact.
3583
+ *
3584
+ * FROZEN: Breaking changes require version bump.
3585
+ */
3586
+
3587
+ declare const SRR_TYPE_URI: "https://hlos.ai/schema/SignedRejectionReceiptV0";
3588
+ declare const SRR_VERSION: 0;
3589
+ declare const SRR_REJECTION_DOMAIN: "kernel:k:rejection:v1";
3590
+ declare const SRR_SIGNATURE_ALGORITHM: "Ed25519";
3591
+ declare const SRR_INITIAL_REASON_CODES: readonly ["BUDGET_EXCEEDED", "POLICY_VIOLATION", "SAFETY_GATE_FAILED", "DELEGATION_REVOKED", "SETTLEMENT_TIMEOUT"];
3592
+ /**
3593
+ * Reason code format: uppercase letters, digits, underscores. 3–64 chars.
3594
+ * Producers should prefer a registered code when one exists.
3595
+ * Consumers must tolerate unknown codes.
3596
+ */
3597
+ declare const REASON_CODE_PATTERN: RegExp;
3598
+ declare const SignedRejectionReceiptV0Schema: z.ZodObject<{
3599
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedRejectionReceiptV0">;
3600
+ version: z.ZodLiteral<0>;
3601
+ receipt_id: z.ZodString;
3602
+ crossing_id: z.ZodString;
3603
+ reason_code: z.ZodString;
3604
+ reason_message: z.ZodString;
3605
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3606
+ commitment_hash: z.ZodOptional<z.ZodString>;
3607
+ issuer_id: z.ZodString;
3608
+ rejected_at: z.ZodString;
3609
+ issuer_public_key_ref: z.ZodString;
3610
+ signature_algorithm: z.ZodLiteral<"Ed25519">;
3611
+ signature: z.ZodString;
3612
+ }, "strict", z.ZodTypeAny, {
3613
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV0";
3614
+ version: 0;
3615
+ signature: string;
3616
+ receipt_id: string;
3617
+ crossing_id: string;
3618
+ reason_code: string;
3619
+ reason_message: string;
3620
+ issuer_id: string;
3621
+ rejected_at: string;
3622
+ issuer_public_key_ref: string;
3623
+ signature_algorithm: "Ed25519";
3624
+ details?: Record<string, unknown> | undefined;
3625
+ commitment_hash?: string | undefined;
3626
+ }, {
3627
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV0";
3628
+ version: 0;
3629
+ signature: string;
3630
+ receipt_id: string;
3631
+ crossing_id: string;
3632
+ reason_code: string;
3633
+ reason_message: string;
3634
+ issuer_id: string;
3635
+ rejected_at: string;
3636
+ issuer_public_key_ref: string;
3637
+ signature_algorithm: "Ed25519";
3638
+ details?: Record<string, unknown> | undefined;
3639
+ commitment_hash?: string | undefined;
3640
+ }>;
3641
+ type SignedRejectionReceiptV0 = z.infer<typeof SignedRejectionReceiptV0Schema>;
3642
+ /**
3643
+ * All signed fields — everything except `signature`.
3644
+ * Used as input to computeSrrSigningPayload.
3645
+ */
3646
+ type UnsignedSrrV0 = Omit<SignedRejectionReceiptV0, 'signature'>;
3647
+
3648
+ declare const LIABILITY_WAIVER_TERMS_TYPE_URI: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3649
+ declare const LIABILITY_WAIVER_TERMS_VERSION: 0;
3650
+ declare const LiabilityDispositionSchema: z.ZodEnum<["ABSORB", "RELEASE", "TRANSFER", "DISPUTE"]>;
3651
+ type LiabilityDisposition = z.infer<typeof LiabilityDispositionSchema>;
3652
+ declare const LiabilityWaiverTermsPartiesSchema: z.ZodObject<{
3653
+ offered_by: z.ZodOptional<z.ZodString>;
3654
+ offered_to: z.ZodOptional<z.ZodString>;
3655
+ beneficiary: z.ZodOptional<z.ZodString>;
3656
+ burdened_party: z.ZodOptional<z.ZodString>;
3657
+ }, "strict", z.ZodTypeAny, {
3658
+ offered_by?: string | undefined;
3659
+ offered_to?: string | undefined;
3660
+ beneficiary?: string | undefined;
3661
+ burdened_party?: string | undefined;
3662
+ }, {
3663
+ offered_by?: string | undefined;
3664
+ offered_to?: string | undefined;
3665
+ beneficiary?: string | undefined;
3666
+ burdened_party?: string | undefined;
3667
+ }>;
3668
+ declare const LiabilityWaiverTermsScopeSchema: z.ZodObject<{
3669
+ crossing_id: z.ZodOptional<z.ZodString>;
3670
+ commitment_hash: z.ZodOptional<z.ZodString>;
3671
+ claim_scope: z.ZodOptional<z.ZodString>;
3672
+ }, "strict", z.ZodTypeAny, {
3673
+ crossing_id?: string | undefined;
3674
+ commitment_hash?: string | undefined;
3675
+ claim_scope?: string | undefined;
3676
+ }, {
3677
+ crossing_id?: string | undefined;
3678
+ commitment_hash?: string | undefined;
3679
+ claim_scope?: string | undefined;
3680
+ }>;
3681
+ declare const LiabilityWaiverTermsConditionsSchema: z.ZodObject<{
3682
+ effective_if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3683
+ expires_at: z.ZodOptional<z.ZodString>;
3684
+ jurisdiction: z.ZodOptional<z.ZodString>;
3685
+ }, "strict", z.ZodTypeAny, {
3686
+ expires_at?: string | undefined;
3687
+ effective_if?: Record<string, unknown> | undefined;
3688
+ jurisdiction?: string | undefined;
3689
+ }, {
3690
+ expires_at?: string | undefined;
3691
+ effective_if?: Record<string, unknown> | undefined;
3692
+ jurisdiction?: string | undefined;
3693
+ }>;
3694
+ declare const LiabilityWaiverTermsHashInputSchema: z.ZodObject<{
3695
+ parties: z.ZodObject<{
3696
+ offered_by: z.ZodOptional<z.ZodString>;
3697
+ offered_to: z.ZodOptional<z.ZodString>;
3698
+ beneficiary: z.ZodOptional<z.ZodString>;
3699
+ burdened_party: z.ZodOptional<z.ZodString>;
3700
+ }, "strict", z.ZodTypeAny, {
3701
+ offered_by?: string | undefined;
3702
+ offered_to?: string | undefined;
3703
+ beneficiary?: string | undefined;
3704
+ burdened_party?: string | undefined;
3705
+ }, {
3706
+ offered_by?: string | undefined;
3707
+ offered_to?: string | undefined;
3708
+ beneficiary?: string | undefined;
3709
+ burdened_party?: string | undefined;
3710
+ }>;
3711
+ liability_effect: z.ZodEnum<["ABSORB", "RELEASE", "TRANSFER", "DISPUTE"]>;
3712
+ scope: z.ZodObject<{
3713
+ crossing_id: z.ZodOptional<z.ZodString>;
3714
+ commitment_hash: z.ZodOptional<z.ZodString>;
3715
+ claim_scope: z.ZodOptional<z.ZodString>;
3716
+ }, "strict", z.ZodTypeAny, {
3717
+ crossing_id?: string | undefined;
3718
+ commitment_hash?: string | undefined;
3719
+ claim_scope?: string | undefined;
3720
+ }, {
3721
+ crossing_id?: string | undefined;
3722
+ commitment_hash?: string | undefined;
3723
+ claim_scope?: string | undefined;
3724
+ }>;
3725
+ conditions: z.ZodOptional<z.ZodObject<{
3726
+ effective_if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3727
+ expires_at: z.ZodOptional<z.ZodString>;
3728
+ jurisdiction: z.ZodOptional<z.ZodString>;
3729
+ }, "strict", z.ZodTypeAny, {
3730
+ expires_at?: string | undefined;
3731
+ effective_if?: Record<string, unknown> | undefined;
3732
+ jurisdiction?: string | undefined;
3733
+ }, {
3734
+ expires_at?: string | undefined;
3735
+ effective_if?: Record<string, unknown> | undefined;
3736
+ jurisdiction?: string | undefined;
3737
+ }>>;
3738
+ canonical_terms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3739
+ }, "strict", z.ZodTypeAny, {
3740
+ parties: {
3741
+ offered_by?: string | undefined;
3742
+ offered_to?: string | undefined;
3743
+ beneficiary?: string | undefined;
3744
+ burdened_party?: string | undefined;
3745
+ };
3746
+ liability_effect: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3747
+ scope: {
3748
+ crossing_id?: string | undefined;
3749
+ commitment_hash?: string | undefined;
3750
+ claim_scope?: string | undefined;
3751
+ };
3752
+ conditions?: {
3753
+ expires_at?: string | undefined;
3754
+ effective_if?: Record<string, unknown> | undefined;
3755
+ jurisdiction?: string | undefined;
3756
+ } | undefined;
3757
+ canonical_terms?: Record<string, unknown> | undefined;
3758
+ }, {
3759
+ parties: {
3760
+ offered_by?: string | undefined;
3761
+ offered_to?: string | undefined;
3762
+ beneficiary?: string | undefined;
3763
+ burdened_party?: string | undefined;
3764
+ };
3765
+ liability_effect: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3766
+ scope: {
3767
+ crossing_id?: string | undefined;
3768
+ commitment_hash?: string | undefined;
3769
+ claim_scope?: string | undefined;
3770
+ };
3771
+ conditions?: {
3772
+ expires_at?: string | undefined;
3773
+ effective_if?: Record<string, unknown> | undefined;
3774
+ jurisdiction?: string | undefined;
3775
+ } | undefined;
3776
+ canonical_terms?: Record<string, unknown> | undefined;
3777
+ }>;
3778
+ type LiabilityWaiverTermsHashInput = z.infer<typeof LiabilityWaiverTermsHashInputSchema>;
3779
+ declare const LiabilityWaiverTermsRefV0Schema: z.ZodObject<{
3780
+ waiver_id: z.ZodOptional<z.ZodString>;
3781
+ terms_hash: z.ZodString;
3782
+ type: z.ZodLiteral<"https://hlos.ai/schema/LiabilityWaiverTermsV0">;
3783
+ version: z.ZodLiteral<0>;
3784
+ }, "strict", z.ZodTypeAny, {
3785
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3786
+ version: 0;
3787
+ terms_hash: string;
3788
+ waiver_id?: string | undefined;
3789
+ }, {
3790
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3791
+ version: 0;
3792
+ terms_hash: string;
3793
+ waiver_id?: string | undefined;
3794
+ }>;
3795
+ declare const LiabilityWaiverTermsV0Schema: z.ZodObject<{
3796
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/LiabilityWaiverTermsV0">;
3797
+ version: z.ZodLiteral<0>;
3798
+ waiver_id: z.ZodString;
3799
+ terms_hash: z.ZodString;
3800
+ parties: z.ZodObject<{
3801
+ offered_by: z.ZodOptional<z.ZodString>;
3802
+ offered_to: z.ZodOptional<z.ZodString>;
3803
+ beneficiary: z.ZodOptional<z.ZodString>;
3804
+ burdened_party: z.ZodOptional<z.ZodString>;
3805
+ }, "strict", z.ZodTypeAny, {
3806
+ offered_by?: string | undefined;
3807
+ offered_to?: string | undefined;
3808
+ beneficiary?: string | undefined;
3809
+ burdened_party?: string | undefined;
3810
+ }, {
3811
+ offered_by?: string | undefined;
3812
+ offered_to?: string | undefined;
3813
+ beneficiary?: string | undefined;
3814
+ burdened_party?: string | undefined;
3815
+ }>;
3816
+ liability_effect: z.ZodEnum<["ABSORB", "RELEASE", "TRANSFER", "DISPUTE"]>;
3817
+ scope: z.ZodObject<{
3818
+ crossing_id: z.ZodOptional<z.ZodString>;
3819
+ commitment_hash: z.ZodOptional<z.ZodString>;
3820
+ claim_scope: z.ZodOptional<z.ZodString>;
3821
+ }, "strict", z.ZodTypeAny, {
3822
+ crossing_id?: string | undefined;
3823
+ commitment_hash?: string | undefined;
3824
+ claim_scope?: string | undefined;
3825
+ }, {
3826
+ crossing_id?: string | undefined;
3827
+ commitment_hash?: string | undefined;
3828
+ claim_scope?: string | undefined;
3829
+ }>;
3830
+ conditions: z.ZodOptional<z.ZodObject<{
3831
+ effective_if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3832
+ expires_at: z.ZodOptional<z.ZodString>;
3833
+ jurisdiction: z.ZodOptional<z.ZodString>;
3834
+ }, "strict", z.ZodTypeAny, {
3835
+ expires_at?: string | undefined;
3836
+ effective_if?: Record<string, unknown> | undefined;
3837
+ jurisdiction?: string | undefined;
3838
+ }, {
3839
+ expires_at?: string | undefined;
3840
+ effective_if?: Record<string, unknown> | undefined;
3841
+ jurisdiction?: string | undefined;
3842
+ }>>;
3843
+ human_readable_summary: z.ZodOptional<z.ZodString>;
3844
+ canonical_terms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3845
+ }, "strict", z.ZodTypeAny, {
3846
+ '@type': "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3847
+ version: 0;
3848
+ parties: {
3849
+ offered_by?: string | undefined;
3850
+ offered_to?: string | undefined;
3851
+ beneficiary?: string | undefined;
3852
+ burdened_party?: string | undefined;
3853
+ };
3854
+ liability_effect: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3855
+ scope: {
3856
+ crossing_id?: string | undefined;
3857
+ commitment_hash?: string | undefined;
3858
+ claim_scope?: string | undefined;
3859
+ };
3860
+ waiver_id: string;
3861
+ terms_hash: string;
3862
+ conditions?: {
3863
+ expires_at?: string | undefined;
3864
+ effective_if?: Record<string, unknown> | undefined;
3865
+ jurisdiction?: string | undefined;
3866
+ } | undefined;
3867
+ canonical_terms?: Record<string, unknown> | undefined;
3868
+ human_readable_summary?: string | undefined;
3869
+ }, {
3870
+ '@type': "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3871
+ version: 0;
3872
+ parties: {
3873
+ offered_by?: string | undefined;
3874
+ offered_to?: string | undefined;
3875
+ beneficiary?: string | undefined;
3876
+ burdened_party?: string | undefined;
3877
+ };
3878
+ liability_effect: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3879
+ scope: {
3880
+ crossing_id?: string | undefined;
3881
+ commitment_hash?: string | undefined;
3882
+ claim_scope?: string | undefined;
3883
+ };
3884
+ waiver_id: string;
3885
+ terms_hash: string;
3886
+ conditions?: {
3887
+ expires_at?: string | undefined;
3888
+ effective_if?: Record<string, unknown> | undefined;
3889
+ jurisdiction?: string | undefined;
3890
+ } | undefined;
3891
+ canonical_terms?: Record<string, unknown> | undefined;
3892
+ human_readable_summary?: string | undefined;
3893
+ }>;
3894
+ type LiabilityWaiverTermsRefV0 = z.infer<typeof LiabilityWaiverTermsRefV0Schema>;
3895
+ type LiabilityWaiverTermsV0 = z.infer<typeof LiabilityWaiverTermsV0Schema>;
3896
+ declare function toLiabilityWaiverTermsHashInput(terms: Pick<LiabilityWaiverTermsV0, 'parties' | 'liability_effect' | 'scope' | 'conditions' | 'canonical_terms'>): LiabilityWaiverTermsHashInput;
3897
+ declare function computeLiabilityWaiverTermsHash(input: LiabilityWaiverTermsHashInput): string;
3898
+
3899
+ declare const SRR_V1_TYPE_URI: "https://hlos.ai/schema/SignedRejectionReceiptV1";
3900
+ declare const SRR_V1_VERSION: 1;
3901
+ declare const SRR_V1_REJECTION_DOMAIN: "kernel:u:rejection:v1";
3902
+ declare const SRR_V1_SIGNATURE_ALGORITHM: "Ed25519";
3903
+ declare const SignedRejectionReceiptV1Schema: z.ZodEffects<z.ZodObject<{
3904
+ '@type': z.ZodLiteral<"https://hlos.ai/schema/SignedRejectionReceiptV1">;
3905
+ version: z.ZodLiteral<1>;
3906
+ receipt_id: z.ZodString;
3907
+ crossing_id: z.ZodString;
3908
+ reason_code: z.ZodString;
3909
+ reason_message: z.ZodString;
3910
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3911
+ commitment_hash: z.ZodOptional<z.ZodString>;
3912
+ issuer_id: z.ZodString;
3913
+ rejected_at: z.ZodString;
3914
+ issuer_public_key_ref: z.ZodString;
3915
+ signature_algorithm: z.ZodLiteral<"Ed25519">;
3916
+ liability_disposition: z.ZodEnum<["ABSORB", "RELEASE", "TRANSFER", "DISPUTE"]>;
3917
+ waiver_terms_ref: z.ZodOptional<z.ZodObject<{
3918
+ waiver_id: z.ZodOptional<z.ZodString>;
3919
+ terms_hash: z.ZodString;
3920
+ type: z.ZodLiteral<"https://hlos.ai/schema/LiabilityWaiverTermsV0">;
3921
+ version: z.ZodLiteral<0>;
3922
+ }, "strict", z.ZodTypeAny, {
3923
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3924
+ version: 0;
3925
+ terms_hash: string;
3926
+ waiver_id?: string | undefined;
3927
+ }, {
3928
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3929
+ version: 0;
3930
+ terms_hash: string;
3931
+ waiver_id?: string | undefined;
3932
+ }>>;
3933
+ signature: z.ZodString;
3934
+ }, "strict", z.ZodTypeAny, {
3935
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV1";
3936
+ version: 1;
3937
+ signature: string;
3938
+ receipt_id: string;
3939
+ crossing_id: string;
3940
+ reason_code: string;
3941
+ reason_message: string;
3942
+ issuer_id: string;
3943
+ rejected_at: string;
3944
+ issuer_public_key_ref: string;
3945
+ signature_algorithm: "Ed25519";
3946
+ liability_disposition: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3947
+ details?: Record<string, unknown> | undefined;
3948
+ commitment_hash?: string | undefined;
3949
+ waiver_terms_ref?: {
3950
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3951
+ version: 0;
3952
+ terms_hash: string;
3953
+ waiver_id?: string | undefined;
3954
+ } | undefined;
3955
+ }, {
3956
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV1";
3957
+ version: 1;
3958
+ signature: string;
3959
+ receipt_id: string;
3960
+ crossing_id: string;
3961
+ reason_code: string;
3962
+ reason_message: string;
3963
+ issuer_id: string;
3964
+ rejected_at: string;
3965
+ issuer_public_key_ref: string;
3966
+ signature_algorithm: "Ed25519";
3967
+ liability_disposition: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3968
+ details?: Record<string, unknown> | undefined;
3969
+ commitment_hash?: string | undefined;
3970
+ waiver_terms_ref?: {
3971
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3972
+ version: 0;
3973
+ terms_hash: string;
3974
+ waiver_id?: string | undefined;
3975
+ } | undefined;
3976
+ }>, {
3977
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV1";
3978
+ version: 1;
3979
+ signature: string;
3980
+ receipt_id: string;
3981
+ crossing_id: string;
3982
+ reason_code: string;
3983
+ reason_message: string;
3984
+ issuer_id: string;
3985
+ rejected_at: string;
3986
+ issuer_public_key_ref: string;
3987
+ signature_algorithm: "Ed25519";
3988
+ liability_disposition: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
3989
+ details?: Record<string, unknown> | undefined;
3990
+ commitment_hash?: string | undefined;
3991
+ waiver_terms_ref?: {
3992
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
3993
+ version: 0;
3994
+ terms_hash: string;
3995
+ waiver_id?: string | undefined;
3996
+ } | undefined;
3997
+ }, {
3998
+ '@type': "https://hlos.ai/schema/SignedRejectionReceiptV1";
3999
+ version: 1;
4000
+ signature: string;
4001
+ receipt_id: string;
4002
+ crossing_id: string;
4003
+ reason_code: string;
4004
+ reason_message: string;
4005
+ issuer_id: string;
4006
+ rejected_at: string;
4007
+ issuer_public_key_ref: string;
4008
+ signature_algorithm: "Ed25519";
4009
+ liability_disposition: "ABSORB" | "RELEASE" | "TRANSFER" | "DISPUTE";
4010
+ details?: Record<string, unknown> | undefined;
4011
+ commitment_hash?: string | undefined;
4012
+ waiver_terms_ref?: {
4013
+ type: "https://hlos.ai/schema/LiabilityWaiverTermsV0";
4014
+ version: 0;
4015
+ terms_hash: string;
4016
+ waiver_id?: string | undefined;
4017
+ } | undefined;
4018
+ }>;
4019
+ type SignedRejectionReceiptV1 = z.infer<typeof SignedRejectionReceiptV1Schema>;
4020
+ type UnsignedSrrV1 = Omit<SignedRejectionReceiptV1, 'signature'>;
4021
+
4022
+ /**
4023
+ * @hlos-ai/schemas - SRR Signing Payload and Digest
4024
+ *
4025
+ * Domain-separated signing payload construction for SignedRejectionReceipt (V0 and V1).
4026
+ * Canonical SRR signing construction:
4027
+ * signingPayload = UTF8(DOMAIN) || SHA-256(JCS(unsignedFields))
4028
+ *
4029
+ * Each version uses its own domain prefix for formal domain separation:
4030
+ * V0: 'kernel:k:rejection:v1'
4031
+ * V1: 'kernel:u:rejection:v1'
4032
+ *
4033
+ * This is an intentional tightening over K-08, which requires domain separation
4034
+ * and deterministic payloads but does not prescribe this exact byte recipe.
4035
+ *
4036
+ * Requires @noble/hashes as peer dependency.
4037
+ */
4038
+
4039
+ /**
4040
+ * Compute the domain-separated signing payload for an unsigned SRR.
4041
+ *
4042
+ * signingPayload = UTF8(DOMAIN) || SHA-256(JCS(unsignedFields))
4043
+ *
4044
+ * DOMAIN is version-specific (V0: 'kernel:k:rejection:v1', V1: 'kernel:u:rejection:v1').
4045
+ *
4046
+ * @param unsignedSrr - All SRR fields EXCEPT signature
4047
+ * @returns Uint8Array payload (domain bytes + 32 SHA-256)
4048
+ */
4049
+ declare function computeSrrSigningPayload(unsignedSrr: UnsignedSrrV0 | UnsignedSrrV1): Uint8Array;
4050
+ /**
4051
+ * Compute the replay/idempotency digest for a full signed SRR.
4052
+ *
4053
+ * srr_digest = base64url(SHA-256(JCS(signedSrr)))
4054
+ *
4055
+ * This is over the ENTIRE stored artifact including signature,
4056
+ * distinct from the signing payload which excludes signature.
4057
+ *
4058
+ * @param signedSrr - Complete signed SRR
4059
+ * @returns 43-char base64url string
4060
+ */
4061
+ declare function computeSrrDigest(signedSrr: SignedRejectionReceiptV0 | SignedRejectionReceiptV1): string;
4062
+
4063
+ /**
4064
+ * @hlos-ai/schemas - SRR Verification
4065
+ *
4066
+ * Ed25519 signature verification for SignedRejectionReceipt (V0 and V1).
4067
+ * Shared primitive (verifyDetachedEd25519) + SRR-specific entrypoint.
4068
+ *
4069
+ * Requires @noble/ed25519 as peer dependency.
4070
+ */
4071
+
4072
+ /**
4073
+ * Verify a detached Ed25519 signature.
4074
+ * Artifact-agnostic — knows nothing about SRR, receipts, or domains.
4075
+ */
4076
+ declare function verifyDetachedEd25519(params: {
4077
+ signingPayload: Uint8Array;
4078
+ signature: Uint8Array;
4079
+ publicKey: Uint8Array;
4080
+ }): Promise<boolean>;
4081
+ type SrrVerificationResult = {
4082
+ valid: true;
4083
+ } | {
4084
+ valid: false;
4085
+ reason: 'UNSUPPORTED_ALGORITHM' | 'SCHEMA_VIOLATION' | 'PAYLOAD_CONSTRUCTION_ERROR' | 'INVALID_SIGNATURE';
4086
+ };
4087
+ /**
4088
+ * Verify a SignedRejectionReceipt artifact.
4089
+ *
4090
+ * 1. Algorithm check (must be Ed25519) — checked BEFORE schema so the
4091
+ * caller gets a meaningful UNSUPPORTED_ALGORITHM rather than a
4092
+ * generic SCHEMA_VIOLATION from the z.literal('Ed25519') constraint.
4093
+ * 2. Schema validation (Zod parse)
4094
+ * 3. Reconstruct signing payload from unsigned fields
4095
+ * 4. Decode signature from base64url
4096
+ * 5. Ed25519 verify
4097
+ *
4098
+ * Does NOT check:
4099
+ * - Mutual exclusion (SA ⊕ SRR) — runtime invariant
4100
+ * - Crossing existence — verifier doesn't know
4101
+ * - Issuer authorization — only checks signature matches key
4102
+ */
4103
+ declare function verifySignedRejectionReceipt(params: {
4104
+ srr: SignedRejectionReceiptV0 | SignedRejectionReceiptV1 | unknown;
4105
+ publicKey: Uint8Array;
4106
+ }): Promise<SrrVerificationResult>;
4107
+
4108
+ export { type AAREnvelopeV0, AAREnvelopeV0Schema, AAREnvelopeV0TypedSchema, AAR_ENVELOPE_TYPE, AAR_ENVELOPE_VERSION, type AgentListItem, AgentListItemSchema, type AgentPassportStubResponse, AgentPassportStubResponseSchema, type AgentStatus, AgentStatusSchema, type AgentType, AgentTypeSchema, type AgentsListResponse, AgentsListResponseSchema, type ApiResponse, type ArtifactRef, ArtifactRefSchema, type AvailabilityType, AvailabilityTypeSchema, BASE64URL_SHA256_REGEX, Base64urlEd25519SigSchema, Base64urlSha256Schema, CHAIN_STAGE_ORDER, type ChainStageType, ChainStageTypeSchema, type CredentialSource, CredentialSourceSchema, type CrossingHashInputV0, CrossingHashInputV0Schema, CrossingIdFormatSchema, type CrossingSettledReceipt, CrossingSettledReceiptSchema, type CrossingSnapshotV0, CrossingSnapshotV0Schema, type CustodyReceiptContent, CustodyReceiptContentSchema, type DispatchChainContent, DispatchChainContentSchema, DispatchId, DispatchIdBrand, ERROR_CODE_STATUS, EVAL_GOLDEN_FIXTURES, type EconomicGateProofContent, EconomicGateProofContentSchema, type ErrorResponse, ErrorResponseSchema, type EvalArtifact, EvalArtifactSchema, type EvalFailure, EvalFailureSchema, type EvalGraderResult, EvalGraderResultSchema, type EvalTranscriptStep, EvalTranscriptStepSchema, FINALITY_GOLDEN_FIXTURES, FinalityLevel, type FundingSource, FundingSourceSchema, GOLDEN_FIXTURES, type KernelError, type KernelErrorCode, KernelErrorCodeSchema, KernelErrorSchema, type KernelOk, KernelOkSchema, LIABILITY_WAIVER_TERMS_TYPE_URI, LIABILITY_WAIVER_TERMS_VERSION, type LiabilityAttestationContent, LiabilityAttestationContentSchema, type LiabilityDisposition, LiabilityDispositionSchema, LiabilityWaiverTermsConditionsSchema, type LiabilityWaiverTermsHashInput, LiabilityWaiverTermsHashInputSchema, LiabilityWaiverTermsPartiesSchema, type LiabilityWaiverTermsRefV0, LiabilityWaiverTermsRefV0Schema, LiabilityWaiverTermsScopeSchema, type LiabilityWaiverTermsV0, LiabilityWaiverTermsV0Schema, type LogInclusionProof, LogInclusionProofSchema, NA_ID_PREFIX, type NotarizeResponse, NotarizeResponseSchema, type NotarizeStatus, NotarizeStatusSchema, type NotaryAttestation, NotaryAttestationIdFormatSchema, NotaryAttestationSchema, type NotaryRequest, NotaryRequestSchema, PassportIdFormatSchema, type ProviderRole, ProviderRoleSchema, REASON_CODE_PATTERN, type RPID, RPIDSchema, ReceiptIdFormatSchema, type RelyingPartyId, RelyingPartyIdSchema, type RotationEpoch, RotationEpochSchema, SETTLEMENT_AUTHORITY, SRR_INITIAL_REASON_CODES, SRR_REJECTION_DOMAIN, SRR_SIGNATURE_ALGORITHM, SRR_TYPE_URI, SRR_V1_REJECTION_DOMAIN, SRR_V1_SIGNATURE_ALGORITHM, SRR_V1_TYPE_URI, SRR_V1_VERSION, SRR_VERSION, SURFACES, type SettlementAnchorContent, SettlementAnchorContentSchema, type SettlementExecuteError, SettlementExecuteErrorSchema, type SettlementExecuteRequest, SettlementExecuteRequestSchema, type SettlementExecuteResponse, SettlementExecuteResponseSchema, type SettlementExecuteSuccess, SettlementExecuteSuccessSchema, type SignedRejectionReceiptV0, SignedRejectionReceiptV0Schema, type SignedRejectionReceiptV1, SignedRejectionReceiptV1Schema, type SrrVerificationResult, type Stack, type StackConnection, StackConnectionSchema, type StackProvider, StackProviderSchema, StackSchema, type SuccessResponse, SuccessResponseSchema, type Surface, SurfaceSchema, type TransactionContext, type TransactionContextHash, TransactionContextHashSchema, TransactionContextSchema, type UnsignedSrrV0, type UnsignedSrrV1, W_GOLDEN_FIXTURES, W_RPID_DOMAIN, W_TXCTX_DOMAIN, WalletIdFormatSchema, assertRootHash, assertValidChainLink, base64urlToBytes, bytesToBase64url, computeLiabilityWaiverTermsHash, computeSrrDigest, computeSrrSigningPayload, deriveFundingSource, encodeEpoch, error, isCrossingHashInputV0, isCrossingSettledReceipt, isNotaryAttestation, isNotaryRequest, isSettlementExecuteError, isSettlementExecuteSuccess, kernelError, kernelOk, success, toLiabilityWaiverTermsHashInput, validateTimeWindow, verifyAAR, verifyDetachedEd25519, verifySignedRejectionReceipt };