eval-quality 1.4.1 → 2.0.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 (107) hide show
  1. package/README.md +5 -5
  2. package/corpus/dev/README.md +24 -13
  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/captured-read-back.json +1 -0
  9. package/corpus/dev/contracts/checklist-selection.json +1 -0
  10. package/corpus/dev/contracts/empty-channel-roles.json +1 -1
  11. package/corpus/dev/contracts/empty-collection-locations.json +1 -1
  12. package/corpus/dev/contracts/empty-request-shapes.json +1 -1
  13. package/corpus/dev/contracts/empty-sibling-groups.json +1 -1
  14. package/corpus/dev/contracts/fragment-selection.json +1 -1
  15. package/corpus/dev/contracts/no-collection-quantifier.json +1 -1
  16. package/corpus/dev/contracts/no-operation-inventory.json +1 -1
  17. package/corpus/dev/contracts/no-read-back-relation.json +1 -1
  18. package/corpus/dev/contracts/no-state-change-marker.json +1 -1
  19. package/corpus/dev/contracts/no-type-violating-step.json +1 -1
  20. package/corpus/dev/contracts/notes-tool-server.json +1 -0
  21. package/corpus/dev/contracts/per-key-split-oracles.json +1 -1
  22. package/corpus/dev/contracts/review-corpus.json +1 -1
  23. package/corpus/dev/contracts/satisfied-declarations.json +1 -1
  24. package/corpus/dev/contracts/single-required-response-key.json +1 -1
  25. package/corpus/dev/contracts/split-indicator-oracle.json +1 -1
  26. package/corpus/dev/contracts/unaddressed-parameter-sibling.json +1 -1
  27. package/corpus/dev/contracts/unnamed-reference-set.json +1 -1
  28. package/corpus/dev/contracts/wrong-cardinality-form.json +1 -1
  29. package/corpus/dev/index.json +1 -1
  30. package/dist/adapters/command-line-adapter.js +44 -6
  31. package/dist/adapters/index.d.ts +2 -0
  32. package/dist/adapters/index.js +1 -0
  33. package/dist/adapters/mcp-adapter.d.ts +32 -0
  34. package/dist/adapters/mcp-adapter.js +357 -0
  35. package/dist/adapters/mcp-target-policy.d.ts +39 -0
  36. package/dist/adapters/mcp-target-policy.js +30 -0
  37. package/dist/cli/render.d.ts +8 -3
  38. package/dist/cli/render.js +13 -6
  39. package/dist/cli/run.js +2 -1
  40. package/dist/core/compile/bindings.d.ts +8 -18
  41. package/dist/core/compile/bindings.js +13 -10
  42. package/dist/core/compile/interface-inventory.d.ts +81 -3
  43. package/dist/core/compile/interface-inventory.js +134 -23
  44. package/dist/core/compile/reachability.d.ts +73 -1
  45. package/dist/core/compile/reachability.js +134 -19
  46. package/dist/core/compile/sensitivity-witness.d.ts +22 -10
  47. package/dist/core/compile/sensitivity-witness.js +101 -13
  48. package/dist/core/coverage/operations.d.ts +1 -1
  49. package/dist/core/coverage/operations.js +1 -1
  50. package/dist/core/coverage/relevance.d.ts +3 -3
  51. package/dist/core/coverage/relevance.js +3 -3
  52. package/dist/core/declared-inputs.d.ts +21 -9
  53. package/dist/core/declared-inputs.js +51 -16
  54. package/dist/core/evaluate/evidence-resolution.d.ts +8 -7
  55. package/dist/core/evaluate/evidence-resolution.js +25 -18
  56. package/dist/core/preflight/plan.js +28 -6
  57. package/dist/core/preflight/projection.d.ts +10 -1
  58. package/dist/core/preflight/projection.js +9 -5
  59. package/dist/core/preflight/reduce.js +6 -2
  60. package/dist/core/preflight/witness-evidence.js +31 -9
  61. package/dist/core/schemas/artifact.d.ts +145 -49
  62. package/dist/core/schemas/defect-signature.d.ts +280 -23
  63. package/dist/core/schemas/defect-signature.js +65 -37
  64. package/dist/core/schemas/eval-contract.d.ts +33 -48
  65. package/dist/core/schemas/eval-contract.js +3 -3
  66. package/dist/core/schemas/interface.d.ts +193 -55
  67. package/dist/core/schemas/interface.js +82 -15
  68. package/dist/core/schemas/plan.d.ts +45 -1
  69. package/dist/core/schemas/plan.js +13 -2
  70. package/dist/core/schemas/pointer.d.ts +23 -9
  71. package/dist/core/schemas/pointer.js +25 -11
  72. package/dist/core/schemas/port-messages.d.ts +81 -0
  73. package/dist/core/schemas/port-messages.js +50 -3
  74. package/dist/core/schemas/primitives.d.ts +18 -0
  75. package/dist/core/schemas/primitives.js +29 -0
  76. package/dist/core/schemas/probe-policy.d.ts +41 -0
  77. package/dist/core/schemas/probe-policy.js +61 -1
  78. package/dist/core/schemas/probe-qualification.js +4 -1
  79. package/dist/core/schemas/probe.d.ts +115 -2
  80. package/dist/core/schemas/probe.js +2 -2
  81. package/dist/core/schemas/sealed-run-record.d.ts +11 -5
  82. package/dist/core/schemas/sealed-run-record.js +21 -9
  83. package/dist/core/schemas/sensitivity-witness.d.ts +31 -7
  84. package/dist/core/schemas/sensitivity-witness.js +32 -9
  85. package/dist/core/score/bindings.d.ts +1 -1
  86. package/dist/core/score/bindings.js +4 -4
  87. package/dist/core/score/qualification.d.ts +7 -5
  88. package/dist/core/score/qualification.js +92 -23
  89. package/dist/core/score/score.js +1 -1
  90. package/dist/core/seal/derived-reference.js +20 -17
  91. package/dist/core/seal/plan-index.d.ts +18 -9
  92. package/dist/core/seal/plan-index.js +79 -37
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.js +1 -1
  95. package/dist/ports/environment-probe-port.d.ts +50 -17
  96. package/dist/ports/environment-probe-port.js +26 -17
  97. package/dist/testing/conformance.d.ts +3 -2
  98. package/dist/testing/conformance.js +2 -1
  99. package/dist/testing/index.d.ts +3 -3
  100. package/dist/testing/index.js +1 -1
  101. package/dist/testing/probe-conformance.d.ts +90 -13
  102. package/dist/testing/probe-conformance.js +375 -160
  103. package/package.json +4 -2
  104. package/schemas/eval-contract.schema.json +571 -18
  105. package/schemas/probe.schema.json +156 -14
  106. package/schemas/rubric.schema.json +1 -1
  107. package/schemas/sealed-run-record.schema.json +24 -17
