eval-quality 1.4.2 → 3.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 (110) hide show
  1. package/README.md +6 -6
  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/compile.js +6 -1
  43. package/dist/core/compile/interface-inventory.d.ts +81 -3
  44. package/dist/core/compile/interface-inventory.js +134 -23
  45. package/dist/core/compile/reachability.d.ts +73 -1
  46. package/dist/core/compile/reachability.js +134 -19
  47. package/dist/core/compile/schema-version.d.ts +15 -2
  48. package/dist/core/compile/schema-version.js +11 -3
  49. package/dist/core/compile/sensitivity-witness.d.ts +22 -10
  50. package/dist/core/compile/sensitivity-witness.js +101 -13
  51. package/dist/core/coverage/operations.d.ts +1 -1
  52. package/dist/core/coverage/operations.js +1 -1
  53. package/dist/core/coverage/relevance.d.ts +3 -3
  54. package/dist/core/coverage/relevance.js +3 -3
  55. package/dist/core/declared-inputs.d.ts +21 -9
  56. package/dist/core/declared-inputs.js +51 -16
  57. package/dist/core/evaluate/evidence-resolution.d.ts +8 -7
  58. package/dist/core/evaluate/evidence-resolution.js +25 -18
  59. package/dist/core/preflight/plan.js +43 -6
  60. package/dist/core/preflight/projection.d.ts +10 -1
  61. package/dist/core/preflight/projection.js +9 -5
  62. package/dist/core/preflight/reduce.js +6 -2
  63. package/dist/core/preflight/witness-evidence.js +31 -9
  64. package/dist/core/schemas/artifact.d.ts +145 -49
  65. package/dist/core/schemas/defect-signature.d.ts +280 -23
  66. package/dist/core/schemas/defect-signature.js +65 -37
  67. package/dist/core/schemas/eval-contract.d.ts +33 -48
  68. package/dist/core/schemas/eval-contract.js +3 -3
  69. package/dist/core/schemas/interface.d.ts +193 -55
  70. package/dist/core/schemas/interface.js +82 -15
  71. package/dist/core/schemas/plan.d.ts +45 -1
  72. package/dist/core/schemas/plan.js +13 -2
  73. package/dist/core/schemas/pointer.d.ts +23 -9
  74. package/dist/core/schemas/pointer.js +25 -11
  75. package/dist/core/schemas/port-messages.d.ts +81 -0
  76. package/dist/core/schemas/port-messages.js +50 -3
  77. package/dist/core/schemas/primitives.d.ts +18 -0
  78. package/dist/core/schemas/primitives.js +29 -0
  79. package/dist/core/schemas/probe-policy.d.ts +41 -0
  80. package/dist/core/schemas/probe-policy.js +61 -1
  81. package/dist/core/schemas/probe.d.ts +156 -2
  82. package/dist/core/schemas/probe.js +45 -2
  83. package/dist/core/schemas/sealed-run-record.d.ts +11 -5
  84. package/dist/core/schemas/sealed-run-record.js +21 -9
  85. package/dist/core/schemas/sensitivity-witness.d.ts +31 -7
  86. package/dist/core/schemas/sensitivity-witness.js +32 -9
  87. package/dist/core/score/bindings.d.ts +1 -1
  88. package/dist/core/score/bindings.js +4 -4
  89. package/dist/core/score/qualification.d.ts +7 -5
  90. package/dist/core/score/qualification.js +92 -23
  91. package/dist/core/score/score.d.ts +1 -1
  92. package/dist/core/score/score.js +24 -1
  93. package/dist/core/seal/derived-reference.js +20 -17
  94. package/dist/core/seal/plan-index.d.ts +18 -9
  95. package/dist/core/seal/plan-index.js +79 -37
  96. package/dist/index.d.ts +1 -1
  97. package/dist/index.js +1 -1
  98. package/dist/ports/environment-probe-port.d.ts +50 -17
  99. package/dist/ports/environment-probe-port.js +26 -17
  100. package/dist/testing/conformance.d.ts +3 -2
  101. package/dist/testing/conformance.js +2 -1
  102. package/dist/testing/index.d.ts +3 -3
  103. package/dist/testing/index.js +1 -1
  104. package/dist/testing/probe-conformance.d.ts +90 -13
  105. package/dist/testing/probe-conformance.js +375 -160
  106. package/package.json +4 -2
  107. package/schemas/eval-contract.schema.json +571 -18
  108. package/schemas/probe.schema.json +152 -12
  109. package/schemas/rubric.schema.json +1 -1
  110. package/schemas/sealed-run-record.schema.json +24 -17
