eval-quality 0.2.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +17 -12
  2. package/corpus/dev/README.md +3 -2
  3. package/corpus/dev/compile-seal-example/brief.json +1 -1
  4. package/corpus/dev/compile-seal-example/contract.json +1 -1
  5. package/corpus/dev/contracts/absent-collection-locations.json +1 -1
  6. package/corpus/dev/contracts/absent-sibling-groups.json +1 -1
  7. package/corpus/dev/contracts/absent-success-indicator.json +1 -1
  8. package/corpus/dev/contracts/empty-channel-roles.json +1 -1
  9. package/corpus/dev/contracts/empty-collection-locations.json +1 -1
  10. package/corpus/dev/contracts/empty-request-shapes.json +1 -1
  11. package/corpus/dev/contracts/empty-sibling-groups.json +1 -1
  12. package/corpus/dev/contracts/fragment-selection.json +1 -0
  13. package/corpus/dev/contracts/no-collection-quantifier.json +1 -1
  14. package/corpus/dev/contracts/no-operation-inventory.json +1 -1
  15. package/corpus/dev/contracts/no-read-back-relation.json +1 -1
  16. package/corpus/dev/contracts/no-state-change-marker.json +1 -1
  17. package/corpus/dev/contracts/no-type-violating-step.json +1 -1
  18. package/corpus/dev/contracts/per-key-split-oracles.json +1 -1
  19. package/corpus/dev/contracts/review-corpus.json +1 -0
  20. package/corpus/dev/contracts/satisfied-declarations.json +1 -1
  21. package/corpus/dev/contracts/single-required-response-key.json +1 -1
  22. package/corpus/dev/contracts/split-indicator-oracle.json +1 -1
  23. package/corpus/dev/contracts/unaddressed-parameter-sibling.json +1 -1
  24. package/corpus/dev/contracts/unnamed-reference-set.json +1 -1
  25. package/corpus/dev/contracts/wrong-cardinality-form.json +1 -1
  26. package/corpus/dev/index.json +1 -1
  27. package/dist/adapters/command-line-adapter.d.ts +44 -0
  28. package/dist/adapters/command-line-adapter.js +284 -0
  29. package/dist/adapters/command-target-policy.d.ts +36 -0
  30. package/dist/adapters/command-target-policy.js +33 -0
  31. package/dist/adapters/index.d.ts +2 -0
  32. package/dist/adapters/index.js +1 -0
  33. package/dist/cli/render.d.ts +2 -5
  34. package/dist/cli/render.js +51 -1
  35. package/dist/core/compile/bindings.d.ts +26 -7
  36. package/dist/core/compile/bindings.js +49 -32
  37. package/dist/core/compile/compile.d.ts +12 -0
  38. package/dist/core/compile/compile.js +28 -1
  39. package/dist/core/compile/excluded-content.d.ts +11 -0
  40. package/dist/core/compile/excluded-content.js +42 -0
  41. package/dist/core/compile/expression-legality.d.ts +2 -2
  42. package/dist/core/compile/expression-legality.js +58 -12
  43. package/dist/core/compile/interface-inventory.d.ts +34 -1
  44. package/dist/core/compile/interface-inventory.js +88 -11
  45. package/dist/core/compile/reachability.d.ts +12 -2
  46. package/dist/core/compile/reachability.js +123 -36
  47. package/dist/core/compile/schema-version.d.ts +2 -0
  48. package/dist/core/compile/schema-version.js +25 -0
  49. package/dist/core/compile/sensitivity-witness.d.ts +31 -12
  50. package/dist/core/compile/sensitivity-witness.js +110 -23
  51. package/dist/core/compile/step-reference.d.ts +2 -0
  52. package/dist/core/compile/step-reference.js +49 -0
  53. package/dist/core/coverage/operations.d.ts +62 -0
  54. package/dist/core/coverage/operations.js +57 -0
  55. package/dist/core/coverage/relevance.d.ts +4 -2
  56. package/dist/core/coverage/relevance.js +22 -23
  57. package/dist/core/coverage/satisfaction.d.ts +2 -2
  58. package/dist/core/coverage/satisfaction.js +73 -48
  59. package/dist/core/declared-inputs.d.ts +83 -4
  60. package/dist/core/declared-inputs.js +105 -8
  61. package/dist/core/evaluate/evidence-resolution.d.ts +9 -12
  62. package/dist/core/evaluate/evidence-resolution.js +70 -10
  63. package/dist/core/evaluate/operators.d.ts +22 -0
  64. package/dist/core/evaluate/operators.js +17 -1
  65. package/dist/core/evaluate/resolution.d.ts +14 -3
  66. package/dist/core/evaluate/resolution.js +63 -3
  67. package/dist/core/excluded-content.d.ts +65 -0
  68. package/dist/core/excluded-content.js +113 -0
  69. package/dist/core/failure-codes.d.ts +2 -2
  70. package/dist/core/failure-codes.js +5 -2
  71. package/dist/core/ingest/conditions.d.ts +1 -1
  72. package/dist/core/ingest/ingest.js +8 -0
  73. package/dist/core/preflight/plan.d.ts +7 -5
  74. package/dist/core/preflight/plan.js +75 -32
  75. package/dist/core/preflight/projection.d.ts +6 -3
  76. package/dist/core/preflight/projection.js +22 -2
  77. package/dist/core/preflight/reduce.js +47 -7
  78. package/dist/core/preflight/witness-evidence.d.ts +5 -5
  79. package/dist/core/preflight/witness-evidence.js +63 -20
  80. package/dist/core/schemas/artifact.d.ts +683 -35
  81. package/dist/core/schemas/constraint-ledger.js +11 -0
  82. package/dist/core/schemas/defect-signature.d.ts +438 -16
  83. package/dist/core/schemas/defect-signature.js +58 -10
  84. package/dist/core/schemas/eval-contract.d.ts +517 -12
  85. package/dist/core/schemas/eval-contract.js +18 -2
  86. package/dist/core/schemas/evidence-artifact.d.ts +14 -4
  87. package/dist/core/schemas/evidence-artifact.js +1 -1
  88. package/dist/core/schemas/interface.d.ts +741 -13
  89. package/dist/core/schemas/interface.js +120 -7
  90. package/dist/core/schemas/isolation-manifest.js +16 -9
  91. package/dist/core/schemas/plan.d.ts +217 -3
  92. package/dist/core/schemas/plan.js +22 -1
  93. package/dist/core/schemas/pointer.d.ts +47 -1
  94. package/dist/core/schemas/pointer.js +89 -8
  95. package/dist/core/schemas/port-messages.d.ts +194 -10
  96. package/dist/core/schemas/port-messages.js +73 -6
  97. package/dist/core/schemas/probe-body.d.ts +18 -0
  98. package/dist/core/schemas/probe-body.js +13 -0
  99. package/dist/core/schemas/probe-policy.d.ts +36 -0
  100. package/dist/core/schemas/probe-policy.js +44 -0
  101. package/dist/core/schemas/probe.d.ts +122 -3
  102. package/dist/core/schemas/probe.js +1 -1
  103. package/dist/core/schemas/sealed-run-record.d.ts +131 -9
  104. package/dist/core/schemas/sealed-run-record.js +56 -11
  105. package/dist/core/schemas/sensitivity-witness.d.ts +108 -6
  106. package/dist/core/schemas/sensitivity-witness.js +61 -5
  107. package/dist/core/score/bindings.d.ts +2 -2
  108. package/dist/core/score/bindings.js +25 -13
  109. package/dist/core/score/qualification.d.ts +5 -5
  110. package/dist/core/score/qualification.js +67 -37
  111. package/dist/core/score/quotation.d.ts +1 -24
  112. package/dist/core/score/quotation.js +29 -4
  113. package/dist/core/score/score.js +28 -2
  114. package/dist/core/score/strength.d.ts +9 -0
  115. package/dist/core/score/strength.js +35 -1
  116. package/dist/core/score/witness.d.ts +21 -0
  117. package/dist/core/score/witness.js +9 -4
  118. package/dist/core/seal/derived-reference.d.ts +2 -9
  119. package/dist/core/seal/derived-reference.js +62 -23
  120. package/dist/core/seal/plan-index.d.ts +18 -3
  121. package/dist/core/seal/plan-index.js +44 -8
  122. package/dist/index.d.ts +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/ports/environment-probe-port.d.ts +60 -4
  125. package/dist/testing/conformance.d.ts +2 -1
  126. package/dist/testing/conformance.js +1 -0
  127. package/dist/testing/index.d.ts +3 -3
  128. package/dist/testing/index.js +1 -1
  129. package/dist/testing/probe-conformance.d.ts +56 -5
  130. package/dist/testing/probe-conformance.js +196 -5
  131. package/package.json +1 -1
  132. package/schemas/eval-contract.schema.json +1356 -464
  133. package/schemas/evidence-artifact.schema.json +59 -29
  134. package/schemas/isolation-manifest.schema.json +17 -10
  135. package/schemas/probe.schema.json +197 -71
  136. package/schemas/rubric.schema.json +1 -1
  137. package/schemas/sealed-run-record.schema.json +296 -39