@@ -53,17 +53,17 @@ export declare const ProbeBindingChannel: z.ZodNullable<z.ZodRecord<z.ZodString,
53
53
  }>;
54
54
  }, z.core.$strict>]>>>;
55
55
  /**
56
- * Every input channel of either kind, spelled exactly as `ObservedCallInputs`
57
- * spells them. The two shapes agree on channel names, on the eight-key strict
58
- * form, and on flatness, so the selector filters recorded call inputs with no
59
- * shape to bridge.
56
+ * Every input channel the pointer grammar admits, spelled exactly as
57
+ * `ObservedCallInputs` spells them. The two shapes agree on channel names, on
58
+ * the strict form, on width, and on flatness, so the selector filters recorded
59
+ * call inputs with no shape to bridge.
60
60
  *
61
- * One object over both kinds rather than a union, on `ObservedCallInputs`'s own
62
- * reasoning: `null` already means "binds nothing here", so a selector that
63
- * binds only command channels writes `null` in the transport four and nothing
64
- * is ambiguous. `InputBinding` on the contract side is a union instead, because
65
- * a request-shape channel's "declared, no keys" state is not the same as
66
- * unused and the two spellings had to stay apart.
61
+ * One object over all three kinds rather than a union, on
62
+ * `ObservedCallInputs`'s own reasoning: `null` already means "binds nothing
63
+ * here", so a selector that binds only command channels writes `null` in the
64
+ * transport four and nothing is ambiguous. `InputBinding` on the contract side
65
+ * is a union instead, because a request-shape channel's "declared, no keys"
66
+ * state differs from unused and the two spellings had to stay apart.
67
67
  */
68
68
  export declare const ProbeInputBinding: z.ZodObject<{
69
69
  path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
@@ -130,6 +130,14 @@ export declare const ProbeInputBinding: z.ZodObject<{
130
130
  "type-violating": "type-violating";
131
131
  }>;
132
132
  }, z.core.$strict>]>>>;