@@ -8,11 +8,14 @@
8
8
  * the operation and the witness themselves: there is nothing to look an
9
9
  * identifier up in at reduce time.
10
10
  */
11
- import { checkInputsAgainstShape, isApiWitnessInputs, } from '../compile/sensitivity-witness.js';
12
- import { declaresNoRequiredKeys, isCommandOperation, } from '../declared-inputs.js';
11
+ import { isSupportedInterfaceKind, SUPPORTED_KINDS_CLAUSE, } from '../compile/interface-inventory.js';
12
+ import { checkSchemaVersion } from '../compile/schema-version.js';
13
+ import { checkInputsAgainstShape, isApiWitnessInputs, isMcpWitnessInputs, } from '../compile/sensitivity-witness.js';
14
+ import { declaresNoRequiredKeys, isCommandOperation, isMcpOperation, } from '../declared-inputs.js';
13
15
  import { referenceSetKeysOf } from '../evaluate/evidence-resolution.js';
14
16
  import { StructuralFailure } from '../failure-codes.js';
15
17
  import { operationsOf } from '../schemas/interface.js';
18
+ import { PROBE_SCHEMA_VERSION, PROBE_SCHEMA_VERSION_CONSEQUENCE, } from '../schemas/probe.js';
16
19
  import { referenceSetMembers } from './witness-evidence.js';
