@sensigo/realm 0.36.0 → 0.38.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 (45) hide show
  1. package/dist/adapters/adapter-utils.d.ts +31 -0
  2. package/dist/adapters/adapter-utils.d.ts.map +1 -1
  3. package/dist/adapters/adapter-utils.js +16 -0
  4. package/dist/adapters/adapter-utils.js.map +1 -1
  5. package/dist/adapters/airtable-adapter.d.ts.map +1 -1
  6. package/dist/adapters/airtable-adapter.js +25 -14
  7. package/dist/adapters/airtable-adapter.js.map +1 -1
  8. package/dist/adapters/gorgias-adapter.d.ts.map +1 -1
  9. package/dist/adapters/gorgias-adapter.js +7 -3
  10. package/dist/adapters/gorgias-adapter.js.map +1 -1
  11. package/dist/adapters/notion-adapter.d.ts.map +1 -1
  12. package/dist/adapters/notion-adapter.js +10 -6
  13. package/dist/adapters/notion-adapter.js.map +1 -1
  14. package/dist/adapters/slack-adapter.d.ts.map +1 -1
  15. package/dist/adapters/slack-adapter.js +8 -2
  16. package/dist/adapters/slack-adapter.js.map +1 -1
  17. package/dist/engine/eligibility.d.ts +24 -0
  18. package/dist/engine/eligibility.d.ts.map +1 -1
  19. package/dist/engine/eligibility.js +35 -2
  20. package/dist/engine/eligibility.js.map +1 -1
  21. package/dist/engine/execution-loop.d.ts.map +1 -1
  22. package/dist/engine/execution-loop.js +35 -0
  23. package/dist/engine/execution-loop.js.map +1 -1
  24. package/dist/engine/run-health.d.ts.map +1 -1
  25. package/dist/engine/run-health.js +10 -1
  26. package/dist/engine/run-health.js.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/types/run-record.d.ts +59 -5
  30. package/dist/types/run-record.d.ts.map +1 -1
  31. package/dist/types/workflow-error.d.ts +1 -1
  32. package/dist/types/workflow-error.d.ts.map +1 -1
  33. package/dist/types/workflow-error.js.map +1 -1
  34. package/dist/workflow/diagnostics.d.ts +10 -0
  35. package/dist/workflow/diagnostics.d.ts.map +1 -1
  36. package/dist/workflow/diagnostics.js +1 -1
  37. package/dist/workflow/diagnostics.js.map +1 -1
  38. package/dist/workflow/structured-output-eligibility.d.ts +20 -3
  39. package/dist/workflow/structured-output-eligibility.d.ts.map +1 -1
  40. package/dist/workflow/structured-output-eligibility.js +253 -29
  41. package/dist/workflow/structured-output-eligibility.js.map +1 -1
  42. package/dist/workflow/yaml-loader.d.ts.map +1 -1
  43. package/dist/workflow/yaml-loader.js +32 -1
  44. package/dist/workflow/yaml-loader.js.map +1 -1
  45. package/package.json +1 -1