133
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
134
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
135
+ }, z.core.$strict>, z.ZodObject<{
136
+ matcher: z.ZodEnum<{
137
+ any: "any";
138
+ "type-violating": "type-violating";
139
+ }>;
140
+ }, z.core.$strict>]>>>;
133
141
  }, z.core.$strict>;
134
142
  /**
135
143
  * AD-39's selector grammar, duplicated on the corpus side, minus the two
@@ -208,6 +216,14 @@ export declare const ProbeStepSelector: z.ZodObject<{
208
216
  "type-violating": "type-violating";
209
217
  }>;
210
218
  }, z.core.$strict>]>>>;
219
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
220
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
221
+ }, z.core.$strict>, z.ZodObject<{
222
+ matcher: z.ZodEnum<{
223
+ any: "any";
224
+ "type-violating": "type-violating";
225
+ }>;
226
+ }, z.core.$strict>]>>>;
211
227
  }, z.core.$strict>;
212
228
  }, z.core.$strict>;
213
229
  /**
@@ -289,21 +305,31 @@ export declare const DiscriminatingCondition: z.ZodObject<{
289
305
  "type-violating": "type-violating";
290
306
  }>;
291
307
  }, z.core.$strict>]>>>;
308
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
309
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
310
+ }, z.core.$strict>, z.ZodObject<{
311
+ matcher: z.ZodEnum<{
312
+ any: "any";
313
+ "type-violating": "type-violating";
314
+ }>;
315
+ }, z.core.$strict>]>>>;
292
316
  }, z.core.$strict>;
293
317
  }, z.core.$strict>;
294
318
  predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
295
319
  }, z.core.$strict>;
296
320
  /**
297
- * A signature against an interface that speaks HTTP. `web` and `mcp` share the
298
- * shape and are still rejected by the qualification gate, which is what keeps
299
- * `signature-interface-kind-unsupported` fireable on the kinds whose probe
300
- * semantics are undeclared.
321
+ * A signature declaring a method and a path template. `web` shares the shape
322
+ * and is still rejected by the qualification gate, which is what keeps
323
+ * `signature-interface-kind-unsupported` fireable on the one kind whose probe
324
+ * semantics stay undeclared.
301
325
  *
302
- * One branch over the three kinds rather than three identical branches. Three
303
- * would publish three byte-identical subschemas, and AD-13's mutation sweep
304
- * cannot attribute a keyword deletion to one of several identical branches:
305
- * deleting `pathTemplate`'s pattern from the second still leaves the first
306
- * accepting everything the corpus carries, so nothing flips.
326
+ * One branch over both kinds rather than two identical branches. Two would
327
+ * publish two byte-identical subschemas, and AD-13's mutation sweep cannot
328
+ * attribute a keyword deletion to one of several identical branches: deleting
329
+ * `pathTemplate`'s pattern from the second still leaves the first accepting
330
+ * everything the corpus carries, so nothing flips. That argument reaches only
331
+ * branches publishing the same keyword shape, which is why the tool-call branch
332
+ * below is its own.
307
333
  */
308
334
  export declare const ApiDefectSignature: z.ZodObject<{
309
335
  observableChannel: z.ZodEnum<{
@@ -383,13 +409,20 @@ export declare const ApiDefectSignature: z.ZodObject<{
383
409
  "type-violating": "type-violating";
384
410
  }>;
385
411
  }, z.core.$strict>]>>>;
412
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
413
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
414
+ }, z.core.$strict>, z.ZodObject<{
415
+ matcher: z.ZodEnum<{
416
+ any: "any";
417
+ "type-violating": "type-violating";
418
+ }>;
419
+ }, z.core.$strict>]>>>;
386
420
  }, z.core.$strict>;
387
421
  }, z.core.$strict>;
388
422
  predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
389
423
  }, z.core.$strict>;
390
424
  interfaceKind: z.ZodEnum<{
391
425
  api: "api";
392
- mcp: "mcp";
393
426
  web: "web";
394
427
  }>;
395
428
  method: z.ZodEnum<{
@@ -488,6 +521,14 @@ export declare const CommandDefectSignature: z.ZodObject<{
488
521
  "type-violating": "type-violating";
489
522
  }>;
490
523
  }, z.core.$strict>]>>>;
524
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
525
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
526
+ }, z.core.$strict>, z.ZodObject<{
527
+ matcher: z.ZodEnum<{
528
+ any: "any";
529
+ "type-violating": "type-violating";
530
+ }>;
531
+ }, z.core.$strict>]>>>;
491
532
  }, z.core.$strict>;