17
20
  const requestOf = (legId, interfaceId, operation, inputs) => {
18
21
  // NFR9's correlation by identifier: the port echoes these back, and they
@@ -22,6 +25,21 @@ const requestOf = (legId, interfaceId, operation, inputs) => {
22
25
  interfaceId,
23
26
  operationId: operation.operationId,
24
27
  };
28
+ const operationPath = `EvalContract.permittedInterfaces[logicalId=${interfaceId}].operations[operationId=${operation.operationId}]`;
29
+ if (isMcpOperation(operation)) {
30
+ if (!isMcpWitnessInputs(inputs)) {
31
+ throw new StructuralFailure('undeclared-mandatory-input', operationPath, `leg "${legId}" supplies channels a tool call does not carry (AD-10, AD-19)`);
32
+ }
33
+ return {
34
+ ...correlation,
35
+ kind: 'mcp',
36
+ toolName: operation.toolName,
37
+ channels: { arguments: inputs.arguments },
38
+ };
39
+ }
40
+ if (isMcpWitnessInputs(inputs)) {
41
+ throw new StructuralFailure('undeclared-mandatory-input', operationPath, `leg "${legId}" supplies a tool call's arguments to an operation that is not a tool call (AD-10, AD-19)`);
42
+ }
25
43
  if (isCommandOperation(operation)) {
26
44
  if (isApiWitnessInputs(inputs)) {
27
45
  throw new StructuralFailure('undeclared-mandatory-input', `EvalContract.permittedInterfaces[logicalId=${interfaceId}].operations[operationId=${operation.operationId}]`, `leg "${legId}" supplies transport channels to an operation that runs behind a command (AD-10, AD-19)`);
@@ -104,6 +122,7 @@ const EMPTY_INPUTS = {
104
122
  header: {},
105
123
  body: { kind: 'absent' },
106
124
  };
125
+ const EMPTY_MCP_INPUTS = { arguments: {} };
107
126
  /**
108
127
  * The inputs a control leg sends. A witness supplies them when the operation has
109
128
  * one; an operation AD-10 exempts has no required key to fill, so empty inputs
@@ -124,7 +143,11 @@ const controlInputs = (operation) => {
124
143
  // port sends what the operation's own channels name.
125
144
  if (!declaresNoRequiredKeys(operation))
126
145
  return null;
127
- return isCommandOperation(operation) ? EMPTY_COMMAND_INPUTS : EMPTY_INPUTS;
146
+ if (isCommandOperation(operation))
147
+ return EMPTY_COMMAND_INPUTS;
148
+ if (isMcpOperation(operation))
149
+ return EMPTY_MCP_INPUTS;
150
+ return EMPTY_INPUTS;
128
151
  };
129
152
  const targetOf = (iface, operation) => {
130
153
  const inputs = controlInputs(operation);
@@ -181,11 +204,25 @@ const selectControl = (contract, permittedInterfaces) => {
181
204
  */
182
205
  export const planPreflight = (input) => {
183
206
  const { contract, probes, runId } = input;
207
+ // First, and before any check reads a probe. AD-11 makes an unequal stamp a
208
+ // rejection rather than a degraded read, and every rule below is written
209
+ // against this version's field shapes. `compile` performs the same check for
210
+ // the contract; this is the probe's reader, since a probe reaches no other
211
+ // core stage on the pre-flight path.
212
+ for (const probe of probes) {
213
+ checkSchemaVersion({
214
+ stamped: probe.schemaVersion,
215
+ accepted: PROBE_SCHEMA_VERSION,
216
+ artifactPath: `Probe[probeId=${probe.probeId}].schemaVersion`,
217
+ consequence: PROBE_SCHEMA_VERSION_CONSEQUENCE,
218
+ });
219
+ }
184
220
  for (const iface of contract.permittedInterfaces) {
185
221
  // Already thrown at compile; asserted again because the plan is
186
- // reachable from a caller who assembled a contract by hand.
187
- if (iface.kind !== 'api' && iface.kind !== 'cli') {
188
- throw new StructuralFailure('unsupported-interface-kind', `EvalContract.permittedInterfaces[logicalId=${iface.logicalId}].kind`, `"${iface.kind}" is not supported; "api" and "cli" are (AD-10)`);
222
+ // reachable from a caller who assembled a contract by hand. Reads the
223
+ // compile gate's own tuple, so opening a kind moves one literal.
224
+ if (!isSupportedInterfaceKind(iface.kind)) {
225
+ throw new StructuralFailure('unsupported-interface-kind', `EvalContract.permittedInterfaces[logicalId=${iface.logicalId}].kind`, `"${iface.kind}" is not supported; ${SUPPORTED_KINDS_CLAUSE} (AD-10)`);
189
226
  }
190
227
  }
191
228
  const permittedInterfaces = contract.permittedInterfaces;
@@ -2,7 +2,7 @@ import type { AnyOperation } from '../schemas/interface.ts';
2
2
  import type { ProbeObservation, ProbeObservedBody } from '../schemas/port-messages.ts';
3
3
  export declare const PREFLIGHT_ARTIFACT_PATH = "PreflightVerdict";
4
4
  /**
5
- * The five fields and no others. Response headers are outside the projection
5
+ * The closed projection, and nothing outside it. Response headers are outside
6
6
  * because `volatilePointers` is a `DescriptorPointer` and the response
7
7
  * descriptor is body-scoped, so no declaration can mark a header volatile, and
8
8
  * unprunable headers would fail the repeated-read immutability branch on any
@@ -12,6 +12,13 @@ export declare const PREFLIGHT_ARTIFACT_PATH = "PreflightVerdict";
12
12
  * header digest identically, and a witness relation can read a header this
13
13
  * projection cannot see. The projection says what the fixture is; a relation
14
14
  * addressing a header is the author asserting that header is stable.
15
+ *
16
+ * `status`, `exitCode` and `toolError` are one family, one per kind, each
17
+ * `null` off its own kind. All three answer whether the call went through, and
18
+ * the projection's test for membership is whether a declaration can prune the
19
+ * field: none of the three can be. A projection blind to the tool error flag
20
+ * would digest two legs identical when one errored and one did not, which is
21
+ * the state-reset check reporting a reset that never happened.
15
22
  */
16
23
  export type ProjectedObservation = {
17
24
  readonly legId: string;
@@ -21,6 +28,8 @@ export type ProjectedObservation = {
21
28
  readonly status: number | null;
22
29
  /** the process exit code, or `null` on an interface that does. */
23
30
  readonly exitCode: number | null;
31
+ /** the tool call's error flag, or `null` off an interface that calls one. */
32
+ readonly toolError: boolean | null;
24
33
  readonly body: ProbeObservedBody;
25
34
  };
26
35
  /**
@@ -74,18 +74,22 @@ export function projectObservation(observation, operation, artifactPath) {
74
74
  // The channel the operation's descriptor describes is the one AD-10's
75
75
  // relation reads, so it is the one the volatile pointers are pruned from.
76
76
  // Off an interface that speaks HTTP that is the response body; off a
77
- // command it is the stream or the file the operation nominates.
77
+ // command it is the stream or the file the operation nominates; off a tool
78
+ // call it is the structured result, which is the kind's only body channel.
78
79
  const observed = observation.kind === 'api'
79
80
  ? observation.body
80
- : describedChannelOf(observation, operation);
81
+ : observation.kind === 'mcp'
82
+ ? observation.result
83
+ : describedChannelOf(observation, operation);
81
84
  return {
82
85
  legId: observation.probeId,
83
86
  interfaceId: observation.interfaceId,
84
87
  operationId: observation.operationId,
85
- // A command has no transport status. `null` is what a reader of this
86
- // field asks about, and every such reader already handles it.
88
+ // Each of the three reads `null` off its own kind. Every reader of these
89
+ // fields already asks about `null`.
87
90
  status: observation.kind === 'api' ? observation.status : null,
88
- exitCode: observation.kind === 'api' ? null : observation.exitCode,
91
+ exitCode: observation.kind === 'cli' ? observation.exitCode : null,
92
+ toolError: observation.kind === 'mcp' ? observation.isError : null,
89
93
  body: pruneVolatile(observed, operation.volatilePointers, artifactPath),
90
94
  };
91
95
  }
@@ -22,8 +22,9 @@ const ANOMALOUS_STATUS = 400;
22
22
  /**
23
23
  * What makes a control leg anomalous, in the vocabulary of the kind it ran
24
24
  * against, or `null` when nothing does. A command's analogue of a 4xx is a
25
- * non-zero exit: both are the system saying the call did not go through, and
26
- * AD-10's clean-control check is about exactly that.
25
+ * non-zero exit and a tool call's is the envelope's error flag: all three are
26
+ * the system saying the call did not go through, and AD-10's clean-control
27
+ * check is about exactly that.
27
28
  */
28
29
  function anomalyOf(observation) {
29
30
  if (observation.kind === 'api') {
@@ -31,6 +32,9 @@ function anomalyOf(observation) {
31
32
  ? `status ${observation.status}`
32
33
  : null;
33
34
  }
35
+ if (observation.kind === 'mcp') {
36
+ return observation.isError ? 'a reported tool error' : null;
37
+ }
34
38
  return observation.exitCode === 0 ? null : `exit code ${observation.exitCode}`;
35
39
  }
36
40
  /**
@@ -4,6 +4,7 @@
4
4
  * unchanged. This module supplies the `Observation` shape they read and a
5
5
  * collection predicate scoped to one operation.
6
6
  */
7
+ import { isMcpWitnessInputs } from '../compile/sensitivity-witness.js';
7
8
  import { descriptorArtifactOf, descriptorChannelOf, } from '../declared-inputs.js';
8
9
  import { makeResolveOperand } from '../evaluate/evidence-resolution.js';
9
10
  import { resolveCheck, } from '../evaluate/resolution.js';
@@ -40,6 +41,7 @@ const callInputsOf = (inputs) => {
40
41
  option: null,
41
42
  environment: null,
42
43
  stdin: null,
44
+ arguments: null,
43
45
  };
44
46
  if ('body' in inputs) {
45
47
  return {
@@ -50,6 +52,13 @@ const callInputsOf = (inputs) => {
50
52
  body: inputs.body.kind === 'json' ? asJsonObject(inputs.body.value) : null,
51
53
  };
52
54
  }
55
+ // A tool call supplies one channel, so `arguments` carries the whole of what
56
+ // the leg sent and the other eight read `null`. That is the channel
57
+ // `checkExpressionLegChannel` admits `call-inputs` against for an mcp
58
+ // operation, so a relation over `/interactions/{legId}/call-inputs/arguments`
59
+ // resolves what the leg supplied.
60
+ if (isMcpWitnessInputs(inputs))
61
+ return { ...empty, arguments: inputs.arguments };
53
62
  return {
54
63
  ...empty,
55
64
  argument: inputs.argument,
@@ -89,20 +98,33 @@ export function evidenceOf(projected, observation, inputs, operation) {
89
98
  callInputs: callInputsOf(inputs),
90
99
  // The projected body is whichever channel the operation's descriptor
91
100
  // describes, so it lands on the channel a relation addresses. Both are
92
- // filled from the same projection rather than one being derived from
93
- // the other, and every channel the leg did not observe is written down
94
- // as unobserved rather than left to a default.
95
- responseBody: observation.kind === 'api' ? bodyValue(body) : null,
101
+ // filled from the same projection, and every channel the leg did not
102
+ // observe is written down here as unobserved. A tool call's structured
103
+ // result is a response body and lands where an api body does; the
104
+ // command streams are the one projected body that goes elsewhere.
105
+ responseBody: observation.kind === 'cli' ? null : bodyValue(body),
96
106
  responseHeaders: observation.kind === 'api' ? observation.headers : null,
97
- responseStatus: observation.kind === 'api' ? observation.status : null,
98
- stdout: observation.kind === 'api' || descriptorChannel !== 'stdout'
107
+ // A tool call has no transport status, so the channel AD-26 fixed as a
108
+ // number carries the envelope's error flag instead: 1 when the tool
109
+ // reported an error and 0 when it did not. The projection is spelled
110
+ // here because a 0 in a field typed `number | null` is otherwise
111
+ // indistinguishable from a transport status of zero, and an oracle
112
+ // asserting that a tool reported no error reads this value.
113
+ responseStatus: observation.kind === 'api'
114
+ ? observation.status
115
+ : observation.kind === 'mcp'
116
+ ? observation.isError
117
+ ? 1
118
+ : 0
119
+ : null,
120
+ stdout: observation.kind !== 'cli' || descriptorChannel !== 'stdout'
99
121
  ? ABSENT_CHANNEL
100
122
  : body,
101
- stderr: observation.kind === 'api' || descriptorChannel !== 'stderr'
123
+ stderr: observation.kind !== 'cli' || descriptorChannel !== 'stderr'
102
124
  ? ABSENT_CHANNEL
103
125
  : body,
104
- exitCode: observation.kind === 'api' ? null : observation.exitCode,
105
- artifacts: observation.kind === 'api' || describedArtifact === null
126
+ exitCode: observation.kind === 'cli' ? observation.exitCode : null,
127
+ artifacts: observation.kind !== 'cli' || describedArtifact === null
106
128
  ? {}
107
129
  : { [describedArtifact]: body },
108
130
  };
@@ -209,6 +209,7 @@ export declare const INTERCHANGE_ARTIFACTS: {
209
209
  witnessId: z.ZodString;
210
210
  channel: z.ZodEnum<{
211
211
  argument: "argument";
212
+ arguments: "arguments";
212
213
  body: "body";
213
214
  environment: "environment";
214
215
  option: "option";
@@ -241,6 +242,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
241
242
  }, z.core.$strict>, z.ZodObject<{
242
243
  kind: z.ZodLiteral<"absent">;
243
244
  }, z.core.$strict>], "kind">;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
244
247
  }, z.core.$strict>]>;
245
248
  }, z.core.$strict>>;
246
249
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
@@ -350,6 +353,7 @@ export declare const INTERCHANGE_ARTIFACTS: {
350
353
  witnessId: z.ZodString;
351
354
  channel: z.ZodEnum<{
352
355
  argument: "argument";
356
+ arguments: "arguments";
353
357
  body: "body";
354
358
  environment: "environment";
355
359
  option: "option";
@@ -382,6 +386,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
382
386
  }, z.core.$strict>, z.ZodObject<{
383
387
  kind: z.ZodLiteral<"absent">;
384
388
  }, z.core.$strict>], "kind">;
389
+ }, z.core.$strict>, z.ZodObject<{
390
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
385
391
  }, z.core.$strict>]>;
386
392
  }, z.core.$strict>>;
387
393
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
@@ -392,55 +398,10 @@ export declare const INTERCHANGE_ARTIFACTS: {
392
398
  kind: z.ZodLiteral<"mcp">;
393
399
  operations: z.ZodArray<z.ZodObject<{
394
400
  operationId: z.ZodString;
395
- method: z.ZodEnum<{
396
- DELETE: "DELETE";
397
- GET: "GET";
398
- HEAD: "HEAD";
399
- OPTIONS: "OPTIONS";
400
- PATCH: "PATCH";
401
- POST: "POST";
402
- PUT: "PUT";
403
- }>;
404
- pathTemplate: z.ZodString;
401
+ toolName: z.ZodString;
405
402
  stateChangeMarker: z.ZodBoolean;
406
403
  requestShape: z.ZodObject<{
407
- path: z.ZodObject<{
408
- requiredKeys: z.ZodArray<z.ZodString>;
409
- permittedKeys: z.ZodArray<z.ZodString>;
410
- types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
411
- array: "array";
412
- boolean: "boolean";
413
- null: "null";
414
- number: "number";
415
- object: "object";
416
- string: "string";
417
- }>>>;
418
- }, z.core.$strict>;
419
- query: z.ZodObject<{
420
- requiredKeys: z.ZodArray<z.ZodString>;
421
- permittedKeys: z.ZodArray<z.ZodString>;
422
- types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
423
- array: "array";
424
- boolean: "boolean";
425
- null: "null";
426
- number: "number";
427
- object: "object";
428
- string: "string";
429
- }>>>;
430
- }, z.core.$strict>;
431
- header: z.ZodObject<{
432
- requiredKeys: z.ZodArray<z.ZodString>;
433
- permittedKeys: z.ZodArray<z.ZodString>;
434
- types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
435
- array: "array";
436
- boolean: "boolean";
437
- null: "null";
438
- number: "number";
439
- object: "object";
440
- string: "string";
441
- }>>>;
442
- }, z.core.$strict>;
443
- body: z.ZodObject<{
404
+ arguments: z.ZodObject<{
444
405
  requiredKeys: z.ZodArray<z.ZodString>;
445
406
  permittedKeys: z.ZodArray<z.ZodString>;
446
407
  types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
@@ -453,6 +414,9 @@ export declare const INTERCHANGE_ARTIFACTS: {
453
414
  }>>>;
454
415
  }, z.core.$strict>;
455
416
  }, z.core.$strict>;
417
+ descriptorChannel: z.ZodDiscriminatedUnion<[z.ZodObject<{
418
+ kind: z.ZodLiteral<"structured-result">;
419
+ }, z.core.$strict>], "kind">;
456
420
  responseDescriptor: z.ZodObject<{
457
421
  requiredKeys: z.ZodArray<z.ZodString>;
458
422
  permittedKeys: z.ZodArray<z.ZodString>;
@@ -491,6 +455,7 @@ export declare const INTERCHANGE_ARTIFACTS: {
491
455
  witnessId: z.ZodString;
492
456
  channel: z.ZodEnum<{
493
457
  argument: "argument";
458
+ arguments: "arguments";
494
459
  body: "body";
495
460
  environment: "environment";
496
461
  option: "option";
@@ -523,6 +488,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
523
488
  }, z.core.$strict>, z.ZodObject<{
524
489
  kind: z.ZodLiteral<"absent">;
525
490
  }, z.core.$strict>], "kind">;
491
+ }, z.core.$strict>, z.ZodObject<{
492
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
526
493
  }, z.core.$strict>]>;
527
494
  }, z.core.$strict>>;
528
495
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
@@ -637,6 +604,7 @@ export declare const INTERCHANGE_ARTIFACTS: {
637
604
  witnessId: z.ZodString;
638
605
  channel: z.ZodEnum<{
639
606
  argument: "argument";
607
+ arguments: "arguments";
640
608
  body: "body";
641
609
  environment: "environment";
642
610
  option: "option";
@@ -669,6 +637,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
669
637
  }, z.core.$strict>, z.ZodObject<{
670
638
  kind: z.ZodLiteral<"absent">;
671
639
  }, z.core.$strict>], "kind">;
640
+ }, z.core.$strict>, z.ZodObject<{
641
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
672
642
  }, z.core.$strict>]>;