@@ -99,6 +99,22 @@ export declare const Budgets: z.ZodObject<{
99
99
  maxWallClockMinutes: z.ZodInt;
100
100
  maxCostUsd: z.ZodString;
101
101
  }, z.core.$strict>;
102
+ /**
103
+ * The one `schemaVersion` this build reads.
104
+ *
105
+ * AD-11 says "readers accept an equal `schemaVersion` only and throw
106
+ * `schema-version-mismatch` outside that", and puts the comparison on the
107
+ * reader rather than in the schema: `lineage.ts` records that a `z.literal`
108
+ * would turn a version-2 artifact into an anonymous parse failure instead of
109
+ * AD-28's dedicated fault. That left the rule stated everywhere and performed
110
+ * nowhere for this artifact, so a contract stamped 3 parsed and compiled clean
111
+ * and its stale version travelled into the scoring version, which is the one
112
+ * number AD-11 exists to keep comparable.
113
+ *
114
+ * `compile` is the reader that performs it. The constant lives here beside the
115
+ * schema whose version it names, so the bump and the constant are one edit.
116
+ */
117
+ export declare const EVAL_CONTRACT_SCHEMA_VERSION = 4;
102
118
  export declare const EvalContract: z.ZodObject<{
103
119
  schemaVersion: z.ZodInt;
104
120
  parentDigest: z.ZodNullable<z.ZodString>;
@@ -185,14 +201,9 @@ export declare const EvalContract: z.ZodObject<{
185
201
  approval: z.ZodNullable<z.ZodString>;
186
202
  expiresAt: z.ZodNullable<z.ZodISODateTime>;
187
203
  }, z.core.$strict>>;
188
- permittedInterfaces: z.ZodArray<z.ZodObject<{
204
+ permittedInterfaces: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
189
205
  logicalId: z.ZodString;
190
- kind: z.ZodEnum<{
191
- api: "api";
192
- cli: "cli";
193
- mcp: "mcp";
194
- web: "web";
195
- }>;
206
+ kind: z.ZodLiteral<"api">;
196
207
  operations: z.ZodArray<z.ZodObject<{
197
208
  operationId: z.ZodString;
198
209
  method: z.ZodEnum<{
@@ -293,13 +304,17 @@ export declare const EvalContract: z.ZodObject<{
293
304
  sensitivityWitness: z.ZodNullable<z.ZodObject<{
294
305
  witnessId: z.ZodString;
295
306
  channel: z.ZodEnum<{
307
+ argument: "argument";
296
308
  body: "body";
309
+ environment: "environment";
310
+ option: "option";
297
311
  path: "path";
298
312
  query: "query";
313
+ stdin: "stdin";
299
314
  }>;
300
315
  legs: z.ZodArray<z.ZodObject<{
301
316
  legId: z.ZodString;
302
- inputs: z.ZodObject<{
317
+ inputs: z.ZodUnion<readonly [z.ZodObject<{
303
318
  path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
304
319
  query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
305
320
  header: z.ZodRecord<z.ZodString, z.ZodString>;
@@ -309,12 +324,453 @@ export declare const EvalContract: z.ZodObject<{
309
324
  }, z.core.$strict>, z.ZodObject<{
310
325
  kind: z.ZodLiteral<"absent">;
311
326
  }, z.core.$strict>], "kind">;
312
- }, z.core.$strict>;
327
+ }, z.core.$strict>, z.ZodObject<{
328
+ argument: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
329
+ option: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
330
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
331
+ stdin: z.ZodDiscriminatedUnion<[z.ZodObject<{
332
+ kind: z.ZodLiteral<"json">;
333
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
334
+ }, z.core.$strict>, z.ZodObject<{
335
+ kind: z.ZodLiteral<"text">;
336
+ value: z.ZodString;
337
+ }, z.core.$strict>, z.ZodObject<{
338
+ kind: z.ZodLiteral<"absent">;
339
+ }, z.core.$strict>], "kind">;
340
+ }, z.core.$strict>]>;
313
341
  }, z.core.$strict>>;
314
342
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
315
343
  }, z.core.$strict>>;
316
344
  }, z.core.$strict>>;
317
- }, z.core.$strict>>;
345
+ }, z.core.$strict>, z.ZodObject<{
346
+ logicalId: z.ZodString;
347
+ kind: z.ZodLiteral<"web">;
348
+ operations: z.ZodArray<z.ZodObject<{
349
+ operationId: z.ZodString;
350
+ method: z.ZodEnum<{
351
+ DELETE: "DELETE";
352
+ GET: "GET";
353
+ HEAD: "HEAD";
354
+ OPTIONS: "OPTIONS";
355
+ PATCH: "PATCH";
356
+ POST: "POST";
357
+ PUT: "PUT";
358
+ }>;
359
+ pathTemplate: z.ZodString;
360
+ stateChangeMarker: z.ZodBoolean;
361
+ requestShape: z.ZodObject<{
362
+ path: z.ZodObject<{
363
+ requiredKeys: z.ZodArray<z.ZodString>;
364
+ permittedKeys: z.ZodArray<z.ZodString>;
365
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
366
+ array: "array";
367
+ boolean: "boolean";
368
+ null: "null";
369
+ number: "number";
370
+ object: "object";
371
+ string: "string";
372
+ }>>>;
373
+ }, z.core.$strict>;
374
+ query: z.ZodObject<{
375
+ requiredKeys: z.ZodArray<z.ZodString>;
376
+ permittedKeys: z.ZodArray<z.ZodString>;
377
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
378
+ array: "array";
379
+ boolean: "boolean";
380
+ null: "null";
381
+ number: "number";
382
+ object: "object";
383
+ string: "string";
384
+ }>>>;
385
+ }, z.core.$strict>;
386
+ header: z.ZodObject<{
387
+ requiredKeys: z.ZodArray<z.ZodString>;
388
+ permittedKeys: z.ZodArray<z.ZodString>;
389
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
390
+ array: "array";
391
+ boolean: "boolean";
392
+ null: "null";
393
+ number: "number";
394
+ object: "object";
395
+ string: "string";
396
+ }>>>;
397
+ }, z.core.$strict>;
398
+ body: z.ZodObject<{
399
+ requiredKeys: z.ZodArray<z.ZodString>;
400
+ permittedKeys: z.ZodArray<z.ZodString>;
401
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
402
+ array: "array";
403
+ boolean: "boolean";
404
+ null: "null";
405
+ number: "number";
406
+ object: "object";
407
+ string: "string";
408
+ }>>>;
409
+ }, z.core.$strict>;
410
+ }, z.core.$strict>;
411
+ responseDescriptor: z.ZodObject<{
412
+ requiredKeys: z.ZodArray<z.ZodString>;
413
+ permittedKeys: z.ZodArray<z.ZodString>;
414
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
415
+ array: "array";
416
+ boolean: "boolean";
417
+ null: "null";
418
+ number: "number";
419
+ object: "object";
420
+ string: "string";
421
+ }>>>;
422
+ successIndicator: z.ZodNullable<z.ZodString>;
423
+ channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
424
+ collection: "collection";
425
+ diagnostic: "diagnostic";
426
+ payload: "payload";
427
+ "success-indicator": "success-indicator";
428
+ }>>>;
429
+ collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
430
+ pointer: z.ZodString;
431
+ expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
432
+ mode: z.ZodLiteral<"exact">;
433
+ count: z.ZodInt;
434
+ }, z.core.$strict>, z.ZodObject<{
435
+ mode: z.ZodLiteral<"at-most">;
436
+ max: z.ZodInt;
437
+ }, z.core.$strict>, z.ZodObject<{
438
+ mode: z.ZodLiteral<"page-bounded">;
439
+ max: z.ZodInt;
440
+ }, z.core.$strict>], "mode">;
441
+ referenceSet: z.ZodNullable<z.ZodString>;
442
+ }, z.core.$strict>>>;
443
+ }, z.core.$strict>;
444
+ volatilePointers: z.ZodArray<z.ZodString>;
445
+ sensitivityWitness: z.ZodNullable<z.ZodObject<{
446
+ witnessId: z.ZodString;
447
+ channel: z.ZodEnum<{
448
+ argument: "argument";
449
+ body: "body";
450
+ environment: "environment";
451
+ option: "option";
452
+ path: "path";
453
+ query: "query";
454
+ stdin: "stdin";
455
+ }>;
456
+ legs: z.ZodArray<z.ZodObject<{
457
+ legId: z.ZodString;
458
+ inputs: z.ZodUnion<readonly [z.ZodObject<{
459
+ path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
460
+ query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
461
+ header: z.ZodRecord<z.ZodString, z.ZodString>;
462
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
463
+ kind: z.ZodLiteral<"json">;
464
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
465
+ }, z.core.$strict>, z.ZodObject<{
466
+ kind: z.ZodLiteral<"absent">;
467
+ }, z.core.$strict>], "kind">;
468
+ }, z.core.$strict>, z.ZodObject<{
469
+ argument: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
470
+ option: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
471
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
472
+ stdin: z.ZodDiscriminatedUnion<[z.ZodObject<{
473
+ kind: z.ZodLiteral<"json">;
474
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
475
+ }, z.core.$strict>, z.ZodObject<{
476
+ kind: z.ZodLiteral<"text">;
477
+ value: z.ZodString;
478
+ }, z.core.$strict>, z.ZodObject<{
479
+ kind: z.ZodLiteral<"absent">;
480
+ }, z.core.$strict>], "kind">;
481
+ }, z.core.$strict>]>;
482
+ }, z.core.$strict>>;
483
+ relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
484
+ }, z.core.$strict>>;
485
+ }, z.core.$strict>>;
486
+ }, z.core.$strict>, z.ZodObject<{
487
+ logicalId: z.ZodString;
488
+ kind: z.ZodLiteral<"mcp">;
489
+ operations: z.ZodArray<z.ZodObject<{
490
+ operationId: z.ZodString;
491
+ method: z.ZodEnum<{
492
+ DELETE: "DELETE";
493
+ GET: "GET";
494
+ HEAD: "HEAD";
495
+ OPTIONS: "OPTIONS";
496
+ PATCH: "PATCH";
497
+ POST: "POST";
498
+ PUT: "PUT";
499
+ }>;
500
+ pathTemplate: z.ZodString;
501
+ stateChangeMarker: z.ZodBoolean;
502
+ requestShape: z.ZodObject<{
503
+ path: z.ZodObject<{
504
+ requiredKeys: z.ZodArray<z.ZodString>;
505
+ permittedKeys: z.ZodArray<z.ZodString>;
506
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
507
+ array: "array";
508
+ boolean: "boolean";
509
+ null: "null";
510
+ number: "number";
511
+ object: "object";
512
+ string: "string";
513
+ }>>>;
514
+ }, z.core.$strict>;
515
+ query: z.ZodObject<{
516
+ requiredKeys: z.ZodArray<z.ZodString>;
517
+ permittedKeys: z.ZodArray<z.ZodString>;
518
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
519
+ array: "array";
520
+ boolean: "boolean";
521
+ null: "null";
522
+ number: "number";
523
+ object: "object";
524
+ string: "string";
525
+ }>>>;
526
+ }, z.core.$strict>;
527
+ header: z.ZodObject<{
528
+ requiredKeys: z.ZodArray<z.ZodString>;
529
+ permittedKeys: z.ZodArray<z.ZodString>;
530
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
531
+ array: "array";
532
+ boolean: "boolean";
533
+ null: "null";
534
+ number: "number";
535
+ object: "object";
536
+ string: "string";
537
+ }>>>;
538
+ }, z.core.$strict>;
539
+ body: z.ZodObject<{
540
+ requiredKeys: z.ZodArray<z.ZodString>;
541
+ permittedKeys: z.ZodArray<z.ZodString>;
542
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
543
+ array: "array";
544
+ boolean: "boolean";
545
+ null: "null";
546
+ number: "number";
547
+ object: "object";
548
+ string: "string";
549
+ }>>>;
550
+ }, z.core.$strict>;
551
+ }, z.core.$strict>;
552
+ responseDescriptor: z.ZodObject<{
553
+ requiredKeys: z.ZodArray<z.ZodString>;
554
+ permittedKeys: z.ZodArray<z.ZodString>;
555
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
556
+ array: "array";
557
+ boolean: "boolean";
558
+ null: "null";
559
+ number: "number";
560
+ object: "object";
561
+ string: "string";
562
+ }>>>;
563
+ successIndicator: z.ZodNullable<z.ZodString>;
564
+ channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
565
+ collection: "collection";
566
+ diagnostic: "diagnostic";
567
+ payload: "payload";
568
+ "success-indicator": "success-indicator";
569
+ }>>>;
570
+ collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
571
+ pointer: z.ZodString;
572
+ expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
573
+ mode: z.ZodLiteral<"exact">;
574
+ count: z.ZodInt;
575
+ }, z.core.$strict>, z.ZodObject<{
576
+ mode: z.ZodLiteral<"at-most">;
577
+ max: z.ZodInt;
578
+ }, z.core.$strict>, z.ZodObject<{
579
+ mode: z.ZodLiteral<"page-bounded">;
580
+ max: z.ZodInt;
581
+ }, z.core.$strict>], "mode">;
582
+ referenceSet: z.ZodNullable<z.ZodString>;
583
+ }, z.core.$strict>>>;
584
+ }, z.core.$strict>;
585
+ volatilePointers: z.ZodArray<z.ZodString>;
586
+ sensitivityWitness: z.ZodNullable<z.ZodObject<{
587
+ witnessId: z.ZodString;
588
+ channel: z.ZodEnum<{
589
+ argument: "argument";
590
+ body: "body";
591
+ environment: "environment";
592
+ option: "option";
593
+ path: "path";
594
+ query: "query";
595
+ stdin: "stdin";
596
+ }>;
597
+ legs: z.ZodArray<z.ZodObject<{
598
+ legId: z.ZodString;
599
+ inputs: z.ZodUnion<readonly [z.ZodObject<{
600
+ path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
601
+ query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
602
+ header: z.ZodRecord<z.ZodString, z.ZodString>;
603
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
604
+ kind: z.ZodLiteral<"json">;
605
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
606
+ }, z.core.$strict>, z.ZodObject<{
607
+ kind: z.ZodLiteral<"absent">;
608
+ }, z.core.$strict>], "kind">;
609
+ }, z.core.$strict>, z.ZodObject<{
610
+ argument: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
611
+ option: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
612
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
613
+ stdin: z.ZodDiscriminatedUnion<[z.ZodObject<{
614
+ kind: z.ZodLiteral<"json">;
615
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
616
+ }, z.core.$strict>, z.ZodObject<{
617
+ kind: z.ZodLiteral<"text">;
618
+ value: z.ZodString;
619
+ }, z.core.$strict>, z.ZodObject<{
620
+ kind: z.ZodLiteral<"absent">;
621
+ }, z.core.$strict>], "kind">;
622
+ }, z.core.$strict>]>;
623
+ }, z.core.$strict>>;
624
+ relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
625
+ }, z.core.$strict>>;
626
+ }, z.core.$strict>>;
627
+ }, z.core.$strict>, z.ZodObject<{
628
+ logicalId: z.ZodString;
629
+ kind: z.ZodLiteral<"cli">;
630
+ operations: z.ZodArray<z.ZodObject<{
631
+ operationId: z.ZodString;
632
+ invocation: z.ZodObject<{
633
+ executable: z.ZodString;
634
+ subcommandPath: z.ZodArray<z.ZodString>;
635
+ }, z.core.$strict>;
636
+ stateChangeMarker: z.ZodBoolean;
637
+ requestShape: z.ZodObject<{
638
+ argument: z.ZodObject<{
639
+ requiredKeys: z.ZodArray<z.ZodString>;
640
+ permittedKeys: z.ZodArray<z.ZodString>;
641
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
642
+ array: "array";
643
+ boolean: "boolean";
644
+ null: "null";
645
+ number: "number";
646
+ object: "object";
647
+ string: "string";
648
+ }>>>;
649
+ }, z.core.$strict>;
650
+ option: z.ZodObject<{
651
+ requiredKeys: z.ZodArray<z.ZodString>;
652
+ permittedKeys: z.ZodArray<z.ZodString>;
653
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
654
+ array: "array";
655
+ boolean: "boolean";
656
+ null: "null";
657
+ number: "number";
658
+ object: "object";
659
+ string: "string";
660
+ }>>>;
661
+ }, z.core.$strict>;
662
+ environment: z.ZodObject<{
663
+ requiredKeys: z.ZodArray<z.ZodString>;
664
+ permittedKeys: z.ZodArray<z.ZodString>;
665
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
666
+ array: "array";
667
+ boolean: "boolean";
668
+ null: "null";
669
+ number: "number";
670
+ object: "object";
671
+ string: "string";
672
+ }>>>;
673
+ }, z.core.$strict>;
674
+ stdin: z.ZodObject<{
675
+ requiredKeys: z.ZodArray<z.ZodString>;
676
+ permittedKeys: z.ZodArray<z.ZodString>;
677
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
678
+ array: "array";
679
+ boolean: "boolean";
680
+ null: "null";
681
+ number: "number";
682
+ object: "object";
683
+ string: "string";
684
+ }>>>;
685
+ }, z.core.$strict>;
686
+ }, z.core.$strict>;
687
+ artifacts: z.ZodArray<z.ZodString>;
688
+ descriptorChannel: z.ZodDiscriminatedUnion<[z.ZodObject<{
689
+ kind: z.ZodLiteral<"stream">;
690
+ channel: z.ZodEnum<{
691
+ stderr: "stderr";
692
+ stdout: "stdout";
693
+ }>;
694
+ }, z.core.$strict>, z.ZodObject<{
695
+ kind: z.ZodLiteral<"artifact">;
696
+ artifactId: z.ZodString;
697
+ }, z.core.$strict>], "kind">;
698
+ responseDescriptor: z.ZodObject<{
699
+ requiredKeys: z.ZodArray<z.ZodString>;
700
+ permittedKeys: z.ZodArray<z.ZodString>;
701
+ types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
702
+ array: "array";
703
+ boolean: "boolean";
704
+ null: "null";
705
+ number: "number";
706
+ object: "object";
707
+ string: "string";
708
+ }>>>;
709
+ successIndicator: z.ZodNullable<z.ZodString>;
710
+ channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
711
+ collection: "collection";
712
+ diagnostic: "diagnostic";
713
+ payload: "payload";
714
+ "success-indicator": "success-indicator";
715
+ }>>>;
716
+ collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
717
+ pointer: z.ZodString;
718
+ expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
719
+ mode: z.ZodLiteral<"exact">;
720
+ count: z.ZodInt;
721
+ }, z.core.$strict>, z.ZodObject<{
722
+ mode: z.ZodLiteral<"at-most">;
723
+ max: z.ZodInt;
724
+ }, z.core.$strict>, z.ZodObject<{
725
+ mode: z.ZodLiteral<"page-bounded">;
726
+ max: z.ZodInt;
727
+ }, z.core.$strict>], "mode">;
728
+ referenceSet: z.ZodNullable<z.ZodString>;
729
+ }, z.core.$strict>>>;
730
+ }, z.core.$strict>;
731
+ volatilePointers: z.ZodArray<z.ZodString>;
732
+ sensitivityWitness: z.ZodNullable<z.ZodObject<{
733
+ witnessId: z.ZodString;
734
+ channel: z.ZodEnum<{
735
+ argument: "argument";
736
+ body: "body";
737
+ environment: "environment";
738
+ option: "option";
739
+ path: "path";
740
+ query: "query";
741
+ stdin: "stdin";
742
+ }>;
743
+ legs: z.ZodArray<z.ZodObject<{
744
+ legId: z.ZodString;
745
+ inputs: z.ZodUnion<readonly [z.ZodObject<{
746
+ path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
747
+ query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
748
+ header: z.ZodRecord<z.ZodString, z.ZodString>;
749
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
750
+ kind: z.ZodLiteral<"json">;
751
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
752
+ }, z.core.$strict>, z.ZodObject<{
753
+ kind: z.ZodLiteral<"absent">;
754
+ }, z.core.$strict>], "kind">;
755
+ }, z.core.$strict>, z.ZodObject<{
756
+ argument: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
757
+ option: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
758
+ environment: z.ZodRecord<z.ZodString, z.ZodString>;
759
+ stdin: z.ZodDiscriminatedUnion<[z.ZodObject<{
760
+ kind: z.ZodLiteral<"json">;
761
+ value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
762
+ }, z.core.$strict>, z.ZodObject<{
763
+ kind: z.ZodLiteral<"text">;
764
+ value: z.ZodString;
765
+ }, z.core.$strict>, z.ZodObject<{
766
+ kind: z.ZodLiteral<"absent">;
767
+ }, z.core.$strict>], "kind">;
768
+ }, z.core.$strict>]>;
769
+ }, z.core.$strict>>;
770
+ relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
771
+ }, z.core.$strict>>;
772
+ }, z.core.$strict>>;
773
+ }, z.core.$strict>], "kind">>;
318
774
  referenceSets: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