492
533
  }, z.core.$strict>;
493
534
  predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
@@ -498,10 +539,118 @@ export declare const CommandDefectSignature: z.ZodObject<{
498
539
  subcommandPath: z.ZodArray<z.ZodString>;
499
540
  }, z.core.$strict>;
500
541
  }, z.core.$strict>;
542
+ /**
543
+ * A signature against an MCP tool server. It declares the published tool name,
544
+ * for the reason AD-40 gives for the api-shaped pair: the identity has to be
545
+ * contract-independent so a signature authored against a corpus binds a second
546
+ * contract's operation. Every MCP call shares the one transport method
547
+ * `tools/call`, so the tool name is the whole of what tells two calls apart,
548
+ * and `McpOperation.toolName` is the field it resolves against.
549
+ *
550
+ * Its own branch, on the model `CommandDefectSignature` set. A tool call has no
551
+ * method and no path template, so while `mcp` sat on the api-shaped branch a
552
+ * signature declared a pair it could never mean and rendered an identity no
553
+ * operation matched. This branch publishes `toolName`'s pattern where that one
554
+ * publishes `method`'s enum and `pathTemplate`'s pattern, so a keyword deleted
555
+ * from either is attributable to it and a fixture can flip it.
556
+ */
557
+ export declare const McpDefectSignature: z.ZodObject<{
558
+ observableChannel: z.ZodEnum<{
559
+ artifact: "artifact";
560
+ "call-inputs": "call-inputs";
561
+ "exit-code": "exit-code";
562
+ "response-body": "response-body";
563
+ "response-headers": "response-headers";
564
+ "response-status": "response-status";
565
+ stderr: "stderr";
566
+ stdout: "stdout";
567
+ }>;
568
+ condition: z.ZodObject<{
569
+ selector: z.ZodObject<{
570
+ inputBinding: z.ZodObject<{
571
+ path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
572
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
573
+ }, z.core.$strict>, z.ZodObject<{
574
+ matcher: z.ZodEnum<{
575
+ any: "any";
576
+ "type-violating": "type-violating";
577
+ }>;
578
+ }, z.core.$strict>]>>>;
579
+ query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
580
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
581
+ }, z.core.$strict>, z.ZodObject<{
582
+ matcher: z.ZodEnum<{
583
+ any: "any";
584
+ "type-violating": "type-violating";
585
+ }>;
586
+ }, z.core.$strict>]>>>;
587
+ header: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
588
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
589
+ }, z.core.$strict>, z.ZodObject<{
590
+ matcher: z.ZodEnum<{
591
+ any: "any";
592
+ "type-violating": "type-violating";
593
+ }>;
594
+ }, z.core.$strict>]>>>;
595
+ body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
596
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
597
+ }, z.core.$strict>, z.ZodObject<{
598
+ matcher: z.ZodEnum<{
599
+ any: "any";
600
+ "type-violating": "type-violating";
601
+ }>;
602
+ }, z.core.$strict>]>>>;
603
+ argument: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
604
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
605
+ }, z.core.$strict>, z.ZodObject<{
606
+ matcher: z.ZodEnum<{
607
+ any: "any";
608
+ "type-violating": "type-violating";
609
+ }>;
610
+ }, z.core.$strict>]>>>;
611
+ option: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
612
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
613
+ }, z.core.$strict>, z.ZodObject<{
614
+ matcher: z.ZodEnum<{
615
+ any: "any";
616
+ "type-violating": "type-violating";
617
+ }>;
618
+ }, z.core.$strict>]>>>;
619
+ environment: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
620
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
621
+ }, z.core.$strict>, z.ZodObject<{
622
+ matcher: z.ZodEnum<{
623
+ any: "any";
624
+ "type-violating": "type-violating";
625
+ }>;
626
+ }, z.core.$strict>]>>>;
627
+ stdin: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
628
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
629
+ }, z.core.$strict>, z.ZodObject<{
630
+ matcher: z.ZodEnum<{
631
+ any: "any";
632
+ "type-violating": "type-violating";
633
+ }>;
634
+ }, z.core.$strict>]>>>;
635
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
636
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
637
+ }, z.core.$strict>, z.ZodObject<{
638
+ matcher: z.ZodEnum<{
639
+ any: "any";
640
+ "type-violating": "type-violating";
641
+ }>;
642
+ }, z.core.$strict>]>>>;
643
+ }, z.core.$strict>;
644
+ }, z.core.$strict>;
645
+ predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
646
+ }, z.core.$strict>;
647
+ interfaceKind: z.ZodLiteral<"mcp">;
648
+ toolName: z.ZodString;
649
+ }, z.core.$strict>;
501
650
  /**
502
651
  * A plain union rather than a discriminated one: the discriminator would have
503
- * to be `interfaceKind`, and the api-shaped branch carries three values for it.
504
- * The two branches are told apart by the identity they declare, exactly as
652
+ * to be `interfaceKind`, and the api-shaped branch carries two values for it.
653
+ * The three branches are told apart by the identity they declare, exactly as
505
654
  * `InputBinding`'s two are told apart by the channels they name.
506
655
  */