673
643
  }, z.core.$strict>>;
674
644
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
@@ -785,6 +755,19 @@ export declare const INTERCHANGE_ARTIFACTS: {
785
755
  }, z.core.$strict>, z.ZodObject<{
786
756
  principal: z.ZodString;
787
757
  }, z.core.$strict>]>>>;
758
+ }, z.core.$strict>, z.ZodObject<{
759
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
760
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
761
+ }, z.core.$strict>, z.ZodObject<{
762
+ matcher: z.ZodEnum<{
763
+ any: "any";
764
+ "type-violating": "type-violating";
765
+ }>;
766
+ }, z.core.$strict>, z.ZodObject<{
767
+ captured: z.ZodString;
768
+ }, z.core.$strict>, z.ZodObject<{
769
+ principal: z.ZodString;
770
+ }, z.core.$strict>]>>>;
788
771
  }, z.core.$strict>]>;
789
772
  after: z.ZodNullable<z.ZodString>;
790
773
  cardinality: z.ZodEnum<{
@@ -851,6 +834,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
851
834
  }, z.core.$strict>, z.ZodObject<{
852
835
  kind: z.ZodLiteral<"absent">;
853
836
  }, z.core.$strict>], "kind">;
837
+ }, z.core.$strict>, z.ZodObject<{
838
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
854
839
  }, z.core.$strict>]>;