@@ -63,6 +63,103 @@ const SUPPORTED_FORMATS = new Set([
63
63
  const OWN_ROW_KEYWORDS = new Set(['format', 'pattern']);
64
64
  /** Keys that are never schema keywords themselves — traversal structure, not gate subjects. */
65
65
  const NON_KEYWORD_KEYS = new Set(['properties', 'items', '$defs', 'definitions']);
66
+ /**
67
+ * Issue #313 — the OpenAI profile's keyword allowlist. WIDER than Anthropic's: every keyword
68
+ * Anthropic hard-rejects or silently ignores in the numeric/string-constraint family is
69
+ * first-class here, and `$ref` recursion is supported outright.
70
+ *
71
+ * Provenance (api-facts-lane + MA-executed probes, 2026-08-16): the docs were wrong in BOTH
72
+ * directions for both vendors, so acceptance is probe-anchored, never docs-derived. P2 in
73
+ * particular FLIPPED the expectation — `minLength` is accepted AND enforced (a 2-char answer
74
+ * came back padded to exactly 10 characters: the constrained-decoding signature), the exact
75
+ * opposite of Anthropic's live-proven accept-and-ignore of the same keyword.
76
+ */
77
+ const OPENAI_SUPPORTED_KEYWORDS = new Set([
78
+ // structural
79
+ 'type',
80
+ 'properties',
81
+ 'items',
82
+ 'description',
83
+ 'title',
84
+ 'required',
85
+ 'additionalProperties',
86
+ '$ref',
87
+ '$defs',
88
+ 'definitions',
89
+ 'default',
90
+ // value constraints — all first-class under OpenAI strict
91
+ 'enum',
92
+ 'const',
93
+ 'anyOf',
94
+ 'pattern',
95
+ 'format',
96
+ 'minLength',
97
+ 'maxLength',
98
+ 'minimum',
99
+ 'maximum',
100
+ 'exclusiveMinimum',
101
+ 'exclusiveMaximum',
102
+ 'multipleOf',
103
+ 'minItems',
104
+ 'maxItems',
105
+ ]);
106
+ /**
107
+ * Issue #313 — the OpenAI profile's HARD rejection set, with PER-MEMBER provenance labels
108
+ * (final-gate correction 1). Misclassifying a member here costs only the safe json_object
109
+ * fallback — never a falsity — which is why the docs-derived members are kept conservative:
110
+ *
111
+ * - `allOf` — 400-EXECUTED (probe P3a: "In context=('properties','x'), 'allOf' is
112
+ * not permitted", param=response_format).
113
+ * - `not` — 400-EXECUTED ("Unsupported keywords ('not',)").
114
+ * - `dependentRequired` — 400-EXECUTED (the keyword is named in the message).
115
+ * - `dependentSchemas` — 400-EXECUTED (the keyword is named in the message).
116
+ * - `if` / `then` / `else` — 400-EXECUTED (fires for if/then AND if/then/else).
117
+ *
118
+ * END STATE: every member is executed against the live API, each 400 naming its own keyword. The
119
+ * class posture (reject-on-unsupported, rather than Anthropic's silent strip) therefore no longer
120
+ * rests on a single confirmed member. This matters because the failure direction is asymmetric: a
121
+ * keyword wrongly present here would cost a SILENT capability loss (fallback to json_object with
122
+ * nobody told), whereas one wrongly absent is caught loudly by the live 400 arm. Adding a member
123
+ * on documentation alone would re-open that hazard — probe first.
124
+ */
125
+ const OPENAI_UNSUPPORTED_KEYWORDS = new Set([
126
+ 'allOf',
127
+ 'not',
128
+ 'dependentRequired',
129
+ 'dependentSchemas',
130
+ 'if',
131
+ 'then',
132
+ 'else',
133
+ ]);
134
+ /**
135
+ * Issue #313 — OpenAI's schema size limits, with PER-MEMBER PROVENANCE LABELS (the same
136
+ * discipline the keyword sets above carry, for the same reason: two of these four were executed
137
+ * against the live API and two were read off documentation that has already been wrong in both
138
+ * directions for both vendors).
139
+ *
140
+ * Misclassification cost is asymmetric and worth stating: a limit set too LOW silently withholds
141
+ * strict from a schema the API would have accepted (no error, no signal — the exact class this
142
+ * issue exists to remove), while a limit set too HIGH simply lets the request go and be caught by
143
+ * the live 400 arm, which drops strict, retries, and discloses. That is why the two unprobed
144
+ * members are kept at their documented values rather than tightened defensively.
145
+ */
146
+ const OPENAI_LIMITS = {
147
+ /** Nesting depth. BOUNDARY-EXECUTED: depth 10 ⇒ 200, depth 11 ⇒ 400 ("11 levels of nesting
148
+ * exceeds limit of 10"). Measured in OBJECT nesting levels — see walkNode. */
149
+ maxDepth: 10,
150
+ /** Total properties across the schema. BOUNDARY-EXECUTED both sides: 5000 ⇒ 200, 5001 ⇒ 400
151
+ * ("5001 parameters exceeds limit of 5000"). */
152
+ maxProperties: 5000,
153
+ /** Total characters across property names, enum values and const values.
154
+ * DOCS-DERIVED-CONSERVATIVE for the 120k figure itself — no exact-boundary cell was
155
+ * constructed. The COUNTED SET, however, is executed fact: descriptions are PROVEN excluded
156
+ * (~135k of description text behind tiny names/enums ⇒ 200), which is why they are not
157
+ * counted here. */
158
+ maxChars: 120_000,
159
+ /** Values in a single enum. BOUNDARY-EXECUTED: 1000 ⇒ 200, 1001 ⇒ 400 (the error names the
160
+ * limit and the received count). */
161
+ maxEnumValues: 1000,
162
+ };
66
163
  /**
67
164
  * Issue #311: the enforcement-class clause, forked by subject. On the step-output path realm's
68
165
  * own Ajv still enforces the keyword after the model answers, so each row keeps its EXISTING
@@ -141,20 +238,57 @@ function hasDefsCycle(defs) {
141
238
  }
142
239
  /** Recursively walks one schema node, mutating `ctx` with every G1/G2/G4/G5 finding + the G3
143
240
  * optional/union counts. `path` is the schema-relative dotted path to THIS node. */
144
- function walkNode(node, path, ctx) {
241
+ function walkNode(node, path, ctx, depth = 1) {
145
242
  if (!isPlainObject(node))
146
243
  return;
244
+ const openai = ctx.profile === 'openai';
245
+ // Depth is measured in OBJECT nesting levels — the unit OpenAI's own limit is stated in. A
246
+ // scalar leaf (`{type: 'string'}`) is a nested schema node but not a nested level, so counting
247
+ // every node would reject at 9 real levels and silently cost strict on schemas the API accepts.
248
+ if ((node['type'] === 'object' || node['properties'] !== undefined) && depth > ctx.maxDepthSeen) {
249
+ ctx.maxDepthSeen = depth;
250
+ }
251
+ // issue #313 (OpenAI hard set): keywords the API rejects outright with a 400. Checked BEFORE
252
+ // the generic allowlist walk so they never degrade to the caveat class.
253
+ if (openai) {
254
+ for (const kw of Object.keys(node)) {
255
+ if (!OPENAI_UNSUPPORTED_KEYWORDS.has(kw))
256
+ continue;
257
+ ctx.hardReasons.push({
258
+ code: 'unsupported_keyword',
259
+ path,
260
+ remediation: `'${kw}' at '${path || '(root)'}' is not supported by OpenAI strict mode and is rejected with a 400 — restructure without it (for '${kw}' inside a composition, express the shape directly or use 'anyOf')${fixOwnerHint(ctx.subject)}`,
261
+ });
262
+ }
263
+ // Enum-value cap is per-enum, so it is measured here rather than summed.
264
+ const enumForCap = node['enum'];
265
+ if (Array.isArray(enumForCap) && enumForCap.length > ctx.maxEnumValuesSeen) {
266
+ ctx.maxEnumValuesSeen = enumForCap.length;
267
+ }
268
+ // Character budget: property names + enum values + const values.
269
+ for (const v of Array.isArray(enumForCap) ? enumForCap : []) {
270
+ ctx.charCount += String(v).length;
271
+ }
272
+ if (node['const'] !== undefined)
273
+ ctx.charCount += String(node['const']).length;
274
+ }
147
275
  // G2-hard: root self-reference ('#') — the API neither enforces nor cleanly rejects this edge
148
276
  // (premise-probe-raw.md §Live-probe: silent-prune when optional, a persistent 503 when
149
277
  // required) — it must NEVER fall to the generic caveat class.
278
+ //
279
+ // issue #313: OpenAI supports `$ref` recursion FIRST-CLASS (api-facts lane), so the recursive
280
+ // arm is Anthropic-only. The external-$ref arm applies to BOTH — an unresolvable reference is
281
+ // unresolvable everywhere.
150
282
  const ref = node['$ref'];
151
283
  if (typeof ref === 'string') {
152
284
  if (ref === '#') {
153
- ctx.hardReasons.push({
154
- code: 'unsupported_keyword',
155
- path,
156
- remediation: `recursive schema at '${path || '(root)'}' ($ref: '#') is not supported — remove the self-reference or restructure without recursion`,
157
- });
285
+ if (!openai) {
286
+ ctx.hardReasons.push({
287
+ code: 'unsupported_keyword',
288
+ path,
289
+ remediation: `recursive schema at '${path || '(root)'}' ($ref: '#') is not supported — remove the self-reference or restructure without recursion`,
290
+ });
291
+ }
158
292
  }
159
293
  else if (!ref.startsWith('#')) {
160
294
  ctx.hardReasons.push({
@@ -164,8 +298,10 @@ function walkNode(node, path, ctx) {
164
298
  });
165
299
  }
166
300
  }
167
- // G2-hard: numeric constraints.
168
- for (const kw of ['minimum', 'maximum', 'multipleOf']) {
301
+ // G2-hard: numeric constraints. ANTHROPIC ONLY — OpenAI supports the whole numeric-bound
302
+ // family first-class (api-facts lane), so flagging them under 'openai' would reject schemas
303
+ // the API accepts and enforces.
304
+ for (const kw of openai ? [] : ['minimum', 'maximum', 'multipleOf']) {
169
305
  if (kw in node) {
170
306
  ctx.hardReasons.push({
171
307
  code: 'unsupported_keyword',
@@ -185,8 +321,9 @@ function walkNode(node, path, ctx) {
185
321
  remediation: `'enum' at '${path || '(root)'}' contains a complex (object/array) member — strict mode only supports string/number/boolean/null enum members`,
186
322
  });
187
323
  }
188
- // G4: format.
189
- const format = node['format'];
324
+ // G4: format. ANTHROPIC ONLY — under OpenAI, `format` is supported and NOT flagged (the
325
+ // profile's deltas are enumerated; inventing a suppression-or-flag beyond them is banned).
326
+ const format = openai ? undefined : node['format'];
190
327
  if (typeof format === 'string' && !SUPPORTED_FORMATS.has(format)) {
191
328
  ctx.caveats.push({
192
329
  code: 'unenforced_format',
@@ -194,8 +331,10 @@ function walkNode(node, path, ctx) {
194
331
  remediation: `'format: ${format}' at '${path || '(root)'}' ${enforcementClause(ctx.subject, "is silently ignored or rejected by the API — enforced post-hoc by realm's own validation only")}${fixOwnerHint(ctx.subject)}`,
195
332
  });
196
333
  }
197
- // G5: pattern — always a caveat when present, regardless of regex complexity.
198
- if (typeof node['pattern'] === 'string') {
334
+ // G5: pattern — always a caveat when present, regardless of regex complexity. ANTHROPIC ONLY:
335
+ // OpenAI accepts `pattern` and (P2, INFERRED-strong) genuinely enforces it via constrained
336
+ // decoding, so a "realm enforces this post-hoc, the grammar doesn't" caveat would be false.
337
+ if (!openai && typeof node['pattern'] === 'string') {
199
338
  ctx.caveats.push({
200
339
  code: 'unenforced_pattern',
201
340
  path,
@@ -209,7 +348,13 @@ function walkNode(node, path, ctx) {
209
348
  continue;
210
349
  if (key === 'minimum' || key === 'maximum' || key === 'multipleOf' || key === 'enum')
211
350
  continue; // already handled (hard or allowlisted)
212
- if (STRICT_SUPPORTED_KEYWORDS.has(key))
351
+ // issue #313: each profile walks its OWN allowlist. Under 'openai' the hard set was already
352
+ // rejected above, so anything still off-allowlist here is the genuine unknown-keyword class.
353
+ if (openai) {
354
+ if (OPENAI_SUPPORTED_KEYWORDS.has(key) || OPENAI_UNSUPPORTED_KEYWORDS.has(key))
355
+ continue;
356
+ }
357
+ else if (STRICT_SUPPORTED_KEYWORDS.has(key))
213
358
  continue;
214
359
  if (ctx.seenUnenforcedKeywords.has(`${path}:${key}`))
215
360
  continue;
@@ -239,6 +384,12 @@ function walkNode(node, path, ctx) {
239
384
  : new Set();
240
385
  for (const [propName, propSchema] of Object.entries(properties)) {
241
386
  const propPath = joinPath(path, `properties.${propName}`);
387
+ ctx.propertyCount += 1;
388
+ if (openai)
389
+ ctx.charCount += propName.length;
390
+ const isNullUnion = isPlainObject(propSchema) &&
391
+ Array.isArray(propSchema['type']) &&
392
+ propSchema['type'].includes('null');
242
393
  if (!required.has(propName)) {
243
394
  ctx.optionalCount += 1;
244
395
  if (isPlainObject(propSchema) &&
@@ -246,17 +397,30 @@ function walkNode(node, path, ctx) {
246
397
  (Array.isArray(propSchema['type']) && propSchema['type'].length > 1))) {
247
398
  ctx.unionCount += 1;
248
399
  }
400
+ // issue #313 (OpenAI): EVERY property must be listed in `required` — probe-derived, the
401
+ // S1 discriminator isolated it from the additionalProperties rule P1 had conflated it
402
+ // with. The sanctioned way to express "may be absent" is a null union + required.
403
+ if (openai) {
404
+ ctx.hardReasons.push({
405
+ code: 'not_all_required',
406
+ path: propPath,
407
+ remediation: `'${propName}' is not listed in 'required' at '${path || 'the schema root'}' — OpenAI strict requires EVERY property to be required. Add it to 'required'; if it genuinely may be absent, keep it required and widen its type to a null union (e.g. type: ['string', 'null']). Measured (gpt-4o, 24 runs): load-bearing fields stayed filled 24/24 under this rewrite, while a low-salience optional shifted to null 21/24 — so consumers must treat null as equivalent to absent${fixOwnerHint(ctx.subject)}`,
408
+ });
409
+ }
249
410
  }
250
- walkNode(propSchema, propPath, ctx);
411
+ else if (openai && isNullUnion) {
412
+ ctx.nullUnionCount += 1;
413
+ }
414
+ walkNode(propSchema, propPath, ctx, depth + 1);
251
415
  }
252
416
  }
253
417
  const items = node['items'];
254
418
  if (items !== undefined)
255
- walkNode(items, joinPath(path, 'items'), ctx);
419
+ walkNode(items, joinPath(path, 'items'), ctx, depth + 1);
256
420
  for (const branchKey of ['anyOf', 'allOf']) {
257
421
  const branches = node[branchKey];
258
422
  if (Array.isArray(branches)) {
259
- branches.forEach((b, i) => walkNode(b, joinPath(path, `${branchKey}[${i}]`), ctx));
423
+ branches.forEach((b, i) => walkNode(b, joinPath(path, `${branchKey}[${i}]`), ctx, depth + 1));
260
424
  }
261
425
  }
262
426
  for (const defsKey of ['$defs', 'definitions']) {
@@ -299,6 +463,9 @@ export function assessStructuredOutputEligibility(input) {
299
463
  const subject = phaseB
300
464
  ? (input.subject ?? 'step_output')
301
465
  : 'step_output';
466
+ // Phase A is provider-blind by design (authoring cannot know the drive-time provider), so it
467
+ // always assesses under the default profile — separation in TIME, not a trade-off.
468
+ const profile = phaseB ? (input.profile ?? 'anthropic') : 'anthropic';
302
469
  const toolsFlag = phaseB
303
470
  ? input.tools === true
304
471
  : Array.isArray(input.tools) && input.tools.length > 0;
@@ -377,21 +544,63 @@ export function assessStructuredOutputEligibility(input) {
377
544
  unionCount: 0,
378
545
  seenUnenforcedKeywords: new Set(),
379
546
  subject,
547
+ profile,
548
+ maxDepthSeen: 0,
549
+ propertyCount: 0,
550
+ charCount: 0,
551
+ maxEnumValuesSeen: 0,
552
+ nullUnionCount: 0,
380
553
  };
381
554
  walkNode(schema, '', ctx);
382
- if (ctx.optionalCount > 24) {
383
- ctx.hardReasons.push({
384
- code: 'too_many_optionals',
385
- path: '',
386
- remediation: `this schema has ${ctx.optionalCount} optional properties (limit: 24) — reduce the optional-property count or make more fields required`,
387
- });
555
+ // The two size caps below are ANTHROPIC's (G3). OpenAI publishes no strict-count or optional
556
+ // budget at all; its limits are structural size limits, applied instead — see below.
557
+ if (profile === 'anthropic') {
558
+ if (ctx.optionalCount > 24) {
559
+ ctx.hardReasons.push({
560
+ code: 'too_many_optionals',
561
+ path: '',
562
+ remediation: `this schema has ${ctx.optionalCount} optional properties (limit: 24) — reduce the optional-property count or make more fields required`,
563
+ });
564
+ }
565
+ if (ctx.unionCount > 16) {
566
+ ctx.hardReasons.push({
567
+ code: 'too_many_unions',
568
+ path: '',
569
+ remediation: `this schema has ${ctx.unionCount} union-typed properties (limit: 16) — reduce the anyOf/multi-type property count`,
570
+ });
571
+ }
388
572
  }
389
- if (ctx.unionCount > 16) {
390
- ctx.hardReasons.push({
391
- code: 'too_many_unions',
392
- path: '',
393
- remediation: `this schema has ${ctx.unionCount} union-typed properties (limit: 16) — reduce the anyOf/multi-type property count`,
394
- });
573
+ else {
574
+ // issue #313 — OpenAI's documented size limits (depth boundary and enum-count boundary both
575
+ // executed against the live API; the other two are documented and untested at that scale).
576
+ if (ctx.maxDepthSeen > OPENAI_LIMITS.maxDepth) {
577
+ ctx.hardReasons.push({
578
+ code: 'exceeds_provider_limit',
579
+ path: '',
580
+ remediation: `this schema nests ${ctx.maxDepthSeen} levels deep (OpenAI strict limit: ${OPENAI_LIMITS.maxDepth}) — flatten the deepest branch`,
581
+ });
582
+ }
583
+ if (ctx.propertyCount > OPENAI_LIMITS.maxProperties) {
584
+ ctx.hardReasons.push({
585
+ code: 'exceeds_provider_limit',
586
+ path: '',
587
+ remediation: `this schema declares ${ctx.propertyCount} properties (OpenAI strict limit: ${OPENAI_LIMITS.maxProperties}) — split the schema or drop properties`,
588
+ });
589
+ }
590
+ if (ctx.charCount > OPENAI_LIMITS.maxChars) {
591
+ ctx.hardReasons.push({
592
+ code: 'exceeds_provider_limit',
593
+ path: '',
594
+ remediation: `this schema's property names, enum values and const values total ${ctx.charCount} characters (OpenAI strict limit: ${OPENAI_LIMITS.maxChars}) — shorten names or reduce enum members`,
595
+ });
596
+ }
597
+ if (ctx.maxEnumValuesSeen > OPENAI_LIMITS.maxEnumValues) {
598
+ ctx.hardReasons.push({
599
+ code: 'exceeds_provider_limit',
600
+ path: '',
601
+ remediation: `an enum in this schema has ${ctx.maxEnumValuesSeen} values (OpenAI strict limit: ${OPENAI_LIMITS.maxEnumValues}) — reduce the enum or model the field as a plain string`,
602
+ });
603
+ }
395
604
  }
396
605
  if (ctx.hardReasons.length > 0) {
397
606
  return {
@@ -406,7 +615,18 @@ export function assessStructuredOutputEligibility(input) {
406
615
  // (benchmark-raw.md §Run 2) — emission propensity is schema-shape-dependent, so this is a
407
616
  // general caveat, not a reasoning-specific rule. The nudge additionally names the
408
617
  // reasoning-position instance as the sharpest example (validate.ts).
409
- if (ctx.optionalCount > 0) {
618
+ // issue #313: G7' is ANTHROPIC-ONLY. Under OpenAI every property must be required, so a
619
+ // schema that reaches this point has no optionals at all and the omission hazard G7' warns
620
+ // about is structurally impossible. What replaces it is the MEASURED null-propensity of
621
+ // null-union properties — a different hazard needing different words and different numbers.
622
+ if (profile === 'openai' && ctx.nullUnionCount > 0) {
623
+ ctx.caveats.push({
624
+ code: 'null_union_emission',
625
+ path: '',
626
+ remediation: `this schema has ${ctx.nullUnionCount} null-union propert${ctx.nullUnionCount === 1 ? 'y' : 'ies'} (the OpenAI-sanctioned way to say "may be absent"). Measured over 24 real inputs: on gpt-4o a load-bearing field stayed filled 24/24 under strict, while a low-salience field shifted to null 21/24 (on gpt-4o-mini, 3/24 vs its own 2/24 unconstrained omission rate) — so a null here means "the model had nothing to say", not "the field is broken". Consumers MUST treat null as equivalent to absent${fixOwnerHint(ctx.subject)}`,
627
+ });
628
+ }
629
+ if (profile === 'anthropic' && ctx.optionalCount > 0) {
410
630
  ctx.caveats.push({
411
631
  code: 'optional_emission',
412
632
  path: '',
@@ -428,6 +648,10 @@ export function assessStructuredOutputEligibility(input) {
428
648
  /** Renders a step's structured_output declaration into a plain-English author message, combining
429
649
  * every reason's own remediation (`; `-joined) — the shared formatter both the loader's typed
430
650
  * error and create_workflow's PRE-register rejection use, so the two surfaces never drift. */
651
+ // Issue #313: the parameter is widened ADDITIVELY to the structural minimum this function has
652
+ // always used, so CAVEATS can feed it too (the drive-time remediation nudge prints for
653
+ // ineligible AND caveated verdicts). Every existing caller passes `StructuredOutputReason[]`,
654
+ // which remains assignable — verified at all three: validate.ts, create-workflow.ts, yaml-loader.ts.
431
655
  export function renderIneligibleMessage(reasons) {
432
656
  return reasons.map((r) => r.remediation).join('; ');
433
657
  }
@@ -1 +1 @@
1
- {"version":3,"file":"structured-output-eligibility.js","sourceRoot":"","sources":["../../src/workflow/structured-output-eligibility.ts"],"names":[],"mappings":"AA0GA,SAAS,QAAQ,CAAC,KAAgC;IAChD,OAAO,QAAQ,IAAI,KAAK,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IAC/C,MAAM;IACN,YAAY;IACZ,OAAO;IACP,aAAa;IACb,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,+FAA+F;IAC/F,uFAAuF;IACvF,gGAAgG;IAChG,8FAA8F;IAC9F,0FAA0F;IAC1F,6FAA6F;IAC7F,0FAA0F;IAC1F,MAAM;IACN,aAAa;IACb,SAAS;IACT,UAAU;IACV,sBAAsB;IACtB,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AAEH,0FAA0F;AAC1F,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,WAAW;IACX,MAAM;IACN,MAAM;IACN,UA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AC;QAC3B,OAAO;YACL,OAAO,EAAE,uBAAuB;YAChC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,cAAc,EAAE,GAAG,CAAC,aAAa;SAClC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;AACpE,CAAC;AAED;;+FAE+F;AAC/F,MAAM,UAAU,uBAAuB,CAAC,OAAiC;IACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"structured-output-eligibility.js","sourceRoot":"","sources":["../../src/workflow/structured-output-eligibility.ts"],"names":[],"mappings":"AAuIA,SAAS,QAAQ,CAAC,KAAgC;IAChD,OAAO,QAAQ,IAAI,KAAK,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IAC/C,MAAM;IACN,YAAY;IACZ,OAAO;IACP,aAAa;IACb,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,+FAA+F;IAC/F,uFAAuF;IACvF,gGAAgG;IAChG,8FAA8F;IAC9F,0FAA0F;IAC1F,6FAA6F;IAC7F,0FAA0F;IAC1F,MAAM;IACN,aAAa;IACb,SAAS;IACT,UAAU;IACV,sBAAsB;IACtB,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AAEH,0FAA0F;AAC1F,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,WAAW;IACX,MAAM;IACN,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH;iGACiG;AACjG,MAAM,gBAAgB,GAAG,IA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jD,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B;IAAE,UAAU,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,kBAAkB,CAMpB;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,iBAAiB,GAC3B;IAAE,UAAU,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,CAE/D"}
@@ -6,7 +6,7 @@ import { load } from 'js-yaml';
6
6
  import { Ajv } from 'ajv';
7
7
  import { KNOWN_STEP_KEYS, KNOWN_WORKFLOW_KEYS, KNOWN_RETRY_KEYS, KNOWN_GATE_KEYS, } from '../types/workflow-definition.js';
8
8
  import { WorkflowError } from '../types/workflow-error.js';
9
- import { findUnknownKeys, renderLoaderWarning, resolveSeverity, } from './diagnostics.js';
9
+ import { findUnknownKeys, renderLoaderWarning, resolveSeverity, closestKey, } from './diagnostics.js';
10
10
  import { resolveTemplates } from './template-resolver.js';
11
11
  import { normalizeTriggerFilter, validateTriggerStructure } from './trigger-schema.js';
12
12
  import { splitComparison, isPathShaped } from '../engine/comparison-expr.js';
@@ -1489,6 +1489,12 @@ function hasUseTemplateInSteps(steps) {
1489
1489
  * Every leaf must be a non-empty string.
1490
1490
  * Maximum depth is 10.
1491
1491
  */
1492
+ /**
1493
+ * Issue #287: the CLOSED set of input_map directives. The whole `$` prefix is reserved — a key
1494
+ * starting with `$` that is not in this set is a load error, which is what keeps the namespace
1495
+ * open for a future escape (e.g. key-doubling) without breaking anyone.
1496
+ */
1497
+ const SUPPORTED_INPUT_MAP_DIRECTIVES = ['$literal'];
1492
1498
  function validateInputMapNode(node, pathDesc, errors, depth) {
1493
1499
  if (depth > 10) {
1494
1500
  errors.push(`${pathDesc}: exceeded maximum nesting depth of 10`);
@@ -1513,6 +1519,31 @@ function validateInputMapNode(node, pathDesc, errors, depth) {
1513
1519
  // is a literal subtree, not a nested template. Return without further validation.
1514
1520
  return;
1515
1521
  }
1522
+ // issue #287 — the DIRECTIVE GATE. A `$`-prefixed key is unambiguous author intent: nobody
1523
+ // writes a nested-map key starting with `$` by accident. Before this gate, an unknown one was
1524
+ // accepted here, then resolved at runtime as a context PATH, yielding `undefined` — a param
1525
+ // that looked set and was not. That produced a five-week production incident in which an
1526
+ // Airtable query ran UNFILTERED and corrupted 907 records while every step reported success.
1527
+ //
1528
+ // The whole `$` prefix is reserved, not just the known names: erroring on `$$…` today is what
1529
+ // keeps a future key-doubling ESCAPE backward-compatible, so this must stay a prefix check
1530
+ // with no special cases. The wording says "supported directives:" rather than "the only
1531
+ // escape", for the same reason.
1532
+ //
1533
+ // Placed AFTER the `$literal` block so `{$literal, $unknown}` still reports the sibling error
1534
+ // first (that message names the more specific mistake), and BEFORE the nested-object
1535
+ // recursion so the key is judged here rather than descended into.
1536
+ for (const key of Object.keys(obj)) {
1537
+ if (!key.startsWith('$'))
1538
+ continue;
1539
+ const suggestion = closestKey(key, SUPPORTED_INPUT_MAP_DIRECTIVES);
1540
+ errors.push(`${pathDesc}: unknown directive '${key}' — supported directives: $literal.` +
1541
+ (suggestion !== undefined ? ` Did you mean '${suggestion}'?` : '') +
1542
+ ` To pass literal data containing $-keys, wrap the subtree in $literal.` +
1543
+ ` input_map values are context paths, nested maps, or $literal — templated strings are` +
1544
+ ` not supported.`);
1545
+ return;
1546
+ }
1516
1547
  // Nested object — recurse.
1517
1548
  const entries = Object.entries(obj);
1518
1549
  if (entries.length === 0) {