319
775
  keys: z.ZodArray<z.ZodString>;
320
776
  members: z.ZodArray<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
@@ -327,7 +783,7 @@ export declare const EvalContract: z.ZodObject<{
327
783
  interactionPlan: z.ZodArray<z.ZodObject<{
328
784
  stepId: z.ZodString;
329
785
  operationId: z.ZodString;
330
- inputBinding: z.ZodObject<{
786
+ inputBinding: z.ZodUnion<readonly [z.ZodObject<{
331
787
  path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
332
788
  literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
333
789
  }, z.core.$strict>, z.ZodObject<{
@@ -376,7 +832,56 @@ export declare const EvalContract: z.ZodObject<{
376
832
  }, z.core.$strict>, z.ZodObject<{
377
833
  principal: z.ZodString;
378
834
  }, z.core.$strict>]>>>;
379
- }, z.core.$strict>;
835
+ }, z.core.$strict>, z.ZodObject<{
836
+ argument: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
837
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
838
+ }, z.core.$strict>, z.ZodObject<{
839
+ matcher: z.ZodEnum<{
840
+ any: "any";
841
+ "type-violating": "type-violating";
842
+ }>;
843
+ }, z.core.$strict>, z.ZodObject<{
844
+ captured: z.ZodString;
845
+ }, z.core.$strict>, z.ZodObject<{
846
+ principal: z.ZodString;
847
+ }, z.core.$strict>]>>>;
848
+ option: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
849
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
850
+ }, z.core.$strict>, z.ZodObject<{
851
+ matcher: z.ZodEnum<{
852
+ any: "any";
853
+ "type-violating": "type-violating";
854
+ }>;
855
+ }, z.core.$strict>, z.ZodObject<{
856
+ captured: z.ZodString;
857
+ }, z.core.$strict>, z.ZodObject<{
858
+ principal: z.ZodString;
859
+ }, z.core.$strict>]>>>;
860
+ environment: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
861
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
862
+ }, z.core.$strict>, z.ZodObject<{
863
+ matcher: z.ZodEnum<{
864
+ any: "any";
865
+ "type-violating": "type-violating";
866
+ }>;
867
+ }, z.core.$strict>, z.ZodObject<{
868
+ captured: z.ZodString;
869
+ }, z.core.$strict>, z.ZodObject<{
870
+ principal: z.ZodString;
871
+ }, z.core.$strict>]>>>;
872
+ stdin: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
873
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
874
+ }, z.core.$strict>, z.ZodObject<{
875
+ matcher: z.ZodEnum<{
876
+ any: "any";
877
+ "type-violating": "type-violating";
878
+ }>;
879
+ }, z.core.$strict>, z.ZodObject<{
880
+ captured: z.ZodString;
881
+ }, z.core.$strict>, z.ZodObject<{
882
+ principal: z.ZodString;
883
+ }, z.core.$strict>]>>>;
884
+ }, z.core.$strict>]>;
380
885
  after: z.ZodNullable<z.ZodString>;