855
840
  }, z.core.$strict>>;
856
841
  }, z.core.$strict>;
@@ -1076,6 +1061,7 @@ export declare const INTERCHANGE_ARTIFACTS: {
1076
1061
  option: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
1077
1062
  environment: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
1078
1063
  stdin: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
1064
+ arguments: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
1079
1065
  }, z.core.$strict>;
1080
1066
  responseBody: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>>;
1081
1067
  responseHeaders: z.ZodNullable<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
@@ -1148,7 +1134,6 @@ export declare const INTERCHANGE_ARTIFACTS: {
1148
1134
  truncationBound: z.ZodNullable<z.ZodInt>;
1149
1135
  reportedIncomplete: z.ZodBoolean;
1150
1136
  }, z.core.$strict>;
1151
- invalidReason: z.ZodNullable<z.ZodString>;
1152
1137
  }, z.core.$strict>;
1153
1138
  readonly priorArt: 'h0-run-result';
1154
1139
  readonly carriesLineage: true;
@@ -1440,6 +1425,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
1440
1425
  }, z.core.$strict>, z.ZodObject<{
1441
1426
  kind: z.ZodLiteral<"absent">;
1442
1427
  }, z.core.$strict>], "kind">;
1428
+ }, z.core.$strict>, z.ZodObject<{
1429
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
1443
1430
  }, z.core.$strict>]>;