507
656
  export declare const DefectSignature: z.ZodUnion<readonly [z.ZodObject<{
@@ -582,13 +731,20 @@ export declare const DefectSignature: z.ZodUnion<readonly [z.ZodObject<{
582
731
  "type-violating": "type-violating";
583
732
  }>;
584
733
  }, z.core.$strict>]>>>;
734
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
735
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
736
+ }, z.core.$strict>, z.ZodObject<{
737
+ matcher: z.ZodEnum<{
738
+ any: "any";
739
+ "type-violating": "type-violating";
740
+ }>;
741
+ }, z.core.$strict>]>>>;
585
742
  }, z.core.$strict>;
586
743
  }, z.core.$strict>;
587
744
  predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
588
745
  }, z.core.$strict>;
589
746
  interfaceKind: z.ZodEnum<{
590
747
  api: "api";
591
- mcp: "mcp";
592
748
  web: "web";
593
749
  }>;
594
750
  method: z.ZodEnum<{
@@ -679,6 +835,14 @@ export declare const DefectSignature: z.ZodUnion<readonly [z.ZodObject<{
679
835
  "type-violating": "type-violating";
680
836
  }>;
681
837
  }, z.core.$strict>]>>>;
838
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
839
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
840
+ }, z.core.$strict>, z.ZodObject<{
841
+ matcher: z.ZodEnum<{
842
+ any: "any";
843
+ "type-violating": "type-violating";
844
+ }>;
845
+ }, z.core.$strict>]>>>;
682
846
  }, z.core.$strict>;
683
847
  }, z.core.$strict>;
684
848
  predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
@@ -688,8 +852,101 @@ export declare const DefectSignature: z.ZodUnion<readonly [z.ZodObject<{
688
852
  executable: z.ZodString;
689
853
  subcommandPath: z.ZodArray<z.ZodString>;
690
854
  }, z.core.$strict>;
855
+ }, z.core.$strict>, z.ZodObject<{
856
+ observableChannel: z.ZodEnum<{
857
+ artifact: "artifact";
858
+ "call-inputs": "call-inputs";
859
+ "exit-code": "exit-code";
860
+ "response-body": "response-body";
861
+ "response-headers": "response-headers";
862
+ "response-status": "response-status";
863
+ stderr: "stderr";
864
+ stdout: "stdout";
865
+ }>;
866
+ condition: z.ZodObject<{
867
+ selector: z.ZodObject<{
868
+ inputBinding: z.ZodObject<{
869
+ path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
870
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
871
+ }, z.core.$strict>, z.ZodObject<{
872
+ matcher: z.ZodEnum<{
873
+ any: "any";
874
+ "type-violating": "type-violating";
875
+ }>;
876
+ }, z.core.$strict>]>>>;
877
+ query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
878
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
879
+ }, z.core.$strict>, z.ZodObject<{
880
+ matcher: z.ZodEnum<{
881
+ any: "any";
882
+ "type-violating": "type-violating";
883
+ }>;
884
+ }, z.core.$strict>]>>>;
885
+ header: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
886
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
887
+ }, z.core.$strict>, z.ZodObject<{
888
+ matcher: z.ZodEnum<{
889
+ any: "any";
890
+ "type-violating": "type-violating";
891
+ }>;
892
+ }, z.core.$strict>]>>>;
893
+ body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
894
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
895
+ }, z.core.$strict>, z.ZodObject<{
896
+ matcher: z.ZodEnum<{
897
+ any: "any";
898
+ "type-violating": "type-violating";
899
+ }>;
900
+ }, z.core.$strict>]>>>;
901
+ argument: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
902
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
903
+ }, z.core.$strict>, z.ZodObject<{
904
+ matcher: z.ZodEnum<{
905
+ any: "any";
906
+ "type-violating": "type-violating";
907
+ }>;
908
+ }, z.core.$strict>]>>>;
909
+ option: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
910
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
911
+ }, z.core.$strict>, z.ZodObject<{
912
+ matcher: z.ZodEnum<{
913
+ any: "any";
914
+ "type-violating": "type-violating";
915
+ }>;
916
+ }, z.core.$strict>]>>>;
917
+ environment: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
918
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
919
+ }, z.core.$strict>, z.ZodObject<{
920
+ matcher: z.ZodEnum<{
921
+ any: "any";
922
+ "type-violating": "type-violating";
923
+ }>;
924
+ }, z.core.$strict>]>>>;
925
+ stdin: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
926
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
927
+ }, z.core.$strict>, z.ZodObject<{
928
+ matcher: z.ZodEnum<{
929
+ any: "any";
930
+ "type-violating": "type-violating";
931
+ }>;
932
+ }, z.core.$strict>]>>>;
933
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
934
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
935
+ }, z.core.$strict>, z.ZodObject<{
936
+ matcher: z.ZodEnum<{
937
+ any: "any";
938
+ "type-violating": "type-violating";
939
+ }>;
940
+ }, z.core.$strict>]>>>;
941
+ }, z.core.$strict>;
942
+ }, z.core.$strict>;
943
+ predicate: z.ZodType<Expression, unknown, z.core.$ZodTypeInternals<Expression, unknown>>;
944
+ }, z.core.$strict>;
945
+ interfaceKind: z.ZodLiteral<"mcp">;
946
+ toolName: z.ZodString;
691
947
  }, z.core.$strict>]>;
