@exaudeus/workrail 1.7.1 → 1.7.3

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 (36) hide show
  1. package/dist/application/services/validation-engine.js +3 -0
  2. package/dist/manifest.json +66 -66
  3. package/dist/mcp/handler-factory.d.ts +1 -1
  4. package/dist/mcp/handler-factory.js +4 -3
  5. package/dist/mcp/handlers/v2-advance-core/index.js +4 -1
  6. package/dist/mcp/handlers/v2-advance-core/input-validation.d.ts +1 -0
  7. package/dist/mcp/handlers/v2-advance-core/input-validation.js +3 -0
  8. package/dist/mcp/output-schemas.d.ts +18 -18
  9. package/dist/mcp/output-schemas.js +3 -0
  10. package/dist/mcp/v2/tool-registry.js +1 -1
  11. package/dist/mcp/v2/tools.d.ts +34 -0
  12. package/dist/mcp/v2/tools.js +7 -4
  13. package/dist/mcp/validation/schema-introspection.d.ts +2 -2
  14. package/dist/mcp/validation/schema-introspection.js +8 -8
  15. package/dist/mcp/validation/suggestion-config.d.ts +1 -0
  16. package/dist/mcp/validation/suggestion-config.js +2 -0
  17. package/dist/mcp/validation/suggestion-generator.js +1 -1
  18. package/dist/types/workflow-definition.d.ts +1 -0
  19. package/dist/v2/durable-core/domain/blocked-node-builder.js +2 -0
  20. package/dist/v2/durable-core/domain/blocking-decision.d.ts +3 -0
  21. package/dist/v2/durable-core/domain/blocking-decision.js +9 -0
  22. package/dist/v2/durable-core/domain/prompt-renderer.js +6 -1
  23. package/dist/v2/durable-core/domain/reason-model.d.ts +5 -2
  24. package/dist/v2/durable-core/domain/reason-model.js +17 -2
  25. package/dist/v2/durable-core/domain/risk-policy-guardrails.js +1 -0
  26. package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.d.ts +38 -14
  27. package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.js +4 -0
  28. package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts +177 -78
  29. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +240 -144
  30. package/dist/v2/durable-core/schemas/session/blockers.d.ts +11 -11
  31. package/dist/v2/durable-core/schemas/session/blockers.js +3 -0
  32. package/dist/v2/durable-core/schemas/session/events.d.ts +27 -27
  33. package/dist/v2/durable-core/schemas/session/gaps.d.ts +16 -16
  34. package/dist/v2/durable-core/schemas/session/gaps.js +2 -2
  35. package/package.json +1 -1
  36. package/spec/workflow.schema.json +5 -0
@@ -44,7 +44,7 @@ function findMissingRequiredKeys(args, schema) {
44
44
  const requiredKeys = extractRequiredKeys(schema);
45
45
  return requiredKeys.filter(key => !providedKeys.has(key));
46
46
  }