1444
1431
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
1445
1432
  }, z.core.$strict>>;
@@ -1636,6 +1623,8 @@ export declare const INTERCHANGE_ARTIFACTS: {
1636
1623
  }, z.core.$strict>, z.ZodObject<{
1637
1624
  kind: z.ZodLiteral<"absent">;
1638
1625
  }, z.core.$strict>], "kind">;
1626
+ }, z.core.$strict>, z.ZodObject<{
1627
+ arguments: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
1639
1628
  }, z.core.$strict>]>;
1640
1629
  relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
1641
1630
  }, z.core.$strict>>;
@@ -1718,13 +1707,20 @@ export declare const INTERCHANGE_ARTIFACTS: {
1718
1707
  "type-violating": "type-violating";
1719
1708
  }>;
1720
1709
  }, z.core.$strict>]>>>;
1710
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1711
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1712
+ }, z.core.$strict>, z.ZodObject<{
1713
+ matcher: z.ZodEnum<{
1714
+ any: "any";
1715
+ "type-violating": "type-violating";
1716
+ }>;
1717
+ }, z.core.$strict>]>>>;
1721
1718
  }, z.core.$strict>;
1722
1719
  }, z.core.$strict>;
1723
1720
  predicate: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
1724
1721
  }, z.core.$strict>;