692
948
  export type ApiDefectSignature = z.infer<typeof ApiDefectSignature>;
693
949
  export type CommandDefectSignature = z.infer<typeof CommandDefectSignature>;
950
+ export type McpDefectSignature = z.infer<typeof McpDefectSignature>;
694
951
  export type DefectSignature = z.infer<typeof DefectSignature>;
695
952
  export type ProbeInputBinding = z.infer<typeof ProbeInputBinding>;
@@ -4,7 +4,7 @@ import { Expression } from './expression.js';
4
4
  import { CommandInvocation, HttpMethod, PathTemplate } from './interface.js';
5
5
  import { LiteralBindingValue, MatcherBindingValue } from './plan.js';
6
6
  import { EvidenceChannel } from './pointer.js';
7
- import { KeyName } from './primitives.js';
7
+ import { KeyName, ToolName } from './primitives.js';
8
8
  /**
9
9
  * The reserved step identifier every pointer in a discriminating condition is
10
10
  * rooted at. AD-40 requires the predicate to be rooted at the selected
@@ -50,9 +50,9 @@ export const PROBE_BINDING_CHANNEL_NON_EMPTY = 'probe-binding-channel-non-empty'
50
50
  //
51
51
  // Named, like `InputBindingChannel`, so the constraint ledger has one stable
52
52
  // address to inject `minProperties` at. Verified rather than assumed: leaving
53
- // it inlined at four addresses left the rejection Zod-only, and the
53
+ // it inlined at one address per channel left the rejection Zod-only, and the
54
54
  // published-schema differential caught the disagreement on a synthesised
55
- // witness carrying `{}` in three of the four channels.
55
+ // witness carrying `{}` in several of them.
56
56
  export const ProbeBindingChannel = z
57
57
  .record(KeyName, ProbeBindingValue)
58
58
  .refine((entries) => Object.keys(entries).length > 0, {
@@ -64,19 +64,20 @@ export const ProbeBindingChannel = z
64
64
  description: "A parameter-name-to-binding-value map for one input channel of a defect signature's selector, or `null` for a channel the selector binds nothing in. An empty map is rejected: `null` is the only spelling for unbound. Admits `{ literal }` and `{ matcher }` only; `{ captured }` and `{ principal }` are contract-local vocabulary and a corpus signature cannot carry either.",
65
65
  });
66
66
  /**
67
- * Every input channel of either kind, spelled exactly as `ObservedCallInputs`
68
- * spells them. The two shapes agree on channel names, on the eight-key strict
69
- * form, and on flatness, so the selector filters recorded call inputs with no
70
- * shape to bridge.
67
+ * Every input channel the pointer grammar admits, spelled exactly as
68
+ * `ObservedCallInputs` spells them. The two shapes agree on channel names, on
69
+ * the strict form, on width, and on flatness, so the selector filters recorded
70
+ * call inputs with no shape to bridge.
71
71
  *
72
- * One object over both kinds rather than a union, on `ObservedCallInputs`'s own
73
- * reasoning: `null` already means "binds nothing here", so a selector that
74
- * binds only command channels writes `null` in the transport four and nothing
75
- * is ambiguous. `InputBinding` on the contract side is a union instead, because
76
- * a request-shape channel's "declared, no keys" state is not the same as
77
- * unused and the two spellings had to stay apart.
72
+ * One object over all three kinds rather than a union, on
73
+ * `ObservedCallInputs`'s own reasoning: `null` already means "binds nothing
74
+ * here", so a selector that binds only command channels writes `null` in the
75
+ * transport four and nothing is ambiguous. `InputBinding` on the contract side
76
+ * is a union instead, because a request-shape channel's "declared, no keys"
77
+ * state differs from unused and the two spellings had to stay apart.
78
78
  */
