@exaudeus/workrail 3.17.0 → 3.18.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.
@@ -1368,7 +1368,7 @@ export declare const V2BindingDriftWarningSchema: z.ZodObject<{
1368
1368
  currentValue: string;
1369
1369
  }>;
1370
1370
  export declare const V2StepContextSchema: z.ZodObject<{
1371
- assessments: z.ZodOptional<z.ZodObject<{
1371
+ assessments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1372
1372
  assessmentId: z.ZodString;
1373
1373
  dimensions: z.ZodArray<z.ZodObject<{
1374
1374
  dimensionId: z.ZodString;
@@ -1400,7 +1400,7 @@ export declare const V2StepContextSchema: z.ZodObject<{
1400
1400
  rationale?: string | undefined;
1401
1401
  }[];
1402
1402
  normalizationNotes: readonly string[];
1403
- }>>;
1403
+ }>, "many">>;
1404
1404
  }, "strip", z.ZodTypeAny, {
1405
1405
  assessments?: {
1406
1406
  assessmentId: string;
@@ -1410,7 +1410,7 @@ export declare const V2StepContextSchema: z.ZodObject<{
1410
1410
  rationale?: string | undefined;
1411
1411
  }[];
1412
1412
  normalizationNotes: readonly string[];
1413
- } | undefined;
1413
+ }[] | undefined;
1414
1414
  }, {
1415
1415
  assessments?: {
1416
1416
  assessmentId: string;
@@ -1420,7 +1420,7 @@ export declare const V2StepContextSchema: z.ZodObject<{
1420
1420
  rationale?: string | undefined;
1421
1421
  }[];
1422
1422
  normalizationNotes: readonly string[];
1423
- } | undefined;
1423
+ }[] | undefined;
1424
1424
  }>;
1425
1425
  export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1426
1426
  kind: z.ZodLiteral<"ok">;
@@ -1491,7 +1491,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1491
1491
  currentValue: string;
1492
1492
  }>, "many">>;
1493
1493
  stepContext: z.ZodOptional<z.ZodObject<{
1494
- assessments: z.ZodOptional<z.ZodObject<{
1494
+ assessments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1495
1495
  assessmentId: z.ZodString;
1496
1496
  dimensions: z.ZodArray<z.ZodObject<{
1497
1497
  dimensionId: z.ZodString;
@@ -1523,7 +1523,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1523
1523
  rationale?: string | undefined;
1524
1524
  }[];
1525
1525
  normalizationNotes: readonly string[];
1526
- }>>;
1526
+ }>, "many">>;
1527
1527
  }, "strip", z.ZodTypeAny, {
1528
1528
  assessments?: {
1529
1529
  assessmentId: string;
@@ -1533,7 +1533,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1533
1533
  rationale?: string | undefined;
1534
1534
  }[];
1535
1535
  normalizationNotes: readonly string[];
1536
- } | undefined;
1536
+ }[] | undefined;
1537
1537
  }, {
1538
1538
  assessments?: {
1539
1539
  assessmentId: string;
@@ -1543,7 +1543,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1543
1543
  rationale?: string | undefined;
1544
1544
  }[];
1545
1545
  normalizationNotes: readonly string[];
1546
- } | undefined;
1546
+ }[] | undefined;
1547
1547
  }>>;
1548
1548
  }, "strip", z.ZodTypeAny, {
1549
1549
  kind: "ok";
@@ -1582,7 +1582,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1582
1582
  rationale?: string | undefined;
1583
1583
  }[];
1584
1584
  normalizationNotes: readonly string[];
1585
- } | undefined;
1585
+ }[] | undefined;
1586
1586
  } | undefined;
1587
1587
  }, {
1588
1588
  kind: "ok";
@@ -1621,7 +1621,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
1621
1621
  rationale?: string | undefined;
1622
1622
  }[];
1623
1623
  normalizationNotes: readonly string[];
1624
- } | undefined;
1624
+ }[] | undefined;
1625
1625
  } | undefined;
1626
1626
  }>, z.ZodObject<{
1627
1627
  kind: z.ZodLiteral<"blocked">;
@@ -2058,7 +2058,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
2058
2058
  rationale?: string | undefined;
2059
2059
  }[];
2060
2060
  normalizationNotes: readonly string[];
2061
- } | undefined;
2061
+ }[] | undefined;
2062
2062
  } | undefined;
2063
2063
  } | {
2064
2064
  kind: "blocked";
@@ -2155,7 +2155,7 @@ export declare const V2ContinueWorkflowOutputSchema: z.ZodEffects<z.ZodDiscrimin
2155
2155
  rationale?: string | undefined;
2156
2156
  }[];
2157
2157
  normalizationNotes: readonly string[];
2158
- } | undefined;
2158
+ }[] | undefined;
2159
2159
  } | undefined;