47
- function generateExampleValue(schema, depth = 0, maxDepth = 3) {
47
+ function generateExampleValue(schema, depth = 0, maxDepth = 3, includeOptional = false) {
48
48
  if (depth > maxDepth) {
49
49
  return '...';
50
50
  }
@@ -52,23 +52,23 @@ function generateExampleValue(schema, depth = 0, maxDepth = 3) {
52
52
  return schema._def.defaultValue();
53
53
  }
54
54
  if (schema instanceof zod_1.z.ZodOptional) {
55
- return generateExampleValue(schema._def.innerType, depth, maxDepth);
55
+ return generateExampleValue(schema._def.innerType, depth, maxDepth, includeOptional);
56
56
  }
57
57
  if (schema instanceof zod_1.z.ZodObject) {
58
58
  const shape = schema._def.shape();
59
59
  const result = {};
60
60
  for (const [key, value] of Object.entries(shape)) {
61
61
  const field = value;
62
- if (field instanceof zod_1.z.ZodOptional)
62
+ if (!includeOptional && field instanceof zod_1.z.ZodOptional)
63
63
  continue;
64
- result[key] = generateExampleValue(field, depth + 1, maxDepth);
64
+ result[key] = generateExampleValue(field, depth + 1, maxDepth, includeOptional);
65
65
  }
66
66
  return result;
67
67
  }
68
68
  if (schema instanceof zod_1.z.ZodDiscriminatedUnion) {
69
69
  const options = schema._def.options;
70
70
  if (options.length > 0) {
71
- return generateExampleValue(options[0], depth + 1, maxDepth);
71
+ return generateExampleValue(options[0], depth + 1, maxDepth, includeOptional);
72
72
  }
73
73
  return {};
74
74
  }
@@ -105,15 +105,15 @@ function generateExampleValue(schema, depth = 0, maxDepth = 3) {
105
105
  return '<any>';
106
106
  }
107
107
  if (schema instanceof zod_1.z.ZodEffects) {
108
- return generateExampleValue(schema._def.schema, depth, maxDepth);
108
+ return generateExampleValue(schema._def.schema, depth, maxDepth, includeOptional);
109
109
  }
110
110
  return '<unknown>';
111
111
  }
112
- function generateTemplate(schema, maxDepth = 3) {
112
+ function generateTemplate(schema, maxDepth = 3, includeOptional = false) {
113
113
  if (!(schema instanceof zod_1.z.ZodObject)) {
114
114
  return null;
115
115
  }
116
- const example = generateExampleValue(schema, 0, maxDepth);
116
+ const example = generateExampleValue(schema, 0, maxDepth, includeOptional);
117
117
  if (typeof example === 'object' && example !== null) {
118
118
  return example;
119
119
  }
@@ -4,6 +4,7 @@ export interface SuggestionConfig {
4
4
  readonly maxSuggestions: number;
5
5
  readonly includeTemplate: boolean;
6
6
  readonly maxTemplateDepth: number;
7
+ readonly includeOptionalInTemplate: boolean;
7
8
  }
8
9
  export declare const DEFAULT_SUGGESTION_CONFIG: SuggestionConfig;
9
10
  export declare const MINIMAL_SUGGESTION_CONFIG: SuggestionConfig;
@@ -7,10 +7,12 @@ exports.DEFAULT_SUGGESTION_CONFIG = {
7
7
  maxSuggestions: 3,
8
8
  includeTemplate: true,
9
9
  maxTemplateDepth: 3,
10
+ includeOptionalInTemplate: true,
10
11
  };
11
12
  exports.MINIMAL_SUGGESTION_CONFIG = {
12
13
  similarityThreshold: (0, suggestion_types_js_1.similarity)(0.7),
13
14
  maxSuggestions: 1,
14
15
  includeTemplate: false,
15
16
  maxTemplateDepth: 1,
17
+ includeOptionalInTemplate: false,
16
18
  };
@@ -56,7 +56,7 @@ function generateSuggestions(args, schema, config) {
56
56
  return suggestion_types_js_1.EMPTY_SUGGESTION_RESULT;
57
57
  }
58
58
  const correctTemplate = config.includeTemplate
59
- ? (0, schema_introspection_js_1.generateTemplate)(schema, config.maxTemplateDepth)
59
+ ? (0, schema_introspection_js_1.generateTemplate)(schema, config.maxTemplateDepth, config.includeOptionalInTemplate)
60
60
  : null;
61
61
  return {
62
62
  suggestions,
@@ -15,6 +15,7 @@ export interface WorkflowStepDefinition {
15
15
  readonly runCondition?: Readonly<Record<string, unknown>>;
16
16
  readonly validationCriteria?: ValidationCriteria;
17
17
  readonly outputContract?: OutputContract;
18
+ readonly notesOptional?: boolean;
18
19
  readonly functionDefinitions?: readonly FunctionDefinition[];
19
20
  readonly functionCalls?: readonly FunctionCall[];
20
21
  readonly functionReferences?: readonly string[];
@@ -13,6 +13,8 @@ function toContractViolationReason(reason) {
13
13
  return { kind: 'missing_context_key', key: reason.key };
14
14
  case 'context_budget_exceeded':
15
15
  return { kind: 'context_budget_exceeded' };
16
+ case 'missing_notes':
17
+ return { kind: 'missing_notes', stepId: reason.stepId };
16
18
  default:
17
19
  return null;
18
20
  }
@@ -31,4 +31,7 @@ export declare function detectBlockingReasonsV1(args: {
31
31
  readonly contextBudgetExceeded?: boolean;
32
32
  readonly outputRequirement?: OutputRequirementStatus;
33
33
  readonly capabilityRequirement?: CapabilityRequirementStatus;
34
+ readonly missingNotes?: {
35
+ readonly stepId: string;
36
+ };
34
37
  }): Result<readonly ReasonV1[], BlockingDecisionError>;
@@ -54,5 +54,14 @@ function detectBlockingReasonsV1(args) {
54
54
  }
55
55
  }
56
56
  }
57
+ if (args.missingNotes) {
58
+ if (!constants_js_1.DELIMITER_SAFE_ID_PATTERN.test(args.missingNotes.stepId)) {
59
+ return (0, neverthrow_1.err)({
60
+ code: 'INVALID_DELIMITER_SAFE_ID',
61
+ message: `step ID must be delimiter-safe: [a-z0-9_-]+ (got: ${args.missingNotes.stepId})`,
62
+ });
63
+ }
64
+ reasons.push({ kind: 'missing_notes', stepId: args.missingNotes.stepId });
65
+ }
57
66
  return (0, neverthrow_1.ok)(reasons);
58
67
  }
@@ -166,7 +166,12 @@ function renderPendingPrompt(args) {
166
166
  const contractSection = contractRequirements.length > 0
167
167
  ? `\n\n**OUTPUT REQUIREMENTS (System):**\n${contractRequirements.map(r => `- ${r}`).join('\n')}`
168
168
  : '';
169
- const enhancedPrompt = basePrompt + requirementsSection + contractSection;
169
+ const isNotesOptional = outputContract !== undefined ||
170
+ (step !== null && step !== undefined && 'notesOptional' in step && step.notesOptional === true);
171
+ const notesSection = isNotesOptional
172
+ ? ''
173
+ : '\n\n**NOTES REQUIRED (System):** You must include `output.notesMarkdown` documenting what you did and why. Omitting notes will block this step — use the `retryAckToken` to fix and retry.';
174
+ const enhancedPrompt = basePrompt + requirementsSection + contractSection + notesSection;
170
175
  if (!args.rehydrateOnly) {
171
176
  return (0, neverthrow_1.ok)({ stepId: args.stepId, title: baseTitle, prompt: enhancedPrompt, requireConfirmation });
172
177
  }
@@ -8,7 +8,7 @@ export type GapReasonV1 = {
8
8
  readonly detail: UserOnlyDependencyReasonV1;
9
9
  } | {
10
10
  readonly category: 'contract_violation';
11
- readonly detail: 'missing_required_output' | 'invalid_required_output';
11
+ readonly detail: 'missing_required_output' | 'invalid_required_output' | 'missing_required_notes';
12
12
  } | {
13
13
  readonly category: 'capability_missing';
14
14
  readonly detail: 'required_capability_unavailable' | 'required_capability_unknown';
@@ -16,7 +16,7 @@ export type GapReasonV1 = {
16
16
  readonly category: 'unexpected';
17
17
  readonly detail: 'invariant_violation' | 'storage_corruption_detected' | 'evaluation_error';
18
18
  };
19
- export type BlockerCodeV1 = 'USER_ONLY_DEPENDENCY' | 'MISSING_REQUIRED_OUTPUT' | 'INVALID_REQUIRED_OUTPUT' | 'REQUIRED_CAPABILITY_UNKNOWN' | 'REQUIRED_CAPABILITY_UNAVAILABLE' | 'INVARIANT_VIOLATION' | 'STORAGE_CORRUPTION_DETECTED';
19
+ export type BlockerCodeV1 = 'USER_ONLY_DEPENDENCY' | 'MISSING_REQUIRED_OUTPUT' | 'INVALID_REQUIRED_OUTPUT' | 'MISSING_REQUIRED_NOTES' | 'MISSING_CONTEXT_KEY' | 'CONTEXT_BUDGET_EXCEEDED' | 'REQUIRED_CAPABILITY_UNKNOWN' | 'REQUIRED_CAPABILITY_UNAVAILABLE' | 'INVARIANT_VIOLATION' | 'STORAGE_CORRUPTION_DETECTED';
20
20
  export type BlockerPointerV1 = {
21
21
  readonly kind: 'context_key';
22
22
  readonly key: string;
@@ -52,6 +52,9 @@ export type ReasonV1 = {
52
52
  } | {
53
53
  readonly kind: 'invalid_required_output';
54
54
  readonly contractRef: string;
55
+ } | {
56
+ readonly kind: 'missing_notes';
57
+ readonly stepId: string;
55
58
  } | {
56
59
  readonly kind: 'required_capability_unknown';
57
60
  readonly capability: CapabilityV2;
@@ -58,6 +58,12 @@ function reasonToGap(reason) {
58
58
  reason: { category: 'contract_violation', detail: 'invalid_required_output' },
59
59
  summary: `Invalid required output for contractRef=${reason.contractRef}`,
60
60
  };
61
+ case 'missing_notes':
62
+ return {
63
+ severity: 'critical',
64
+ reason: { category: 'contract_violation', detail: 'missing_required_notes' },
65
+ summary: `Missing required notes for stepId=${reason.stepId}`,
66
+ };
61
67
  case 'required_capability_unknown':
62
68
  return {
63
69
  severity: 'critical',
@@ -137,7 +143,7 @@ function reasonToBlocker(reason) {
137
143
  case 'missing_context_key':
138
144
  return ensureDelimiterSafeId('context_key.key', reason.key)
139
145
  .map((key) => ({
140
- code: 'INVARIANT_VIOLATION',
146
+ code: 'MISSING_CONTEXT_KEY',
141
147
  pointer: { kind: 'context_key', key },
142
148
  message: `Missing required context key: ${key}`,
143
149
  suggestedFix: `Include context.${key} (delimiter-safe key) in the next continue_workflow call.`,
@@ -145,7 +151,7 @@ function reasonToBlocker(reason) {
145
151
  .andThen(ensureBlockerTextBudgets);
146
152
  case 'context_budget_exceeded':
147
153
  return ensureBlockerTextBudgets({
148
- code: 'INVARIANT_VIOLATION',
154
+ code: 'CONTEXT_BUDGET_EXCEEDED',
149
155
  pointer: { kind: 'context_budget' },
150
156
  message: 'Context exceeded the allowed budget or was non-serializable.',
151
157
  suggestedFix: 'Remove large blobs from context and pass only small external inputs (IDs, paths, parameters).',
@@ -168,6 +174,15 @@ function reasonToBlocker(reason) {
168
174
  suggestedFix: 'Update output.notesMarkdown to satisfy validation. Then call continue_workflow WITHOUT ackToken (rehydrate) to receive a fresh ackToken, and retry advance with that new ackToken. Replaying the same ackToken is idempotent and will keep returning this blocked result.',
169
175
  }))
170
176
  .andThen(ensureBlockerTextBudgets);
177
+ case 'missing_notes':
178
+ return ensureDelimiterSafeId('workflow_step.stepId', reason.stepId)
179
+ .map((stepId) => ({
180
+ code: 'MISSING_REQUIRED_NOTES',
181
+ pointer: { kind: 'workflow_step', stepId },
182
+ message: `Step "${stepId}" requires notes documenting your work (output.notesMarkdown).`,
183
+ suggestedFix: 'Add output.notesMarkdown with meaningful documentation of what you did and why. Use the retryAckToken to retry without rehydrating.',
184
+ }))
185
+ .andThen(ensureBlockerTextBudgets);
171
186
  case 'required_capability_unknown':
172
187
  return ensureBlockerTextBudgets({
173
188
  code: 'REQUIRED_CAPABILITY_UNKNOWN',
@@ -6,6 +6,7 @@ function isNeverDowngradable(reason) {
6
6
  switch (reason.kind) {
7
7
  case 'missing_required_output':
8
8
  case 'invalid_required_output':
9
+ case 'missing_notes':
9
10
  return true;
10
11
  case 'user_only_dependency':
11
12
  return true;
@@ -32,6 +32,15 @@ export declare const ContractViolationReasonV1Schema: z.ZodDiscriminatedUnion<"k
32
32
  kind: "context_budget_exceeded";
33
33
  }, {
34
34
  kind: "context_budget_exceeded";
35
+ }>, z.ZodObject<{
36
+ kind: z.ZodLiteral<"missing_notes">;
37
+ stepId: z.ZodString;
38
+ }, "strict", z.ZodTypeAny, {
39
+ kind: "missing_notes";
40
+ stepId: string;
41
+ }, {
42
+ kind: "missing_notes";
43
+ stepId: string;
35
44
  }>]>;
36
45
  export declare const TerminalReasonV1Schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
37
46
  kind: z.ZodLiteral<"user_only_dependency">;
@@ -117,12 +126,21 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
117
126
  kind: "context_budget_exceeded";
118
127
  }, {
119
128
  kind: "context_budget_exceeded";
129
+ }>, z.ZodObject<{
130
+ kind: z.ZodLiteral<"missing_notes">;
131
+ stepId: z.ZodString;
132
+ }, "strict", z.ZodTypeAny, {
133
+ kind: "missing_notes";
134
+ stepId: string;
135
+ }, {
136
+ kind: "missing_notes";
137
+ stepId: string;
120
138
  }>]>;
121
139
  retryAttemptId: z.ZodString;
122
140
  validationRef: z.ZodString;
123
141
  blockers: z.ZodReadonly<z.ZodObject<{
124
142
  blockers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
125
- code: z.ZodEnum<["USER_ONLY_DEPENDENCY", "MISSING_REQUIRED_OUTPUT", "INVALID_REQUIRED_OUTPUT", "REQUIRED_CAPABILITY_UNKNOWN", "REQUIRED_CAPABILITY_UNAVAILABLE", "INVARIANT_VIOLATION", "STORAGE_CORRUPTION_DETECTED"]>;
143
+ code: z.ZodEnum<["USER_ONLY_DEPENDENCY", "MISSING_REQUIRED_OUTPUT", "INVALID_REQUIRED_OUTPUT", "MISSING_REQUIRED_NOTES", "MISSING_CONTEXT_KEY", "CONTEXT_BUDGET_EXCEEDED", "REQUIRED_CAPABILITY_UNKNOWN", "REQUIRED_CAPABILITY_UNAVAILABLE", "INVARIANT_VIOLATION", "STORAGE_CORRUPTION_DETECTED"]>;
126
144
  pointer: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
127
145
  kind: z.ZodLiteral<"context_key">;
128
146
  key: z.ZodString;
@@ -170,7 +188,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
170
188
  suggestedFix: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
171
189
  }, "strip", z.ZodTypeAny, {
172
190
  message: string;
173
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
191
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
174
192
  pointer: {
175
193
  key: string;
176
194
  kind: "context_key";
@@ -189,7 +207,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
189
207
  suggestedFix?: string | undefined;
190
208
  }, {
191
209
  message: string;
192
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
210
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
193
211
  pointer: {
194
212
  key: string;
195
213
  kind: "context_key";
@@ -210,7 +228,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
210
228
  }, "strip", z.ZodTypeAny, {
211
229
  blockers: readonly {
212
230
  message: string;
213
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
231
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
214
232
  pointer: {
215
233
  key: string;
216
234
  kind: "context_key";
@@ -231,7 +249,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
231
249
  }, {
232
250
  blockers: readonly {
233
251
  message: string;
234
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
252
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
235
253
  pointer: {
236
254
  key: string;
237
255
  kind: "context_key";
@@ -262,12 +280,15 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
262
280
  kind: "missing_context_key";
263
281
  } | {
264
282
  kind: "context_budget_exceeded";
283
+ } | {
284
+ kind: "missing_notes";
285
+ stepId: string;
265
286
  };
266
287
  kind: "retryable_block";
267
288
  blockers: Readonly<{
268
289
  blockers: readonly {
269
290
  message: string;
270
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
291
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
271
292
  pointer: {
272
293
  key: string;
273
294
  kind: "context_key";
@@ -300,12 +321,15 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
300
321
  kind: "missing_context_key";
301
322
  } | {
302
323
  kind: "context_budget_exceeded";
324
+ } | {
325
+ kind: "missing_notes";
326
+ stepId: string;
303
327
  };
304
328
  kind: "retryable_block";
305
329
  blockers: Readonly<{
306
330
  blockers: readonly {
307
331
  message: string;
308
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
332
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
309
333
  pointer: {
310
334
  key: string;
311
335
  kind: "context_key";
@@ -380,7 +404,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
380
404
  validationRef: z.ZodOptional<z.ZodString>;
381
405
  blockers: z.ZodReadonly<z.ZodObject<{
382
406
  blockers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
383
- code: z.ZodEnum<["USER_ONLY_DEPENDENCY", "MISSING_REQUIRED_OUTPUT", "INVALID_REQUIRED_OUTPUT", "REQUIRED_CAPABILITY_UNKNOWN", "REQUIRED_CAPABILITY_UNAVAILABLE", "INVARIANT_VIOLATION", "STORAGE_CORRUPTION_DETECTED"]>;
407
+ code: z.ZodEnum<["USER_ONLY_DEPENDENCY", "MISSING_REQUIRED_OUTPUT", "INVALID_REQUIRED_OUTPUT", "MISSING_REQUIRED_NOTES", "MISSING_CONTEXT_KEY", "CONTEXT_BUDGET_EXCEEDED", "REQUIRED_CAPABILITY_UNKNOWN", "REQUIRED_CAPABILITY_UNAVAILABLE", "INVARIANT_VIOLATION", "STORAGE_CORRUPTION_DETECTED"]>;
384
408
  pointer: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
385
409
  kind: z.ZodLiteral<"context_key">;
386
410
  key: z.ZodString;
@@ -428,7 +452,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
428
452
  suggestedFix: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
429
453
  }, "strip", z.ZodTypeAny, {
430
454
  message: string;
431
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
455
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
432
456
  pointer: {
433
457
  key: string;
434
458
  kind: "context_key";
@@ -447,7 +471,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
447
471
  suggestedFix?: string | undefined;
448
472
  }, {
449
473
  message: string;
450
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
474
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
451
475
  pointer: {
452
476
  key: string;
453
477
  kind: "context_key";
@@ -468,7 +492,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
468
492
  }, "strip", z.ZodTypeAny, {
469
493
  blockers: readonly {
470
494
  message: string;
471
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
495
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
472
496
  pointer: {
473
497
  key: string;
474
498
  kind: "context_key";
@@ -489,7 +513,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
489
513
  }, {
490
514
  blockers: readonly {
491
515
  message: string;
492
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
516
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
493
517
  pointer: {
494
518
  key: string;
495
519
  kind: "context_key";
@@ -530,7 +554,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
530
554
  blockers: Readonly<{
531
555
  blockers: readonly {
532
556
  message: string;
533
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
557
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
534
558
  pointer: {
535
559
  key: string;
536
560
  kind: "context_key";
@@ -572,7 +596,7 @@ export declare const BlockedSnapshotV1Schema: z.ZodDiscriminatedUnion<"kind", [z
572
596
  blockers: Readonly<{
573
597
  blockers: readonly {
574
598
  message: string;
575
- code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
599
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "MISSING_REQUIRED_NOTES" | "MISSING_CONTEXT_KEY" | "CONTEXT_BUDGET_EXCEEDED" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
576
600
  pointer: {
577
601
  key: string;
578
602
  kind: "context_key";
@@ -13,6 +13,9 @@ const BlockerCodeSchema = zod_1.z.enum([
13
13
  'USER_ONLY_DEPENDENCY',
14
14
  'MISSING_REQUIRED_OUTPUT',
15
15
  'INVALID_REQUIRED_OUTPUT',
16
+ 'MISSING_REQUIRED_NOTES',
17
+ 'MISSING_CONTEXT_KEY',
18
+ 'CONTEXT_BUDGET_EXCEEDED',
16
19
  'REQUIRED_CAPABILITY_UNKNOWN',
17
20
  'REQUIRED_CAPABILITY_UNAVAILABLE',
18
21
  'INVARIANT_VIOLATION',
@@ -50,6 +53,7 @@ exports.ContractViolationReasonV1Schema = zod_1.z.discriminatedUnion('kind', [
50
53
  zod_1.z.object({ kind: zod_1.z.literal('missing_required_output'), contractRef: zod_1.z.string().min(1) }).strict(),
51
54
  zod_1.z.object({ kind: zod_1.z.literal('missing_context_key'), key: DelimiterSafeIdSchema }).strict(),
52
55
  zod_1.z.object({ kind: zod_1.z.literal('context_budget_exceeded') }).strict(),
56
+ zod_1.z.object({ kind: zod_1.z.literal('missing_notes'), stepId: DelimiterSafeIdSchema }).strict(),
53
57
  ]);
54
58
  exports.TerminalReasonV1Schema = zod_1.z.discriminatedUnion('kind', [
55
59
  zod_1.z.object({