1725
1722
  interfaceKind: z.ZodEnum<{
1726
1723
  api: "api";
1727
- mcp: "mcp";
1728
1724
  web: "web";
1729
1725
  }>;
1730
1726
  method: z.ZodEnum<{
@@ -1815,6 +1811,14 @@ export declare const INTERCHANGE_ARTIFACTS: {
1815
1811
  "type-violating": "type-violating";
1816
1812
  }>;
1817
1813
  }, z.core.$strict>]>>>;
1814
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1815
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1816
+ }, z.core.$strict>, z.ZodObject<{
1817
+ matcher: z.ZodEnum<{
1818
+ any: "any";
1819
+ "type-violating": "type-violating";
1820
+ }>;
1821
+ }, z.core.$strict>]>>>;
1818
1822
  }, z.core.$strict>;
1819
1823
  }, z.core.$strict>;
1820
1824
  predicate: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
@@ -1824,6 +1828,98 @@ export declare const INTERCHANGE_ARTIFACTS: {
1824
1828
  executable: z.ZodString;
1825
1829
  subcommandPath: z.ZodArray<z.ZodString>;
1826
1830
  }, z.core.$strict>;
1831
+ }, z.core.$strict>, z.ZodObject<{
1832
+ observableChannel: z.ZodEnum<{
1833
+ artifact: "artifact";
1834
+ "call-inputs": "call-inputs";
1835
+ "exit-code": "exit-code";
1836
+ "response-body": "response-body";
1837
+ "response-headers": "response-headers";
1838
+ "response-status": "response-status";
1839
+ stderr: "stderr";
1840
+ stdout: "stdout";
1841
+ }>;
1842
+ condition: z.ZodObject<{
1843
+ selector: z.ZodObject<{
1844
+ inputBinding: z.ZodObject<{
1845
+ path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1846
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1847
+ }, z.core.$strict>, z.ZodObject<{
1848
+ matcher: z.ZodEnum<{
1849
+ any: "any";
1850
+ "type-violating": "type-violating";
1851
+ }>;
1852
+ }, z.core.$strict>]>>>;
1853
+ query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1854
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1855
+ }, z.core.$strict>, z.ZodObject<{
1856
+ matcher: z.ZodEnum<{
1857
+ any: "any";
1858
+ "type-violating": "type-violating";
1859
+ }>;
1860
+ }, z.core.$strict>]>>>;
1861
+ header: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1862
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1863
+ }, z.core.$strict>, z.ZodObject<{
1864
+ matcher: z.ZodEnum<{
1865
+ any: "any";
1866
+ "type-violating": "type-violating";
1867
+ }>;
1868
+ }, z.core.$strict>]>>>;
1869
+ body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1870
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1871
+ }, z.core.$strict>, z.ZodObject<{
1872
+ matcher: z.ZodEnum<{
1873
+ any: "any";
1874
+ "type-violating": "type-violating";
1875
+ }>;
1876
+ }, z.core.$strict>]>>>;
1877
+ argument: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1878
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1879
+ }, z.core.$strict>, z.ZodObject<{
1880
+ matcher: z.ZodEnum<{
1881
+ any: "any";
1882
+ "type-violating": "type-violating";
1883
+ }>;
1884
+ }, z.core.$strict>]>>>;
1885
+ option: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1886
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1887
+ }, z.core.$strict>, z.ZodObject<{
1888
+ matcher: z.ZodEnum<{
1889
+ any: "any";
1890
+ "type-violating": "type-violating";
1891
+ }>;
1892
+ }, z.core.$strict>]>>>;
1893
+ environment: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1894
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1895
+ }, z.core.$strict>, z.ZodObject<{
1896
+ matcher: z.ZodEnum<{
1897
+ any: "any";
1898
+ "type-violating": "type-violating";
1899
+ }>;
1900
+ }, z.core.$strict>]>>>;
1901
+ stdin: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1902
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1903
+ }, z.core.$strict>, z.ZodObject<{
1904
+ matcher: z.ZodEnum<{
1905
+ any: "any";
1906
+ "type-violating": "type-violating";
1907
+ }>;
1908
+ }, z.core.$strict>]>>>;
1909
+ arguments: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1910
+ literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
1911
+ }, z.core.$strict>, z.ZodObject<{
1912
+ matcher: z.ZodEnum<{
1913
+ any: "any";
1914
+ "type-violating": "type-violating";
1915
+ }>;
1916
+ }, z.core.$strict>]>>>;
1917
+ }, z.core.$strict>;
1918
+ }, z.core.$strict>;
1919
+ predicate: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
1920
+ }, z.core.$strict>;
1921
+ interfaceKind: z.ZodLiteral<"mcp">;
1922
+ toolName: z.ZodString;
1827
1923
  }, z.core.$strict>]>>;
1828
1924
  }, z.core.$strict>], "expectedClean">;
1829
1925
  readonly priorArt: 'h0-ground-truth';