381
886
  cardinality: z.ZodEnum<{
382
887
  any: "any";
@@ -105,6 +105,22 @@ export const Budgets = z.strictObject({
105
105
  maxWallClockMinutes: z.int().min(0),
106
106
  maxCostUsd: UnsignedDecimalString.describe('Money, so AD-36 carries it as a string in a declared format rather than as a JSON number. Constrained to the unsigned form: a negative ceiling is not a ceiling.'),
107
107
  });
108
+ /**
109
+ * The one `schemaVersion` this build reads.
110
+ *
111
+ * AD-11 says "readers accept an equal `schemaVersion` only and throw
112
+ * `schema-version-mismatch` outside that", and puts the comparison on the
113
+ * reader rather than in the schema: `lineage.ts` records that a `z.literal`
114
+ * would turn a version-2 artifact into an anonymous parse failure instead of
115
+ * AD-28's dedicated fault. That left the rule stated everywhere and performed
116
+ * nowhere for this artifact, so a contract stamped 3 parsed and compiled clean
117
+ * and its stale version travelled into the scoring version, which is the one
118
+ * number AD-11 exists to keep comparable.
119
+ *
120
+ * `compile` is the reader that performs it. The constant lives here beside the
121
+ * schema whose version it names, so the bump and the constant are one edit.
122
+ */
123
+ export const EVAL_CONTRACT_SCHEMA_VERSION = 4;
108
124
  export const EvalContract = z
109
125
  .strictObject({
110
126
  // AD-11's schemaVersion and AD-29's lineage pair, spread from the leaf
@@ -128,7 +144,7 @@ export const EvalContract = z
128
144
  waivers: z.array(Waiver),
129
145
  permittedInterfaces: z
130
146
  .array(PermittedInterface)
131
- .describe('AD-35: logical identifiers only. No entry here is ever a URL, a host, or a port.'),
147
+ .describe("AD-35: logical identifiers only. No entry here is ever a URL, a host, or a port. Discriminated on `kind`, which makes this field the eval contract's `schemaVersion` 3 -> 4 BREAKING bump under AD-11, whose rule is that \"adding an optional field is a `schemaVersion` bump recorded in the field's own description; removing or retyping is breaking\". The `api`, `web`, and `mcp` branches carry the shipped operation shape unchanged, so a version-3 contract's own bytes still parse on them; the `cli` branch carries a command operation, which declares a logical invocation instead of a method and a path template, four command input channels instead of the four transport channels, a nominated output channel for its one response descriptor, and the files it writes."),
132
148
  referenceSets: z
133
149
  .record(Identifier, ReferenceSetDeclaration)
134
150
  .nullable()
@@ -157,5 +173,5 @@ export const EvalContract = z
157
173
  })
158
174
  .meta({
159
175
  id: 'EvalContract',
160
- description: "The Eval Contract. Succeeds the prior-art `eval-contract` schema per AD-24. It carries every declaration AD-19 requires so that AD-31's fourteen relevance and satisfaction predicates are decidable from declarations alone. AD-10's sensitivity witnesses arrived in this version, on each operation, as the additive `schemaVersion` bump AD-11 requires; the bump is recorded in each new field's own description, since no reader in this version declares an expected version constant to compare against.",
176
+ description: "The Eval Contract. Succeeds the prior-art `eval-contract` schema per AD-24. It carries every declaration AD-19 requires so that AD-31's fourteen relevance and satisfaction predicates are decidable from declarations alone. AD-10's sensitivity witnesses arrived on each operation as an additive `schemaVersion` bump; version 4 opens `permittedInterfaces` to a second interface kind, so a contract may describe a system under test that runs behind a command, and widens the interaction pointer's accepted language with the four command input channels and the `artifact` channel. The widening retypes nothing on its own, since every pointer legal under version 3 is still legal; it carries the same version because it ships in the same release as the retypes. Each bump is recorded in its own field's description, and `compile` compares the stamp against `EVAL_CONTRACT_SCHEMA_VERSION` and throws AD-28's `schema-version-mismatch` on anything else.",
161
177
  });