2160
2160
  } | {
2161
2161
  kind: "blocked";
@@ -288,18 +288,17 @@ exports.V2BindingDriftWarningSchema = zod_1.z.object({
288
288
  pinnedValue: zod_1.z.string().min(1),
289
289
  currentValue: zod_1.z.string().min(1),
290
290
  });
291
+ const V2StepContextAssessmentSchema = zod_1.z.object({
292
+ assessmentId: zod_1.z.string().min(1),
293
+ dimensions: zod_1.z.array(zod_1.z.object({
294
+ dimensionId: zod_1.z.string().min(1),
295
+ level: zod_1.z.string().min(1),
296
+ rationale: zod_1.z.string().optional(),
297
+ })),
298
+ normalizationNotes: zod_1.z.array(zod_1.z.string()).readonly(),
299
+ });
291
300
  exports.V2StepContextSchema = zod_1.z.object({
292
- assessments: zod_1.z
293
- .object({
294
- assessmentId: zod_1.z.string().min(1),
295
- dimensions: zod_1.z.array(zod_1.z.object({
296
- dimensionId: zod_1.z.string().min(1),
297
- level: zod_1.z.string().min(1),
298
- rationale: zod_1.z.string().optional(),
299
- })),
300
- normalizationNotes: zod_1.z.array(zod_1.z.string()).readonly(),
301
- })
302
- .optional(),
301
+ assessments: zod_1.z.array(V2StepContextAssessmentSchema).optional(),
303
302
  });
304
303
  const V2ContinueWorkflowOkSchema = zod_1.z.object({
305
304
  kind: zod_1.z.literal('ok'),
@@ -177,9 +177,13 @@ function formatOutputContractRequirements(outputContract) {
177
177
  function formatAssessmentRequirements(assessments) {
178
178
  if (assessments.length === 0)
179
179
  return [];
180
+ const multiRef = assessments.length > 1;
180
181
  const requirements = [];
181
182
  for (const assessment of assessments) {
182
183
  requirements.push('Provide an artifact with kind: "wr.assessment"');
184
+ if (multiRef) {
185
+ requirements.push(`Set assessmentId: "${assessment.id}" on the artifact so the engine can match it to the correct assessment.`);
186
+ }
183
187
  requirements.push(`Assessment target: "${assessment.id}"`);
184
188
  requirements.push(`Dimensions: ${assessment.dimensions.map((dimension) => `${dimension.id} (${dimension.levels.join(' | ')})`).join(', ')}`);
185
189
  requirements.push('Use only canonical dimension levels. If the engine rejects the artifact, correct the submitted levels instead of inventing new ones.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exaudeus/workrail",
3
- "version": "3.17.0",
3
+ "version": "3.18.0",
4
4
  "description": "Step-by-step workflow enforcement for AI agents via MCP",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -998,11 +998,11 @@
998
998
  "step.assessmentRefs",
999
999
  "step.assessmentConsequences"
1000
1000
  ],
1001
- "rule": "V1 supports exactly one assessmentRef per step and at most one assessmentConsequences entry per step. Use anyEqualsLevel as the trigger -- the engine checks all submitted dimensions and fires if any equals that level.",
1002
- "why": "anyEqualsLevel is the only trigger form. It works for both single-dimension and multi-dimension assessments without requiring the author to choose between two forms.",
1001
+ "rule": "A step may declare one or more assessmentRefs and at most one assessmentConsequences entry. When assessmentConsequences is present, at least one ref is required. Use anyEqualsLevel as the trigger -- the engine checks all submitted dimensions across all referenced assessments and fires if any equals that level.",
1002
+ "why": "Multiple refs allow composing separate orthogonal assessment definitions (e.g. quality-gate + coverage-gate) behind a single blocking consequence, without forcing unrelated dimensions into one monolithic definition.",
1003
1003
  "enforcement": ["schema"],
1004
1004
  "checks": [
1005
- "No more than one assessmentRefs entry per step.",
1005
+ "At least one assessmentRefs entry when assessmentConsequences is present.",
1006
1006
  "No more than one assessmentConsequences entry per step.",
1007
1007
  "The consequence uses anyEqualsLevel to declare which level blocks -- not a named dimension."
1008
1008
  ],
@@ -456,14 +456,13 @@
456
456
  },
457
457
  "assessmentRefs": {
458
458
  "type": "array",
459
- "description": "References to workflow-level assessment definitions expected for this step. V1 supports exactly one assessmentRef per step.",
459
+ "description": "References to workflow-level assessment definitions expected for this step. When assessmentConsequences is present, at least one ref is required; multiple refs are supported and the consequence fires if any dimension across any referenced assessment equals the trigger level.",
460
460
  "items": {
461
461
  "type": "string",
462
462
  "minLength": 1,
463
463
  "maxLength": 64
464
464
  },
465
465
  "minItems": 1,
466
- "maxItems": 1,
467
466
  "uniqueItems": true
468
467
  },
469
468
  "assessmentConsequences": {