79
- export const ProbeInputBinding = z.strictObject({
79
+ export const ProbeInputBinding = z
80
+ .strictObject({
80
81
  path: ProbeBindingChannel,
81
82
  query: ProbeBindingChannel,
82
83
  header: ProbeBindingChannel,
@@ -85,7 +86,9 @@ export const ProbeInputBinding = z.strictObject({
85
86
  option: ProbeBindingChannel,
86
87
  environment: ProbeBindingChannel,
87
88
  stdin: ProbeBindingChannel,
88
- });
89
+ arguments: ProbeBindingChannel,
90
+ })
91
+ .describe('The probe\'s `schemaVersion` 4 -> 5 BREAKING bump under AD-11, whose rule is that removing or retyping is breaking. Two retypings land under this one stamp and both are named here. This selector gained a ninth channel, `arguments`, so a signature against a tool call can filter on what the call supplied; the sealed run record\'s `ObservedCallInputs` gained the same key under its own breaking bump, since a selector naming a channel no observation records would filter against nothing. And `DefectSignature` gained an `McpDefectSignature` branch declaring a published tool name, while `ApiDefectSignature.interfaceKind` narrowed to `api` and `web`, so a version-4 probe carrying `interfaceKind: "mcp"` beside a method and a path template stops parsing. Version 4 took the witness leg shape and this stamp takes both changes above, so each retype stays independently releasable.');
89
92
  /**
90
93
  * AD-39's selector grammar, duplicated on the corpus side, minus the two
91
94
  * members a corpus cannot fill. The operation is the signature's own home
@@ -117,36 +120,40 @@ export const DiscriminatingCondition = z.strictObject({
117
120
  predicate: Expression.describe("An AD-4 expression over AD-26 response channels, every pointer rooted at the reserved step identifier `observed`. Legality is the corpus qualification gate's: an unchecked predicate admits `existence` over a literal, which is true of every observation and makes the catch rate 1.00 by construction."),
118
121
  });
119
122
  /**
120
- * AD-40's four declarations: the interface kind, the defect's home operation as
121
- * a method and a path template, the observable channel it manifests in, and the
122
- * discriminating condition that separates it from correct behaviour.
123
+ * Three of AD-40's four declarations, the three every branch shares: the
124
+ * observable channel the defect manifests in, the discriminating condition that
125
+ * separates it from correct behaviour, and the interface kind each branch
126
+ * spells as its own literal or enum. The fourth is the defect's home operation,
127
+ * which each branch declares in its own kind's transport identity.
123
128
  *
124
- * Method and path template rather than an operation identifier, because AD-19
125
- * declares both per operation and both are contract-independent: an identifier
126
- * is contract-local and would bind nothing against a second contract.
127
- * Resolution erases parameter names before comparing, so a signature on
128
- * `/notes/{id}` binds a contract declaring `/notes/{noteId}`; a post-erasure
129
- * collision inside one contract has already failed compilation under
130
- * `duplicate-operation-signature`.
129
+ * A declared transport identity rather than an operation identifier, because
130
+ * AD-19 declares one per operation and it is contract-independent: an
131
+ * identifier is contract-local and would bind nothing against a second
132
+ * contract. The api-shaped branch erases parameter names before comparing, so a
133
+ * signature on `/notes/{id}` binds a contract declaring `/notes/{noteId}`; a
134
+ * post-erasure collision inside one contract has already failed compilation
135
+ * under `duplicate-operation-signature`.
131
136
  */
132
137
  const signatureCommon = {
133
138
  observableChannel: EvidenceChannel.describe('AD-26\'s channel the seeded defect manifests in. The qualification gate reads it: a condition passes only if its pointers name this channel, or name two channels with at least one response-side member. That rule exists to reject a condition collapsing to "the evidence contains the string I sent", which is satisfied by a finding that merely echoes its own input. It must also be a channel the declared kind produces: an api interface writes nothing to standard output and a command returns no HTTP status.'),
134
139
  condition: DiscriminatingCondition,
135
140
  };
136
141
  /**
137
- * A signature against an interface that speaks HTTP. `web` and `mcp` share the
138
- * shape and are still rejected by the qualification gate, which is what keeps
139
- * `signature-interface-kind-unsupported` fireable on the kinds whose probe
140
- * semantics are undeclared.
142
+ * A signature declaring a method and a path template. `web` shares the shape
143
+ * and is still rejected by the qualification gate, which is what keeps
144
+ * `signature-interface-kind-unsupported` fireable on the one kind whose probe
145
+ * semantics stay undeclared.
141
146
  *
142
- * One branch over the three kinds rather than three identical branches. Three
143
- * would publish three byte-identical subschemas, and AD-13's mutation sweep
144
- * cannot attribute a keyword deletion to one of several identical branches:
145
- * deleting `pathTemplate`'s pattern from the second still leaves the first
146
- * accepting everything the corpus carries, so nothing flips.
147
+ * One branch over both kinds rather than two identical branches. Two would
148
+ * publish two byte-identical subschemas, and AD-13's mutation sweep cannot
149
+ * attribute a keyword deletion to one of several identical branches: deleting
150
+ * `pathTemplate`'s pattern from the second still leaves the first accepting
151
+ * everything the corpus carries, so nothing flips. That argument reaches only
152
+ * branches publishing the same keyword shape, which is why the tool-call branch
153
+ * below is its own.
147
154
  */
148
155
  export const ApiDefectSignature = z.strictObject({
149
- interfaceKind: z.enum(['api', 'web', 'mcp']),
156
+ interfaceKind: z.enum(['api', 'web']),
150
157
  method: HttpMethod,
151
158
  pathTemplate: PathTemplate,
152
159
  ...signatureCommon,
@@ -163,13 +170,34 @@ export const CommandDefectSignature = z.strictObject({
163
170
  invocation: CommandInvocation,
164
171
  ...signatureCommon,
165
172
  });
173
+ /**
174
+ * A signature against an MCP tool server. It declares the published tool name,
175
+ * for the reason AD-40 gives for the api-shaped pair: the identity has to be
176
+ * contract-independent so a signature authored against a corpus binds a second
177
+ * contract's operation. Every MCP call shares the one transport method
178
+ * `tools/call`, so the tool name is the whole of what tells two calls apart,
179
+ * and `McpOperation.toolName` is the field it resolves against.
180
+ *
181
+ * Its own branch, on the model `CommandDefectSignature` set. A tool call has no
182
+ * method and no path template, so while `mcp` sat on the api-shaped branch a
183
+ * signature declared a pair it could never mean and rendered an identity no
184
+ * operation matched. This branch publishes `toolName`'s pattern where that one
185
+ * publishes `method`'s enum and `pathTemplate`'s pattern, so a keyword deleted
186
+ * from either is attributable to it and a fixture can flip it.
187
+ */
188
+ export const McpDefectSignature = z.strictObject({
189
+ interfaceKind: z.literal('mcp'),
190
+ toolName: ToolName,
191
+ ...signatureCommon,
192
+ });
166
193
  /**
167
194
  * A plain union rather than a discriminated one: the discriminator would have
168
- * to be `interfaceKind`, and the api-shaped branch carries three values for it.
169
- * The two branches are told apart by the identity they declare, exactly as
195
+ * to be `interfaceKind`, and the api-shaped branch carries two values for it.
196
+ * The three branches are told apart by the identity they declare, exactly as
170
197
  * `InputBinding`'s two are told apart by the channels they name.
171
198
  */
172
199
  export const DefectSignature = z.union([
173
200
  ApiDefectSignature,
174
201
  CommandDefectSignature,
202
+ McpDefectSignature,
175
203
  ]);