@vaudience/aigentflow-flow-validator 0.26.0 → 0.27.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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/parse.ts","../src/validators/util.ts","../src/validators/basicStructure.ts","../src/spec/aigentflow-spec.json","../src/spec/index.ts","../src/validators/executors.ts","../src/validators/querySchema.ts","../src/validators/responseExpectation.ts","../src/validators/errorStrategy.ts","../src/validators/connectivity.ts","../src/validators/nextLogic.ts","../src/validators/expressionFunctions.ts","../src/validators/loopForEachThrottle.ts","../src/validators/orchestratorCampaign.ts","../src/validators/credentialBindings.ts","../src/validators/inputSchema.ts","../src/validators/reservedInputs.ts","../src/validators/outputSchema.ts","../src/validators/qualityGate.ts","../src/template/gotmpl-syntax.ts","../src/template/gotmpl-default.ts","../src/validators/processingOperations.ts","../src/validators/templates.ts","../src/validators/stepMaxDuration.ts","../src/validators/retiredKeys.ts","../src/validators/flowDataKeys.ts","../src/validators/saveDoor.ts","../src/validators/unknownKeys.ts","../src/validators/executorConfigEnv.ts","../src/validators/serverOwnedQueryKeys.ts","../src/validators/goUrl.ts","../src/validators/credentialEndpoint.ts","../src/validators/exons.ts","../src/validators/complianceResidency.ts","../src/validators/examples.ts","../src/index.ts"],"names":["q","TYPE_ARRAY","RESERVED_STEP_ID_CHAR","mismatch","k","quote","walkStrings","goQuote","TEMPLATE_ACTION_OPEN","CODE_UNKNOWN_YAML_KEY","CODE","formatField","KEY_EXECUTOR_CONFIG","KEY_QUERY","KEY_ID","MAX_ALIAS_COUNT","GO_SPACE","goTrimSpace","isMap","isSeq","isScalar","own","TYPE_FILE","TYPE_NUMBER","TYPE_ENUM","TYPE_ARRAY_OF_STRINGS","utf8Encoder","names"],"mappings":";;;AASA,IAAM,eAAA,GAAkB,GAAA;AA2BxB,SAAS,iBAAiB,IAAA,EAA8B;AACtD,EAAA,IAAI,CAAC,QAAA,CAA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;AAAA;AAC9E,GACF;AACF;AAOO,SAAS,YAAA,CAAa,QAAA,EAAkB,IAAA,GAAwB,EAAC,EAAqB;AAC3F,EAAA,MAAM,MAAA,GAAsB,UAAU,QAAQ,CAAA;AAE9C,EAAA,IAAI,OAAO,WAAA,CAAY,MAAA,GAAS,CAAA,IAAK,MAAA,CAAO,SAAS,MAAA,EAAW;AAC9D,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,KAAA;AAAA,MACP,QAAQ,MAAA,CAAO,WAAA;AAAA,MACf,UAAU,MAAA,CAAO,aAAA;AAAA,MACjB,OAAA,EAAS;AAAA,QACP,UAAA,EAAY,CAAA;AAAA,QACZ,UAAA,EAAY,CAAA;AAAA,QACZ,UAAA,EAAY,OAAO,WAAA,CAAY,MAAA;AAAA,QAC/B,YAAA,EAAc,OAAO,aAAA,CAAc,MAAA;AAAA,QACnC,cAAA,EAAgB,CAAA;AAAA,QAChB,cAAA,EAAgB;AAAA;AAClB,KACF;AAAA,EACF;AAEA,EAAA,MAAM,SAAS,cAAA,CAAe,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,OAAO,aAAa,CAAA;AAErE,EAAA,IAAI,MAAA,CAAO,aAAA,CAAc,MAAA,GAAS,CAAA,EAAG;AACnC,IAAA,MAAA,CAAO,QAAA,CAAS,OAAA,CAAQ,GAAG,MAAA,CAAO,aAAa,CAAA;AAC/C,IAAA,MAAA,CAAO,OAAA,CAAQ,YAAA,GAAe,MAAA,CAAO,QAAA,CAAS,MAAA;AAAA,EAChD;AACA,EAAA,OAAO,MAAA;AACT","file":"index.js","sourcesContent":["// YAML → object parsing with structured, positioned errors.\n//\n// Uses the `yaml` package (pure JS, browser-safe). Duplicate keys and syntax\n// errors are surfaced as ValidationIssues with line/column when available.\n// Alias expansion is capped to guard against \"billion laughs\" style payloads.\n\nimport { isMap, isScalar, isSeq, parseDocument, type YAMLError, type YAMLWarning } from 'yaml';\nimport type { Flow, ValidationIssue } from './types.js';\n\nconst MAX_ALIAS_COUNT = 100;\n\n/** Result of parsing flow YAML. */\nexport interface ParseOutput {\n /** The parsed flow object, present only when there are no parse errors. */\n flow?: Flow;\n /** Fatal YAML syntax / structure errors. Non-empty means `flow` is absent. */\n parseErrors: ValidationIssue[];\n /** Non-fatal YAML warnings (e.g. deprecated tags). */\n parseWarnings: ValidationIssue[];\n /**\n * The SOURCE spelling of every number and boolean scalar, keyed by field path\n * (`mock_scenarios.s.fetch.delay`). The reference decodes a scalar into a Go\n * `string` field as its source text, so `delay: 0.0` arrives there as \"0.0\"\n * (not a Go duration) while the parsed value here is the number 0. Present\n * whenever `flow` is.\n */\n scalarSources?: ReadonlyMap<string, string>;\n}\n\n/**\n * The text a Go `string` receives for a scalar node: its source spelling. The\n * `yaml` package keeps it on `Scalar.source` (the scalar's text after quote and\n * escape processing), while `Scalar.value` is the resolved number or boolean —\n * `1.0` → 1, `0x1F` → 31, `True` → true, `-0` → -0. null when the node is not a\n * scalar, or is a YAML null (a null is absent, not text).\n */\nfunction scalarSourceText(node: unknown): string | null {\n if (!isScalar(node) || node.value === null) return null;\n if (typeof node.source === 'string') return node.source;\n return typeof node.value === 'string' ? node.value : null;\n}\n\n/**\n * Give every number or boolean mapping KEY its source text, before the\n * document is converted. That is what the reference stores: its step table is\n * a `map[string]*StepDefinition`, and yaml.v3 fills a Go `string` from any\n * scalar by its text, so `1e3:` is the step \"1e3\", `0x1F:` is \"0x1F\", `True:`\n * is \"True\". Converting the resolved key instead gives \"1000\", \"31\", \"true\",\n * and a reference written `next: { default: 1e3 }` no longer matches its own\n * step. Null keys, merge keys (`<<`, a string) and complex keys are left alone.\n */\nfunction retagScalarKeys(node: unknown): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n const key = pair.key;\n if (\n isScalar(key) &&\n (typeof key.value === 'number' || typeof key.value === 'boolean') &&\n typeof key.source === 'string'\n ) {\n key.value = key.source;\n }\n retagScalarKeys(key);\n retagScalarKeys(pair.value);\n }\n } else if (isSeq(node)) {\n for (const item of node.items) retagScalarKeys(item);\n }\n}\n\n/**\n * Duplicate-key identity, as yaml.v3 decides it: two scalar keys collide when\n * their TEXT is equal, not their resolved value — `1:` and `1.0:` are two\n * steps there (\"1\" and \"1.0\"), and `\"1\":` and `1:` are one. The `yaml`\n * package's default compares resolved values, which would refuse the first.\n */\nfunction sameKeyText(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (!isScalar(a) || !isScalar(b)) return false;\n const ta = scalarSourceText(a);\n const tb = scalarSourceText(b);\n if (ta === null || tb === null) return a.value === b.value;\n return ta === tb;\n}\n\n/**\n * Record the source text of each plain number/boolean scalar under the field\n * path the validators use. Runs after {@link retagScalarKeys}, so a path\n * segment is a key's source text too. Aliases are not followed: a value\n * reached through one keeps its parsed rendering, which differs only for\n * spellings such as `0.0` (see PARITY.md).\n */\nfunction collectScalarSources(node: unknown, path: string, out: Map<string, string>): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n const key = isScalar(pair.key) ? String(pair.key.value) : null;\n if (key === null) continue;\n collectScalarSources(pair.value, path === '' ? key : `${path}.${key}`, out);\n }\n } else if (isSeq(node)) {\n node.items.forEach((item, i) => collectScalarSources(item, `${path}[${i}]`, out));\n } else if (isScalar(node)) {\n const v = node.value;\n if ((typeof v === 'number' || typeof v === 'boolean') && typeof node.source === 'string') {\n out.set(path, node.source);\n }\n }\n}\n\nfunction issueFromYamlError(\n err: YAMLError | YAMLWarning,\n severity: 'error' | 'warning',\n): ValidationIssue {\n const issue: ValidationIssue = {\n field: '',\n message: err.message,\n code: err.name === 'YAMLParseError' ? 'yaml_syntax_error' : 'yaml_warning',\n severity,\n };\n const pos = err.linePos?.[0];\n if (pos) {\n issue.line = pos.line;\n issue.column = pos.col;\n }\n // The `yaml` package uses specific codes (e.g. DUPLICATE_KEY); preserve them\n // for callers that key off `code`.\n if (err.code) {\n issue.code = err.code === 'DUPLICATE_KEY' ? 'duplicate_key' : issue.code;\n }\n return issue;\n}\n\n/**\n * Parse flow YAML into a {@link Flow} object plus structured parse diagnostics.\n * Never throws — malformed input is reported via `parseErrors`.\n */\nexport function parseFlow(yamlText: string): ParseOutput {\n const parseErrors: ValidationIssue[] = [];\n const parseWarnings: ValidationIssue[] = [];\n\n if (typeof yamlText !== 'string' || yamlText.trim() === '') {\n parseErrors.push({\n field: '',\n message: 'Flow YAML is empty',\n code: 'empty_document',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n let doc;\n try {\n // `merge: true`: the reference's yaml.v3 honours `<<: *anchor` merge keys,\n // and without it `<<` survives as a literal key, which the unknown-key rule\n // would refuse on a flow the reference saves.\n doc = parseDocument(yamlText, { prettyErrors: true, uniqueKeys: sameKeyText, merge: true });\n } catch (e) {\n parseErrors.push({\n field: '',\n message: `YAML parse error: ${e instanceof Error ? e.message : String(e)}`,\n code: 'yaml_syntax_error',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n for (const err of doc.errors) {\n parseErrors.push(issueFromYamlError(err, 'error'));\n }\n for (const warn of doc.warnings) {\n parseWarnings.push(issueFromYamlError(warn, 'warning'));\n }\n if (parseErrors.length > 0) {\n return { parseErrors, parseWarnings };\n }\n\n retagScalarKeys(doc.contents);\n let value: unknown;\n try {\n value = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n } catch (e) {\n parseErrors.push({\n field: '',\n message: `YAML resolution error: ${e instanceof Error ? e.message : String(e)}`,\n code: 'yaml_syntax_error',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n parseErrors.push({\n field: '',\n message: 'Flow must be a YAML mapping at the top level',\n code: 'invalid_flow_root',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n const scalarSources = new Map<string, string>();\n collectScalarSources(doc.contents, '', scalarSources);\n return { flow: value as Flow, parseErrors, parseWarnings, scalarSources };\n}\n","// Shared helpers for the validator modules: an issue collector and a handful\n// of defensive type guards. User YAML is arbitrary, so every validator treats\n// the parsed document as `unknown` and narrows explicitly.\n\nimport type { ValidationIssue } from '../types.js';\n\n/**\n * Accumulates errors and warnings during a validation pass, and carries the\n * pass's scalar source spellings so every rule reads a Go `string` field the\n * same way ({@link Issues.stringAt}).\n */\nexport class Issues {\n readonly errors: ValidationIssue[] = [];\n readonly warnings: ValidationIssue[] = [];\n\n /**\n * @param sources source spellings of number/boolean scalars by field path,\n * present when the document was parsed from YAML text (see parse.ts).\n */\n constructor(readonly sources?: ScalarSources) {}\n\n /**\n * THE reader for every value the reference decodes into a Go `string` field\n * — a step reference (`next.default: 2` is the step \"2\"), an enum\n * (`action: 1` is the invalid action \"1\", not an absent one), a name, a\n * duration. yaml.v3 fills such a field from ANY scalar by its source text, so\n * a number or boolean is returned as that text. null for an absent value, a\n * YAML null, a mapping or a list — the only things that are \"not a string\".\n *\n * Reading such a value with `isString` made a number either invisible (an\n * existence check skipped: looser than the reference) or absent (a present\n * step reported missing: stricter).\n */\n stringAt(v: unknown, path: string): string | null {\n if (v === null || v === undefined) return null;\n return scalarTextAt(v, path, this.sources);\n }\n\n /** {@link stringAt} for `m[key]`, where `parentPath` is `m`'s own field path. */\n stringOf(m: object, key: string, parentPath: string): string | null {\n const v = (m as Record<string, unknown>)[key];\n return this.stringAt(v, parentPath === '' ? key : `${parentPath}.${key}`);\n }\n\n /** A present, non-empty Go `string` field (`name: 123` is present). */\n nonEmptyStringOf(m: object, key: string, parentPath: string): boolean {\n const s = this.stringOf(m, key, parentPath);\n return s !== null && s !== '';\n }\n\n error(issue: Omit<ValidationIssue, 'severity'>): void {\n this.errors.push({ ...issue, severity: 'error' });\n }\n\n warn(issue: Omit<ValidationIssue, 'severity'>): void {\n this.warnings.push({ ...issue, severity: 'warning' });\n }\n}\n\nexport function isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === 'object' && v !== null && !Array.isArray(v);\n}\n\nexport function isString(v: unknown): v is string {\n return typeof v === 'string';\n}\n\nexport function isArray(v: unknown): v is unknown[] {\n return Array.isArray(v);\n}\n\n/** A finite number (excludes NaN / Infinity), matching YAML numeric scalars. */\nexport function isNumber(v: unknown): v is number {\n return typeof v === 'number' && Number.isFinite(v);\n}\n\nexport function isInteger(v: unknown): v is number {\n return isNumber(v) && Number.isInteger(v);\n}\n\n/** Sorted list of step keys, used for \"available steps\" context messages. */\nexport function stepNames(steps: Record<string, unknown>): string[] {\n return Object.keys(steps).sort();\n}\n\n/**\n * The text a Go `string` field receives for a YAML scalar, or null for a value\n * that is not a scalar. yaml.v3 decodes ANY scalar into a string field, so\n * `delay: 100` arrives as \"100\" and `tool_discovery: true` as \"true\"; a YAML\n * null decodes to \"\". The parsed document has lost the source spelling, so a\n * number is rendered the way JavaScript renders it — which differs from the\n * source only for spellings such as `0.0`, `00` or `0x0` (see PARITY.md).\n */\nexport function scalarText(v: unknown): string | null {\n if (v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n return null;\n}\n\n/** Source spellings of number/boolean scalars by field path (see parse.ts). */\nexport type ScalarSources = ReadonlyMap<string, string>;\n\n/**\n * {@link scalarText}, but a number or boolean is rendered by its SOURCE\n * spelling when the document was parsed from text — which is exactly what the\n * reference's `string` field receives. `delay: 0.0` is \"0.0\" here (no unit, so\n * not a Go duration), not \"0\". Without `sources` it falls back to the parsed\n * value's rendering.\n */\nexport function scalarTextAt(\n v: unknown,\n path: string,\n sources: ScalarSources | undefined,\n): string | null {\n if ((typeof v === 'number' || typeof v === 'boolean') && sources !== undefined) {\n const source = sources.get(path);\n if (source !== undefined) return source;\n }\n return scalarText(v);\n}\n\n/**\n * Parse a Go `time.ParseDuration` string. Returns the duration in nanoseconds\n * or null when the string is not a valid Go duration.\n *\n * A line-for-line port of Go's `time.ParseDuration` (`time/format.go`),\n * including its integer overflow rules, so the verdict is exact rather than\n * approximate at the int64 boundary: an optional sign, then one or more\n * `[0-9]*(\\.[0-9]*)?<unit>` groups with digits on at least one side of the\n * point, units \"ns\", \"us\"/\"µs\"/\"μs\", \"ms\", \"s\", \"m\", \"h\". A bare \"0\" (after\n * the sign) needs no unit. The unit is the longest run of characters that are\n * not a digit or \".\", so \"5m \" has the unknown unit \"m \".\n */\nconst GO_DURATION_UNITS: Record<string, bigint> = {\n ns: 1n,\n us: 1_000n,\n // U+00B5 MICRO SIGN and U+03BC GREEK SMALL LETTER MU are both accepted by Go.\n µs: 1_000n,\n μs: 1_000n,\n ms: 1_000_000n,\n s: 1_000_000_000n,\n m: 60_000_000_000n,\n h: 3_600_000_000_000n,\n};\n\n/** 1<<63: Go's time.Duration is an int64. */\nconst GO_INT64_LIMIT = 1n << 63n;\nconst GO_INT64_MAX = GO_INT64_LIMIT - 1n;\n\nfunction isDigit(c: string | undefined): boolean {\n return c !== undefined && c >= '0' && c <= '9';\n}\n\n/** Go's leadingInt: consume [0-9]*, or null on overflow past 1<<63. */\nfunction leadingInt(s: string): { x: bigint; rest: string } | null {\n let x = 0n;\n let i = 0;\n for (; i < s.length && isDigit(s[i]); i++) {\n if (x > GO_INT64_LIMIT / 10n) return null;\n x = x * 10n + BigInt(s.charCodeAt(i) - 48);\n if (x > GO_INT64_LIMIT) return null;\n }\n return { x, rest: s.slice(i) };\n}\n\n/** Go's leadingFraction: consume [0-9]*, silently dropping digits past overflow. */\nfunction leadingFraction(s: string): { x: bigint; scale: number; rest: string } {\n let x = 0n;\n let scale = 1;\n let overflow = false;\n let i = 0;\n for (; i < s.length && isDigit(s[i]); i++) {\n if (overflow) continue;\n if (x > GO_INT64_MAX / 10n) {\n overflow = true;\n continue;\n }\n const y = x * 10n + BigInt(s.charCodeAt(i) - 48);\n if (y > GO_INT64_LIMIT) {\n overflow = true;\n continue;\n }\n x = y;\n scale *= 10;\n }\n return { x, scale, rest: s.slice(i) };\n}\n\nexport function parseGoDuration(input: string): number | null {\n let s = input;\n let neg = false;\n if (s !== '' && (s[0] === '-' || s[0] === '+')) {\n neg = s[0] === '-';\n s = s.slice(1);\n }\n if (s === '0') return 0;\n if (s === '') return null;\n\n let d = 0n;\n while (s !== '') {\n // The next character must be [0-9.].\n if (!(s[0] === '.' || isDigit(s[0]))) return null;\n const before = s.length;\n const lead = leadingInt(s);\n if (lead === null) return null;\n let v = lead.x;\n s = lead.rest;\n const pre = before !== s.length;\n\n let f = 0n;\n let scale = 1;\n let post = false;\n if (s !== '' && s[0] === '.') {\n s = s.slice(1);\n const fracBefore = s.length;\n const frac = leadingFraction(s);\n f = frac.x;\n scale = frac.scale;\n s = frac.rest;\n post = fracBefore !== s.length;\n }\n if (!pre && !post) return null;\n\n let i = 0;\n while (i < s.length && !(s[i] === '.' || isDigit(s[i]))) i++;\n if (i === 0) return null; // missing unit\n const unit = GO_DURATION_UNITS[s.slice(0, i)];\n s = s.slice(i);\n if (unit === undefined) return null; // unknown unit\n\n if (v > GO_INT64_LIMIT / unit) return null;\n v *= unit;\n if (f > 0n) {\n // Go computes this term in float64 and truncates it; so does this.\n v += BigInt(Math.trunc(Number(f) * (Number(unit) / scale)));\n if (v > GO_INT64_LIMIT) return null;\n }\n d += v;\n if (d > GO_INT64_LIMIT) return null;\n }\n if (neg) return -Number(d);\n if (d > GO_INT64_MAX) return null;\n return Number(d);\n}\n\nexport function isValidGoDuration(input: string): boolean {\n return parseGoDuration(input) !== null;\n}\n","// Required top-level fields, step-map shape, per-step executor requirement,\n// and the two reserved step-ID rules (the `.` character, the id `orchestrator`).\n//\n// Mirrors `validateBasicStructure` (validation.go) and the structural head of\n// `FlowParser.ValidateFlow` (parser.go). Because YAML can produce any shape,\n// this module also emits `invalid_type` errors where the Go struct decoder\n// would have failed at unmarshal time.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, stepNames } from './util.js';\n\n// Reserved in step IDs: the engine uses \"parent.child\" as the composite ID for\n// loop sub-steps, so a literal \".\" in a top-level step ID is rejected.\nconst RESERVED_STEP_ID_CHAR = '.';\nconst RESERVED_STEP_ID_ORCHESTRATOR = 'orchestrator';\n\n// Upper bound of the optional `display_name`, counted in Unicode code points\n// (Go's utf8.RuneCountInString), never in UTF-16 units.\nconst DISPLAY_NAME_MAX_LEN = 80;\n\n// The YAML 1.1 boolean spellings yaml.v3 still accepts for a Go `bool` field when\n// they are written as a plain (unquoted) scalar. This port cannot tell a quoted\n// scalar from a plain one, so it accepts them either way (the looser direction).\nconst YAML11_BOOL_WORDS: ReadonlySet<string> = new Set(\n ['y', 'yes', 'on', 'n', 'no', 'off'].flatMap((w) => [\n w,\n w.toUpperCase(),\n w[0]!.toUpperCase() + w.slice(1),\n ]),\n);\n\n/** A Go `bool` field: a boolean, a YAML null (zero value) or a YAML 1.1 word. */\nfunction isBoolLike(v: unknown): boolean {\n if (v === null || typeof v === 'boolean') return true;\n return typeof v === 'string' && YAML11_BOOL_WORDS.has(v);\n}\n\nexport function validateBasicStructure(flow: Flow, issues: Issues): void {\n if (!issues.nonEmptyStringOf(flow, 'aigentflow_version', '')) {\n issues.error({\n field: 'aigentflow_version',\n message: 'AIgentFlow version is required',\n code: 'missing_required_field',\n suggestion: 'Add \\'aigentflow_version: \"2.0.0\"\\' to your flow',\n });\n }\n\n if (!issues.nonEmptyStringOf(flow, 'name', '')) {\n issues.error({\n field: 'name',\n message: 'Flow name is required',\n code: 'missing_required_field',\n suggestion: 'Add a descriptive name to your flow',\n });\n }\n\n // Optional human-friendly label. Absent or empty is fine; only length is judged.\n const displayName = issues.stringOf(flow, 'display_name', '');\n if (displayName !== null) {\n const n = [...displayName].length;\n if (n > DISPLAY_NAME_MAX_LEN) {\n issues.error({\n field: 'display_name',\n message: `display_name is ${n} characters; the limit is ${DISPLAY_NAME_MAX_LEN}`,\n code: 'display_name_too_long',\n suggestion: \"Shorten display_name; it is a label, put prose in 'description'\",\n });\n }\n }\n\n // Optional opt-in to fail a render that reads a missing key. A Go `bool`: the\n // engine's behaviour is out of scope here, only the value's kind is judged.\n if (flow.strict_templates !== undefined && !isBoolLike(flow.strict_templates)) {\n issues.error({\n field: 'strict_templates',\n message: 'strict_templates must be a boolean (true or false)',\n code: 'invalid_type',\n suggestion: \"Write 'strict_templates: true' or remove the key\",\n });\n }\n\n // A Go `string`: `start: 1` names the step \"1\".\n const start = issues.stringOf(flow, 'start', '');\n if (start === null || start === '') {\n issues.error({\n field: 'start',\n message: 'Start step is required',\n code: 'missing_required_field',\n suggestion: 'Specify which step should execute first',\n });\n }\n\n const steps = flow.steps;\n if (steps === undefined || steps === null) {\n issues.error({\n field: 'steps',\n message: 'At least one step is required',\n code: 'missing_required_field',\n suggestion: 'Define steps for your workflow',\n });\n return;\n }\n if (!isRecord(steps)) {\n issues.error({\n field: 'steps',\n message: 'steps must be a mapping of step ID to step definition',\n code: 'invalid_type',\n });\n return;\n }\n if (Object.keys(steps).length === 0) {\n issues.error({\n field: 'steps',\n message: 'At least one step is required',\n code: 'missing_required_field',\n suggestion: 'Define steps for your workflow',\n });\n return;\n }\n\n const names = stepNames(steps);\n\n // Start step must exist.\n if (start !== null && start !== '' && !(start in steps)) {\n issues.error({\n field: 'start',\n message: `Start step '${start}' not found in steps`,\n code: 'step_not_found',\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change start to one of: ${names.join(', ')}`,\n });\n }\n\n // Per-step structure.\n for (const [stepID, step] of Object.entries(steps)) {\n if (stepID.includes(RESERVED_STEP_ID_CHAR)) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step ID '${stepID}' must not contain '${RESERVED_STEP_ID_CHAR}' (reserved for loop sub-step IDs)`,\n code: 'reserved_step_id_char',\n stepId: stepID,\n });\n }\n\n // AIF v2.484.0 (DC-COND-1): `orchestrator` is the engine's own step id for\n // orchestrator-originated signals and a reserved `next:` marker. A worker\n // step with that id could have its soft completion signal read as the\n // mission-complete key. Case-sensitive, top-level steps only, as upstream.\n if (stepID === RESERVED_STEP_ID_ORCHESTRATOR) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step ID '${stepID}' is reserved (the orchestrator's signal namespace and a next: marker)`,\n code: 'reserved_step_id_orchestrator',\n stepId: stepID,\n suggestion: 'Rename the step',\n });\n }\n\n if (!isRecord(step)) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step '${stepID}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n\n // Loop steps define sub-steps instead of an executor.\n const hasLoop = step.loop !== undefined && step.loop !== null;\n // A number here is the reference's executor \"42\" — present, and refused by\n // the URL check (executors.ts) rather than as a type error. Only a mapping\n // or a list fails to decode into the Go `string`.\n const executor = step.executor;\n const executorText = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (!hasLoop) {\n if (executor === undefined || executor === null || executorText === '') {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'Executor is required for each step',\n code: 'missing_required_field',\n stepId: stepID,\n suggestion: \"Specify an executor URL (e.g., 'function://utils/log')\",\n });\n } else if (executorText === null) {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'Executor must be a string URL',\n code: 'invalid_type',\n stepId: stepID,\n });\n }\n }\n }\n}\n","{\n \"$comment\": \"Vendored enum surface mirrored from the AIgentFlow Go reference implementation. Regenerate / review on every flow-YAML schema change. See PARITY.md. Values here are public protocol/type names only.\",\n \"specVersion\": \"2.831.0\",\n \"inputSchemaVersion\": 1,\n \"executorSchemes\": [\n \"a2a\",\n \"agent\",\n \"ai\",\n \"aiv\",\n \"async\",\n \"atlas\",\n \"browser\",\n \"chart\",\n \"db\",\n \"deepr\",\n \"document\",\n \"e2b\",\n \"email\",\n \"eurostat\",\n \"eval\",\n \"exons\",\n \"flow\",\n \"function\",\n \"gdelt\",\n \"geocoding\",\n \"geovisualize\",\n \"getmd\",\n \"here\",\n \"homeassistant\",\n \"hosting\",\n \"http\",\n \"mcp\",\n \"messenger\",\n \"mock\",\n \"mqtt\",\n \"opencorporates\",\n \"openmeteo\",\n \"overpass\",\n \"qrcode\",\n \"reachymini\",\n \"script\",\n \"search\",\n \"shelly\",\n \"staticmap\",\n \"storage\",\n \"transform\",\n \"wait\",\n \"web\",\n \"worldbank\"\n ],\n \"dataTypes\": [\"string\", \"number\", \"integer\", \"boolean\", \"object\", \"array\", \"null\", \"binary\"],\n \"errorStrategyActions\": [\"retry\", \"fail\", \"goto\", \"continue\"],\n \"retryOnCategories\": [\n \"transient\",\n \"rate_limit\",\n \"auth\",\n \"validation\",\n \"resource\",\n \"fatal\",\n \"unknown\"\n ],\n \"nextMarkers\": [\"null\", \"orchestrator\"],\n \"reachabilityTerminalMarkers\": [\"null\", \"orchestrator\"],\n \"parallelResolutions\": [\"all-complete\", \"all-succeed\", \"first-succeed\", \"first-complete\"],\n \"forEachResolutions\": [\"all-complete\", \"all-succeed\"],\n \"loopMaxIterationsLimit\": 1000,\n \"credentialReferencePrefix\": \"stored/\",\n \"executorUrlPattern\": \"^([a-zA-Z0-9-]+)://([a-zA-Z0-9_-]+)/([a-zA-Z0-9_/-]+)$\",\n \"templateActionOpen\": \"{{\",\n \"evalJudgeUrl\": \"eval://judge/evaluate\",\n \"qualityGate\": {\n \"$comment\": \"DC-CP-8: the quality_gate: step block. on_fail 'human' exists in the Go enum but is validation-REJECTED (pending the human-task inbox), so it is NOT in onFailActions and is flagged as rejected here.\",\n \"onFailActions\": [\"fail\", \"goto\", \"retry\"],\n \"onFailRejected\": [\"human\"],\n \"thresholdMin\": 0,\n \"thresholdMax\": 1\n },\n \"inputSchema\": {\n \"types\": [\n \"string\",\n \"multiline\",\n \"number\",\n \"bool\",\n \"enum\",\n \"array_of_strings\",\n \"date\",\n \"file\",\n \"secret\"\n ],\n \"stringTypes\": [\"string\", \"multiline\", \"secret\"],\n \"parametricTypes\": [\"number\", \"enum\"],\n \"fieldNamePattern\": \"^[a-z][a-z0-9_]*$\",\n \"datePattern\": \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n \"maxPatternLength\": 512,\n \"maxConstraintValue\": 1048576,\n \"maxInputKeyCount\": 256,\n \"maxStringInputLength\": 1048576\n },\n \"orchestrator\": {\n \"modes\": [\"monitor\", \"owner\"],\n \"triggers\": [\n \"step_completed\",\n \"step_failed\",\n \"mission_started\",\n \"mission_completed\",\n \"dfm_suggestion\",\n \"timer\",\n \"request_turn\",\n \"mission_recovered\",\n \"campaign_child_completed\",\n \"campaign_child_failed\",\n \"human_response\",\n \"human_input\"\n ],\n \"tools\": [\n \"aif_step_cancel\",\n \"aif_step_start\",\n \"aif_step_inspect\",\n \"aif_conversation_manage\",\n \"aif_request_turn\",\n \"aif_checkpoint_create\",\n \"aif_mission_complete\",\n \"aif_mission_fail\",\n \"aif_ask_human\",\n \"aif_flow_list\",\n \"aif_mission_reflect\",\n \"aif_signal_complete\",\n \"aif_signal_need_human\",\n \"aif_signal_delegate\",\n \"aif_signal_need_tool\",\n \"aif_signal_modify_flow\",\n \"aif_campaign_spawn\",\n \"aif_campaign_status\",\n \"aif_campaign_results\",\n \"aif_campaign_cancel\",\n \"aif_memory_plan\",\n \"aif_memory_record\",\n \"aif_memory_recall\",\n \"aif_memory_reflect\",\n \"aif_tool_discover\",\n \"aif_tool_execute\",\n \"aif_trove_upload\",\n \"aif_trove_download\",\n \"aif_trove_list\",\n \"aif_trove_delete\",\n \"aif_e2b_sandbox_create\",\n \"aif_e2b_sandbox_execute\",\n \"aif_e2b_sandbox_files\",\n \"aif_e2b_desktop_screenshot\",\n \"aif_e2b_desktop_interact\"\n ]\n },\n \"expressionFunctions\": {\n \"namePrefix\": \"fn_\",\n \"catalog\": [\n \"fn_avg\",\n \"fn_camelCase\",\n \"fn_chunk\",\n \"fn_clamp\",\n \"fn_compact\",\n \"fn_kebabCase\",\n \"fn_max\",\n \"fn_min\",\n \"fn_padLeft\",\n \"fn_padRight\",\n \"fn_regexReplaceAll\",\n \"fn_reverse\",\n \"fn_round\",\n \"fn_sha256\",\n \"fn_slugify\",\n \"fn_snakeCase\",\n \"fn_sortStrings\",\n \"fn_sum\",\n \"fn_uniq\",\n \"fn_urldecode\"\n ]\n },\n \"processingOperations\": {\n \"$comment\": \"Pre/post-processing operation dispatch set and per-operation config keys. The key sets are PER OPERATION and must never be unioned: `asset_id` is read by binary.get/update/delete and is NOT read by binary.transform, which reads `source_asset_id`.\",\n \"guardKey\": \"if\",\n \"standardTypes\": [\n \"data.set\",\n \"conversation.append\",\n \"output.set\",\n \"binary.store\",\n \"binary.get\",\n \"binary.update\",\n \"binary.delete\",\n \"binary.transform\",\n \"parse\"\n ],\n \"loopSubStepTypes\": [\"loop.set\", \"loop.break\"],\n \"openKeyTypes\": [\"data.set\", \"output.set\", \"conversation.append\", \"loop.set\"],\n \"closedConfigKeys\": {\n \"parse\": [\"source\", \"format\", \"target\", \"on_error\"],\n \"binary.store\": [\"data\", \"metadata\", \"result_key\"],\n \"binary.get\": [\"asset_id\", \"include_data\", \"result_key\"],\n \"binary.update\": [\"asset_id\", \"data\", \"metadata\"],\n \"binary.delete\": [\"asset_id\"],\n \"binary.transform\": [\n \"source_asset_id\",\n \"transformer\",\n \"parameters\",\n \"metadata\",\n \"result_key\"\n ],\n \"loop.break\": [\"if\"]\n }\n },\n \"templateFunctions\": [\n \"and\",\n \"or\",\n \"not\",\n \"eq\",\n \"ne\",\n \"lt\",\n \"le\",\n \"gt\",\n \"ge\",\n \"len\",\n \"index\",\n \"slice\",\n \"call\",\n \"print\",\n \"printf\",\n \"println\",\n \"html\",\n \"js\",\n \"urlquery\",\n \"add\",\n \"sub\",\n \"mul\",\n \"div\",\n \"mod\",\n \"atoi\",\n \"int\",\n \"lower\",\n \"upper\",\n \"title\",\n \"trim\",\n \"substr\",\n \"replace\",\n \"split\",\n \"join\",\n \"hasPrefix\",\n \"hasSuffix\",\n \"contains\",\n \"htmlDocument\",\n \"toJson\",\n \"fromJson\",\n \"isKind\",\n \"typeOf\",\n \"toString\",\n \"indexOf\",\n \"keys\",\n \"values\",\n \"coalesce\",\n \"default\",\n \"now\",\n \"formatDate\",\n \"parseDate\",\n \"since\",\n \"until\",\n \"unix\",\n \"formatTime\",\n \"ternary\",\n \"fibonacci\",\n \"extractNumber\",\n \"base64encode\",\n \"base64decode\",\n \"formatNumber\",\n \"toInt\",\n \"toFloat\",\n \"float64\",\n \"addf\",\n \"subf\",\n \"mulf\",\n \"divf\",\n \"regexMatch\",\n \"regexFind\",\n \"truncate\",\n \"htmlEscape\",\n \"urlencode\",\n \"fn_avg\",\n \"fn_camelCase\",\n \"fn_chunk\",\n \"fn_clamp\",\n \"fn_compact\",\n \"fn_kebabCase\",\n \"fn_max\",\n \"fn_min\",\n \"fn_padLeft\",\n \"fn_padRight\",\n \"fn_regexReplaceAll\",\n \"fn_reverse\",\n \"fn_round\",\n \"fn_sha256\",\n \"fn_slugify\",\n \"fn_snakeCase\",\n \"fn_sortStrings\",\n \"fn_sum\",\n \"fn_uniq\",\n \"fn_urldecode\"\n ],\n \"orchestratorToolAllow\": {\n \"$comment\": \"An orchestrator tool is offered only if it passes BOTH orchestrator.tools (empty = every tool) AND the inline exons definition's tools.allow (absent = no narrowing). The lifecycle tools, and the signal tools when enable_signals is on (the default), are exempt from tools.allow. Reference: validateOrchestratorToolAllowWithholds (v2.760.0).\",\n \"warningField\": \"orchestrator.exons\",\n \"askHumanTool\": \"aif_ask_human\",\n \"enableSignalsDefault\": true,\n \"lifecycleTools\": [\"aif_mission_complete\", \"aif_mission_fail\", \"aif_request_turn\"],\n \"signalTools\": [\n \"aif_signal_complete\",\n \"aif_signal_need_human\",\n \"aif_signal_delegate\",\n \"aif_signal_need_tool\",\n \"aif_signal_modify_flow\"\n ],\n \"campaignTools\": [\n \"aif_campaign_cancel\",\n \"aif_campaign_results\",\n \"aif_campaign_spawn\",\n \"aif_campaign_status\"\n ]\n },\n \"exons\": {\n \"$comment\": \"Where an inline .exons document arrives at the save door. A step's document is judged only on an executor starting executorPrefix, from the string query parameter documentParam, and never when it contains templateActionOpen (the engine renders step params first). Reference: validateInlineExonsStep, validateOrchestrator (v2.767.0, v2.777.0).\",\n \"executorPrefix\": \"exons://\",\n \"documentParam\": \"exons\",\n \"frontmatterDelimiter\": \"---\"\n },\n \"executorConfigEnvScopes\": {\n \"$comment\": \"executor_config may expand only the environment variables of the key it is written under. A value is a reference when it starts with referencePrefix and ends with referenceSuffix around a non-empty name. Checked fields: fields, plus every string value of extra (prefixed extraFieldPrefix in the message). A key absent from scopes has an EMPTY scope and refuses every reference. scopes is the reference's executorConfigEnvScope evaluated for every key with a non-empty scope. Reference: ValidateExecutorConfigEnvScopes (v2.597.0).\",\n \"referencePrefix\": \"${\",\n \"referenceSuffix\": \"}\",\n \"fields\": [\"api_key\", \"base_url\", \"organization\"],\n \"extraKey\": \"extra\",\n \"scopes\": {\n \"anthropic\": [\n \"AIGENTFLOW_ANTHROPIC_API_KEY\",\n \"AIGENTFLOW_ANTHROPIC_BASE_URL\"\n ],\n \"api\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ],\n \"assemblyai\": [\n \"AIGENTFLOW_ASSEMBLYAI_API_KEY\",\n \"AIGENTFLOW_ASSEMBLYAI_BASE_URL\"\n ],\n \"azure\": [\n \"AIGENTFLOW_AZURE_API_KEY\",\n \"AIGENTFLOW_AZURE_BASE_URL\"\n ],\n \"bedrock\": [\n \"AIGENTFLOW_BEDROCK_API_KEY\",\n \"AIGENTFLOW_BEDROCK_BASE_URL\"\n ],\n \"blackforestlabs\": [\n \"AIGENTFLOW_BFL_API_KEY\",\n \"AIGENTFLOW_BLACKFORESTLABS_API_KEY\",\n \"AIGENTFLOW_BLACKFORESTLABS_BASE_URL\"\n ],\n \"broker\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_PASSWORD\",\n \"AIGENTFLOW_MQTT_USERNAME\"\n ],\n \"cohere\": [\n \"AIGENTFLOW_COHERE_API_KEY\",\n \"AIGENTFLOW_COHERE_BASE_URL\"\n ],\n \"custom\": [\n \"AIGENTFLOW_CUSTOM_API_KEY\",\n \"AIGENTFLOW_CUSTOM_BASE_URL\"\n ],\n \"db\": [\n \"AIGENTFLOW_DB_ELASTICSEARCH_BASE_URL\",\n \"AIGENTFLOW_DB_MILVUS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MONGODB_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MYSQL_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_NEO4J_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_PINECONE_API_KEY\",\n \"AIGENTFLOW_DB_POSTGRES_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_QDRANT_BASE_URL\",\n \"AIGENTFLOW_DB_REDIS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_WEAVIATE_BASE_URL\"\n ],\n \"deepgram\": [\n \"AIGENTFLOW_DEEPGRAM_API_KEY\",\n \"AIGENTFLOW_DEEPGRAM_BASE_URL\"\n ],\n \"deepr\": [\n \"AIGENTFLOW_DEEPR_API_KEY\",\n \"AIGENTFLOW_DEEPR_BASE_URL\"\n ],\n \"deepseek\": [\n \"AIGENTFLOW_DEEPSEEK_API_KEY\",\n \"AIGENTFLOW_DEEPSEEK_BASE_URL\"\n ],\n \"device\": [\n \"AIGENTFLOW_SHELLY_AUTH_KEY\"\n ],\n \"elevenlabs\": [\n \"AIGENTFLOW_ELEVENLABS_API_KEY\",\n \"AIGENTFLOW_ELEVENLABS_BASE_URL\"\n ],\n \"geoapify\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ],\n \"google\": [\n \"AIGENTFLOW_GOOGLE_API_KEY\",\n \"AIGENTFLOW_GOOGLE_BASE_URL\",\n \"AIGENTFLOW_VERTEXAI_API_KEY\",\n \"AIGENTFLOW_VERTEXAI_CREDENTIALS_FILE\"\n ],\n \"homeassistant\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ],\n \"inception\": [\n \"AIGENTFLOW_INCEPTION_API_KEY\",\n \"AIGENTFLOW_INCEPTION_BASE_URL\"\n ],\n \"leonardoai\": [\n \"AIGENTFLOW_LEONARDOAI_API_KEY\",\n \"AIGENTFLOW_LEONARDOAI_BASE_URL\"\n ],\n \"minimax\": [\n \"AIGENTFLOW_MINIMAX_API_KEY\",\n \"AIGENTFLOW_MINIMAX_BASE_URL\"\n ],\n \"mistral\": [\n \"AIGENTFLOW_MISTRAL_API_KEY\",\n \"AIGENTFLOW_MISTRAL_BASE_URL\"\n ],\n \"moonshot\": [\n \"AIGENTFLOW_MOONSHOT_API_KEY\",\n \"AIGENTFLOW_MOONSHOT_BASE_URL\"\n ],\n \"mqtt\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_PASSWORD\",\n \"AIGENTFLOW_MQTT_USERNAME\"\n ],\n \"ollama\": [\n \"AIGENTFLOW_OLLAMA_API_KEY\",\n \"AIGENTFLOW_OLLAMA_BASE_URL\"\n ],\n \"openai\": [\n \"AIGENTFLOW_OPENAI_API_KEY\",\n \"AIGENTFLOW_OPENAI_BASE_URL\"\n ],\n \"perplexity\": [\n \"AIGENTFLOW_PERPLEXITY_API_KEY\",\n \"AIGENTFLOW_PERPLEXITY_BASE_URL\"\n ],\n \"qwen\": [\n \"AIGENTFLOW_QWEN_API_KEY\",\n \"AIGENTFLOW_QWEN_BASE_URL\"\n ],\n \"s3\": [\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ],\n \"speechmatics\": [\n \"AIGENTFLOW_SPEECHMATICS_API_KEY\",\n \"AIGENTFLOW_SPEECHMATICS_BASE_URL\"\n ],\n \"staticmap\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ],\n \"storage\": [\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ],\n \"vaiembed\": [\n \"AIGENTFLOW_VAIEMBED_API_KEY\",\n \"AIGENTFLOW_VAIEMBED_BASE_URL\"\n ],\n \"verda\": [\n \"AIGENTFLOW_VERDA_API_KEY\",\n \"AIGENTFLOW_VERDA_BASE_URL\"\n ],\n \"vllm\": [\n \"AIGENTFLOW_VLLM_API_KEY\",\n \"AIGENTFLOW_VLLM_BASE_URL\"\n ],\n \"xai\": [\n \"AIGENTFLOW_XAI_API_KEY\",\n \"AIGENTFLOW_XAI_BASE_URL\"\n ]\n }\n },\n \"serverOwnedQueryKeys\": {\n \"$comment\": \"Executor parameters only the server's credential resolver may set. A key in keys, matched exactly and case-sensitively, is refused (error) in the query of a top-level step (field stepFieldFormat) and of a loop sub-step (field loopStepFieldFormat, whose second placeholder is the sub-step's id as written). No other surface is scanned. A new server-owned key is a change to keys. Reference: validateNoServerOwnedStepQueryKeys, IsServerOwnedParamKey (CFX-05, after v2.790.0).\",\n \"keys\": [\n \"aiv_api_key\",\n \"aiv_base_url\",\n \"aiv_delegation\"\n ],\n \"stepFieldFormat\": \"steps.%s.query.%s\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.query.%s\"\n },\n \"functionOperations\": {\n \"$comment\": \"unknown_function_operation (ERROR): a step or loop sub-step whose executor is function://<authority>/<path> where authority+\\\"/\\\"+path is not in operations. Templated executors (containing templateActionOpen), unparsable URLs (invalid_executor_url owns them) and other schemes are skipped; the scheme match is exact and case-sensitive, as in the reference. The message is messageFormat with the stepId, the operation, then operations joined by ', '. Reference: validateFunctionOperationKnown (parser.go), functionSchemaOperations.\",\n \"code\": \"unknown_function_operation\",\n \"scheme\": \"function\",\n \"messageFormat\": \"step %s uses function://%s, which is not a built-in function. Available: %s\",\n \"suggestionFormat\": \"Use one of the built-in function operations: %s. For custom logic use a script://, http:// or ai:// executor instead.\",\n \"operations\": [\n \"binary-processor/validate-and-store\",\n \"data/create\",\n \"data/from-json\",\n \"data/to-json\",\n \"data/validate\",\n \"demo/adult-processor\",\n \"demo/calculator\",\n \"demo/data-processor\",\n \"demo/finalizer\",\n \"demo/senior-processor\",\n \"demo/youth-processor\",\n \"document/finalize\",\n \"document/prepare\",\n \"json/validate\",\n \"math/basic\",\n \"math/calculate\",\n \"math/sum\",\n \"results-compiler/aggregate\",\n \"system/info\",\n \"text/analysis\",\n \"text/count-characters\",\n \"text/count-lines\",\n \"text/count-occurrences\",\n \"text/count-words\",\n \"text/find-pattern\",\n \"text/generate\",\n \"text/replace-text\",\n \"text/search\",\n \"utils/datetime\",\n \"utils/format-date\",\n \"utils/log\",\n \"utils/parse-date\"\n ]\n },\n \"atlasExecutor\": {\n \"$comment\": \"atlas://<provider>/<resource>: calls into the Atlas platform. Providers are agent (the one resource is run) and capability (the resource is a capability reference). All findings are ERRORS, field = the step (loop sub-steps use the composite step id and the sub-step path). Templated executors, unparsable URLs and other schemes are skipped. A literal agent and literal capabilities keep a step from being steered by data: query.agent and every string anywhere in query.capabilities and query.model may not contain templateActionOpen, while prompt, inputs and capability args may. agent, prompt and prompt_template count as present only when they are non-empty strings after trimming whitespace. A message format takes the quoted step id first. A URL the shared executor-URL shape refuses (a dot or colon in a reference, say) is still judged here, split at the first slash after atlas://.\",\n \"scheme\": \"atlas\",\n \"providerAgent\": \"agent\",\n \"providerCapability\": \"capability\",\n \"agentResource\": \"run\",\n \"capabilityRefPattern\": \"^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$\",\n \"operationUnknown\": {\n \"code\": \"atlas_operation_unknown\",\n \"messageFormat\": \"step %s uses %s, which is not an Atlas operation. The providers are agent (resource run) and capability (resource: a capability reference).\",\n \"suggestion\": \"Use atlas://agent/run or atlas://capability/<capability-ref>.\"\n },\n \"agentMissing\": {\n \"code\": \"atlas_agent_missing\",\n \"messageFormat\": \"step %s runs an Atlas agent but query.agent is missing, empty or not a string.\",\n \"suggestion\": \"Set query.agent to the agent to run, written out as a literal such as @acme/reporter.\"\n },\n \"agentNotLiteral\": {\n \"code\": \"atlas_agent_not_literal\",\n \"messageFormat\": \"step %s computes query.agent from a template. The agent must be a fixed literal, never derived from input.\",\n \"suggestion\": \"Write the agent out as a literal such as @acme/reporter. Data may go into the prompt or the inputs instead.\"\n },\n \"capabilitiesNotLiteral\": {\n \"code\": \"atlas_capabilities_not_literal\",\n \"messageFormat\": \"step %s computes an entry of query.capabilities from a template. Capabilities must be fixed literals, never derived from input.\",\n \"suggestion\": \"Write each capability out as a literal. Data may go into the prompt or the inputs instead.\"\n },\n \"promptMissing\": {\n \"code\": \"atlas_prompt_missing\",\n \"messageFormat\": \"step %s runs an Atlas agent with neither query.prompt nor query.prompt_template.\",\n \"suggestion\": \"Set exactly one of query.prompt or query.prompt_template.\"\n },\n \"promptBoth\": {\n \"code\": \"atlas_prompt_both\",\n \"messageFormat\": \"step %s sets both query.prompt and query.prompt_template.\",\n \"suggestion\": \"Keep exactly one of query.prompt or query.prompt_template.\"\n },\n \"capabilityRefInvalid\": {\n \"code\": \"atlas_capability_ref_invalid\",\n \"messageFormat\": \"step %s uses atlas://capability/%s, which is not a valid capability reference.\",\n \"suggestion\": \"A capability reference starts with a letter or digit and continues with letters, digits, _ and - up to 128 characters in all.\"\n },\n \"modelNotLiteral\": {\n \"code\": \"atlas_model_not_literal\",\n \"messageFormat\": \"step %s computes a value of query.model from a template. The provider, model and reasoning_effort must be fixed literals, never derived from input.\",\n \"suggestion\": \"Write the model choice out as literals. Data may go into the prompt or the inputs instead.\"\n },\n \"paramRefused\": {\n \"code\": \"atlas_param_refused\",\n \"messageFormat\": \"step %s sets %s under query. Atlas decides these itself, so a step may not set them.\",\n \"suggestion\": \"Remove these keys from the query.\",\n \"agentKeys\": [\n \"api_key\",\n \"attribution\",\n \"base_url\",\n \"host\",\n \"idempotency_key\",\n \"org_id\",\n \"person\",\n \"untrusted_input\",\n \"untrusted_input_override\",\n \"url\",\n \"user_id\"\n ],\n \"capabilityKeys\": [\n \"attribution\",\n \"idempotency_key\",\n \"untrusted_input\",\n \"untrusted_input_override\"\n ]\n }\n },\n \"reservedInputNames\": {\n \"$comment\": \"reserved_input_name (ERROR): an input the flow declares under the top-level query: map, or as an input_schema field name, that starts with prefix. The platform keeps that namespace for values it writes itself (the acting person, the credential manifest, the untrusted-input marker); a value or default written under such a name is never delivered. Every name the platform reserves today starts with the prefix. Matching is exact and case-sensitive: one leading underscore is an ordinary name. Findings carry no step id. queryFieldFormat takes the input name; schemaFieldFormat takes the field name as written (a non-string name is skipped). Query names are reported sorted, then schema fields in file order.\",\n \"prefix\": \"__\",\n \"code\": \"reserved_input_name\",\n \"messageFormat\": \"the input %s starts with two underscores. That namespace belongs to the platform (the acting person, the credential manifest, the untrusted-input marker): a flow cannot declare an input there, and a value or default written under such a name is never delivered.\",\n \"suggestion\": \"Rename the input so it does not start with \\\"__\\\".\",\n \"queryFieldFormat\": \"query.%s\",\n \"schemaFieldFormat\": \"input_schema.fields.%s\"\n },\n \"flowDataReservedKeys\": {\n \"$comment\": \"flow_data_key_reserved (ERROR, no loop demotion): a key of the top-level data: map that names engine state. data: is seeded into the mission's .data namespace, where the engine keeps its own bookkeeping, so a flow declaring such a key would forge it. Matching is exact and case-sensitive. A key is reserved when it is one of exact (each with its reason), or starts with one of prefixes (checked in order, first wins; each with its reason). The finding's field is fieldFormat with the key; the message is messageFormat with the key (JSON-quoted, as Go's %q) then the reason; the suggestion is verbatim. Findings are sorted by key. Reference: FlowDataKeyReservation, validateFlowDataKeysAreNotReserved (aigentflow#247 review).\",\n \"code\": \"flow_data_key_reserved\",\n \"fieldFormat\": \"data.%s\",\n \"messageFormat\": \"data: key %s is reserved: %s. It would write into the engine's own state, so it is not seeded.\",\n \"suggestion\": \"Rename the key (no leading `_` or `.`, and not one of the engine namespaces memory., orchestrator., campaign., voiceagent.).\",\n \"exact\": {\n \"org_id\": \"the mission's organization, set by the engine for Thalamus/Engram calls\",\n \"memory\": \"the memory scope namespace\",\n \"orchestrator\": \"the orchestrator's state namespace\",\n \"campaign\": \"the campaign's state namespace\",\n \"voiceagent\": \"the voice agent's state namespace\",\n \"current_flow\": \"engine bookkeeping (the current flow definition)\",\n \"modified_flow\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_history\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_pending\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_requests\": \"engine bookkeeping (dynamic flow modification)\",\n \"bottleneck_state\": \"engine bookkeeping (bottleneck analysis)\"\n },\n \"prefixes\": [\n { \"prefix\": \"_\", \"reason\": \"keys starting with `_` are engine bookkeeping (current flow, loop and for_each context, taint lists such as `__untrusted_*`)\" },\n { \"prefix\": \".\", \"reason\": \"keys starting with `.` are engine step-response slots\" },\n { \"prefix\": \"memory.\", \"reason\": \"the `memory.` namespace belongs to the engine\" },\n { \"prefix\": \"orchestrator.\", \"reason\": \"the `orchestrator.` namespace belongs to the orchestrator\" },\n { \"prefix\": \"campaign.\", \"reason\": \"the `campaign.` namespace belongs to the campaign engine\" },\n { \"prefix\": \"voiceagent.\", \"reason\": \"the `voiceagent.` namespace belongs to the voice agent\" }\n ]\n },\n \"credentialEndpointPairing\": {\n \"$comment\": \"credential_endpoint_unpaired (WARNING, never an error): the one statically certain shape of AIgentFlow's run-time credential/endpoint pairing refusal. ai: an ai://<provider>/... step (top-level or loop sub-step) whose query holds a non-empty string <provider>+providerBaseUrlParamSuffix while neither its query (genericKeyParam or <provider>+providerKeyParamSuffix, non-empty strings) nor executor_config.<provider>.api_key (a literal, not an env reference) supplies a key; and executor_config.<provider>.base_url for a provider in executorConfigProviders when it is a literal, the block has no literal api_key, and it is not the case that at least one step uses the provider and every such step brings its own query key. keylessProviders are exempt from both. families: a step whose executor resolves (the key protocol+familyKeySeparator+driver, else protocol) to a row. implicitServerCredential rows are never judged. A row warns when its secret (the first non-empty string secretParam in the query, else per configKey in order: executor_config api_key when configApiKeyParam is a secretParam, else the first non-empty string secretParam under extra) is exactly an env reference to a serverEnv name on a row with expandsServerEnvReferences, and its endpoint (the first non-empty string endpointParam in the query, else per configKey: base_url when configBaseUrlParam is an endpointParam, else the first non-empty string endpointParam under extra) is a literal: no templateActionOpen, not an env reference, and not of the same origin as a defaultEndpoint (lower-cased scheme://host:port, defaultPorts filled). serverEnv is the reference's per-family server-variable set, evaluated. Field formats are the reference's. Reference: validateCredentialEndpointPairing (DC-FORGE-231) and validateFamilyCredentialEndpointPairing (DC-FORGE-233).\",\n \"stepFieldFormat\": \"steps.%s.query.%s\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.query.%s\",\n \"executorConfigBaseUrlFieldFormat\": \"executor_config.%s.base_url\",\n \"executorConfigKeyFieldFormat\": \"executor_config.%s.%s\",\n \"executorConfigExtraFieldFormat\": \"executor_config.%s.extra.%s\",\n \"executorConfigApiKeyField\": \"api_key\",\n \"executorConfigBaseUrlField\": \"base_url\",\n \"protocolSeparator\": \"://\",\n \"defaultPorts\": {\n \"http\": \"80\",\n \"https\": \"443\"\n },\n \"ai\": {\n \"protocol\": \"ai\",\n \"genericKeyParam\": \"api_key\",\n \"providerKeyParamSuffix\": \"_api_key\",\n \"providerBaseUrlParamSuffix\": \"_base_url\",\n \"keylessProviders\": [\n \"ollama\",\n \"vllm\"\n ],\n \"executorConfigProviders\": [\n \"anthropic\",\n \"assemblyai\",\n \"azure\",\n \"bedrock\",\n \"blackforestlabs\",\n \"cohere\",\n \"custom\",\n \"deepgram\",\n \"deepseek\",\n \"elevenlabs\",\n \"google\",\n \"inception\",\n \"leonardoai\",\n \"minimax\",\n \"mistral\",\n \"moonshot\",\n \"ollama\",\n \"openai\",\n \"perplexity\",\n \"qwen\",\n \"speechmatics\",\n \"vaiembed\",\n \"verda\",\n \"vllm\",\n \"xai\"\n ]\n },\n \"familyKeySeparator\": \"/\",\n \"families\": {\n \"db\": {\n \"protocol\": \"db\",\n \"configKeys\": [],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_DB_POSTGRES_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MYSQL_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MONGODB_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_REDIS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_NEO4J_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MILVUS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_QDRANT_BASE_URL\",\n \"AIGENTFLOW_DB_WEAVIATE_BASE_URL\",\n \"AIGENTFLOW_DB_ELASTICSEARCH_BASE_URL\",\n \"AIGENTFLOW_DB_PINECONE_API_KEY\"\n ]\n },\n \"deepr\": {\n \"protocol\": \"deepr\",\n \"configKeys\": [\n \"deepr\"\n ],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"http://localhost:28081\"\n ],\n \"configApiKeyParam\": \"api_key\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_DEEPR_API_KEY\",\n \"AIGENTFLOW_DEEPR_BASE_URL\"\n ]\n },\n \"getmd\": {\n \"protocol\": \"getmd\",\n \"configKeys\": [\n \"getmd\"\n ],\n \"secretParams\": [],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_GETMD_BASE_URL\"\n ]\n },\n \"homeassistant\": {\n \"protocol\": \"homeassistant\",\n \"configKeys\": [\n \"api\"\n ],\n \"secretParams\": [\n \"token\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"http://homeassistant.local:8123\"\n ],\n \"configApiKeyParam\": \"token\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ]\n },\n \"hosting\": {\n \"protocol\": \"hosting\",\n \"configKeys\": [\n \"hosting_trove\"\n ],\n \"secretParams\": [\n \"trove_auth_token\"\n ],\n \"endpointParams\": [\n \"trove_base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIF_TROVE_BASE_URL\",\n \"AIF_TROVE_AUTH_TOKEN\"\n ]\n },\n \"mcp/http\": {\n \"protocol\": \"mcp\",\n \"configKeys\": [\n \"mcp\"\n ],\n \"secretParams\": [\n \"auth_token\"\n ],\n \"endpointParams\": [\n \"server_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"auth_token\",\n \"configBaseUrlParam\": \"server_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_MCP_DEFAULT_SERVER_URL\",\n \"AIGENTFLOW_MCP_AUTH_TOKEN\"\n ]\n },\n \"mqtt\": {\n \"protocol\": \"mqtt\",\n \"configKeys\": [\n \"broker\"\n ],\n \"secretParams\": [\n \"password\"\n ],\n \"endpointParams\": [\n \"broker_url\"\n ],\n \"defaultEndpoints\": [\n \"tcp://localhost:1883\"\n ],\n \"configApiKeyParam\": \"password\",\n \"configBaseUrlParam\": \"broker_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_USERNAME\",\n \"AIGENTFLOW_MQTT_PASSWORD\"\n ]\n },\n \"opencorporates\": {\n \"protocol\": \"opencorporates\",\n \"configKeys\": [\n \"company\"\n ],\n \"secretParams\": [\n \"api_token\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"https://api.opencorporates.com/v0.4\"\n ],\n \"configApiKeyParam\": \"api_token\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_OPENCORPORATES_API_KEY\"\n ]\n },\n \"shelly\": {\n \"protocol\": \"shelly\",\n \"configKeys\": [\n \"device\"\n ],\n \"secretParams\": [\n \"auth_key\"\n ],\n \"endpointParams\": [\n \"device_ip\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"auth_key\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_SHELLY_AUTH_KEY\"\n ]\n },\n \"staticmap\": {\n \"protocol\": \"staticmap\",\n \"configKeys\": [\n \"geoapify\"\n ],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"https://maps.geoapify.com/v1\"\n ],\n \"configApiKeyParam\": \"api_key\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ]\n },\n \"storage/s3\": {\n \"protocol\": \"storage\",\n \"configKeys\": [\n \"s3\"\n ],\n \"secretParams\": [\n \"secret_access_key\"\n ],\n \"endpointParams\": [\n \"endpoint\",\n \"public_endpoint\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"access_key_id\",\n \"configBaseUrlParam\": \"endpoint\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ]\n },\n \"storage/trove\": {\n \"protocol\": \"storage\",\n \"configKeys\": [],\n \"secretParams\": [\n \"trove_auth_token\"\n ],\n \"endpointParams\": [\n \"trove_base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\",\n \"AIGENTFLOW_TROVE_BASE_URL\",\n \"AIGENTFLOW_TROVE_AUTH_TOKEN\",\n \"AIGENTFLOW_TROVE_COFFER_ID\"\n ]\n }\n }\n },\n \"templateDefaultPiped\": {\n \"$comment\": \"template_default_piped (ERROR at the top level, WARNING inside a loop body, like template_syntax_error). The template function `default` takes the value FIRST; a pipeline that passes a value into it as a non-first command hands the piped value as the LAST argument, so the fallback is always the result. Flagged: any pipeline (in any action, including if / else if / range / with / template / block conditions, parenthesised sub-pipelines and variable declarations) in which a command whose first word is the bare identifier `default` is not the FIRST command. Never flagged: a field, a variable, a string literal, a comment, `default` as the first command. The message fills %s with the pipeline.\",\n \"code\": \"template_default_piped\",\n \"function\": \"default\",\n \"messageFormat\": \"`default` takes the value FIRST, and a pipe passes the piped value LAST: `%s` is `default <fallback> <value>`, so the fallback is always the result\",\n \"suggestion\": \"write the value first and the fallback second, as a call: `{{ default .x \\\"fallback\\\" }}`\"\n },\n \"complianceResidency\": {\n \"$comment\": \"compliance_residency_unenforced (WARNING, never an error; needs no catalogue). When compliance.residency is non-empty and every code (trimmed, upper-cased) is in euResidencyCodes, each top-level step and loop sub-step whose executor starts with aiProtocol+protocolSeparator, then the orchestrator (provider = its exons execution.provider), warns when its provider (literal, lower-cased; skipped when empty or containing templateActionOpen) is in regionLaneProviders and the call is not pinned. Pinned = query region (orchestrator.region) a non-empty string after trimming; OR enforce_region true (query: bool true or the strings in enforceRegionTrueStrings; orchestrator: bool true); OR the author named the endpoint: query <provider>+baseUrlParamSuffix a non-empty string after trimming, or executor_config.<provider>.base_url non-empty after trimming. The provider segment of ai://<provider>/<operation> exists only when a slash follows it. regionLaneProviders is the set of providers whose adapter routes on `region`; a provider outside it has no region lane and is never warned. Message, suggestion and site formats fill %s and %q (a Go-quoted string) in order; the message's last placeholder is the residency list as written, printed [A B]. Reference: validateResidencyEnforcement (validation.residency.go).\",\n \"code\": \"compliance_residency_unenforced\",\n \"euResidencyCodes\": [\"EU\", \"DE\", \"FR\", \"IE\", \"NL\", \"IT\", \"ES\"],\n \"regionLaneProviders\": [\n \"bedrock\",\n \"google\",\n \"azure\",\n \"openai\",\n \"assemblyai\",\n \"speechmatics\",\n \"deepgram\",\n \"mistral\"\n ],\n \"aiProtocol\": \"ai\",\n \"protocolSeparator\": \"://\",\n \"regionParam\": \"region\",\n \"enforceRegionParam\": \"enforce_region\",\n \"baseUrlParamSuffix\": \"_base_url\",\n \"enforceRegionTrueStrings\": [\"true\", \"1\", \"yes\"],\n \"stepFieldFormat\": \"steps.%s.executor\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.executor\",\n \"orchestratorField\": \"orchestrator.exons\",\n \"siteStepFormat\": \"step %q\",\n \"siteLoopStepFormat\": \"loop sub-step %q of step %q\",\n \"siteOrchestrator\": \"the orchestrator\",\n \"messageFormat\": \"%s calls provider %q, whose default endpoint commits to no jurisdiction, but sets neither region nor enforce_region, so nothing pins it to the declared residency %v. compliance.residency is a catalogue eligibility check, not endpoint evidence\",\n \"suggestion\": \"Add `region: eu` and `enforce_region: true` to the call (an orchestrator: the same two keys on the orchestrator block). Prove it afterwards: the step record's diagnostics.region is stamped from the host actually dialled.\"\n },\n \"examples\": {\n \"$comment\": \"The examples: block. Derived from the reference's constants, never hand-typed: limits, vocabularies, the credential-shaped-literal pattern set and each code's severity. example_ref_blocked_host is listed for completeness but is raised by the reference implementation only; the ports never raise it. See PARITY.md, 'The examples block'.\",\n \"limits\": {\n \"maxPerFlow\": 50,\n \"maxBlockBytes\": 262144,\n \"maxInlineInputBytes\": 32768,\n \"maxReferenceTextBytes\": 32768,\n \"maxVariants\": 10,\n \"maxTags\": 8,\n \"maxMustNot\": 12,\n \"maxMustNotContain\": 20,\n \"maxRubricRunes\": 4000,\n \"maxGuidanceRunes\": 2000,\n \"maxNotesRunes\": 2000,\n \"titleMaxRunes\": 80,\n \"maxMustNotRunes\": 300,\n \"maxMustNotContainLength\": 200,\n \"maxProvenanceRunes\": 200,\n \"maxNoteRunes\": 300,\n \"maxUrlBytes\": 2048,\n \"maxPatternLength\": 512,\n \"weightMax\": 10,\n \"minScoreMin\": 0,\n \"minScoreMax\": 1\n },\n \"idPattern\": \"^[a-z][a-z0-9_]{1,47}$\",\n \"tagPattern\": \"^[a-z][a-z0-9_-]{0,31}$\",\n \"sha256Pattern\": \"^[0-9a-f]{64}$\",\n \"mediaTypePattern\": \"^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$\",\n \"signedUrlQueryKeyPattern\": \"^(x-amz-signature|signature|sig|token|access_token|key|x-goog-signature|se|sp)$\",\n \"origins\": [\n \"author\",\n \"synthetic\"\n ],\n \"sideEffects\": [\n \"refuse\",\n \"allow\"\n ],\n \"statuses\": [\n \"completed\",\n \"failed\",\n \"paused_for_human\"\n ],\n \"reservedRefSchemes\": [\n \"artifact\",\n \"trove\",\n \"aiv\",\n \"s3\",\n \"gs\"\n ],\n \"secretPatterns\": [\n {\n \"name\": \"an API key\",\n \"expr\": \"\\\\bsk-[A-Za-z0-9_-]{20,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a platform API key\",\n \"expr\": \"\\\\bcrn_[A-Za-z0-9]{16,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"an AWS access key\",\n \"expr\": \"\\\\bAKIA[0-9A-Z]{16}\\\\b\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a private key\",\n \"expr\": \"-----BEGIN [A-Z ]*PRIVATE KEY-----\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a bearer token\",\n \"expr\": \"\\\\bbearer\\\\s+[A-Za-z0-9._~+/-]{20,}\",\n \"flags\": \"i\"\n },\n {\n \"name\": \"a Slack token\",\n \"expr\": \"\\\\bxox[abprs]-[A-Za-z0-9-]{10,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a GitHub token\",\n \"expr\": \"\\\\bgh[pousr]_[A-Za-z0-9]{30,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a retired registry key\",\n \"expr\": \"\\\\baivk_[A-Za-z0-9]{20,}\",\n \"flags\": \"\"\n }\n ],\n \"codes\": {\n \"example_checkpoint_status\": \"error\",\n \"example_checkpoint_step_composite\": \"error\",\n \"example_checkpoint_step_unknown\": \"error\",\n \"example_expectation_contradiction\": \"warning\",\n \"example_expected_conflict\": \"error\",\n \"example_expected_empty\": \"error\",\n \"example_expected_field_unchecked\": \"warning\",\n \"example_expected_field_unknown\": \"error\",\n \"example_expected_missing\": \"error\",\n \"example_field_matcher_invalid\": \"error\",\n \"example_file_input_needs_ref\": \"error\",\n \"example_guidance_missing\": \"warning\",\n \"example_guidance_too_long\": \"error\",\n \"example_holdout_in_public_flow\": \"error\",\n \"example_id_duplicate\": \"error\",\n \"example_id_invalid\": \"error\",\n \"example_id_missing\": \"error\",\n \"example_input_conflict\": \"error\",\n \"example_input_invalid\": \"error\",\n \"example_input_missing\": \"error\",\n \"example_input_too_large\": \"error\",\n \"example_input_unvalidated\": \"warning\",\n \"example_min_score_range\": \"error\",\n \"example_must_not_contain_invalid\": \"error\",\n \"example_must_not_invalid\": \"error\",\n \"example_notes_too_long\": \"error\",\n \"example_ref_blocked_host\": \"error\",\n \"example_ref_invalid\": \"error\",\n \"example_ref_media_type_invalid\": \"error\",\n \"example_ref_scheme\": \"error\",\n \"example_ref_scheme_reserved\": \"error\",\n \"example_ref_sha256_invalid\": \"error\",\n \"example_ref_signed_url\": \"warning\",\n \"example_ref_unpinned\": \"warning\",\n \"example_reference_binary\": \"warning\",\n \"example_reference_invalid\": \"error\",\n \"example_rubric_empty\": \"error\",\n \"example_rubric_too_long\": \"error\",\n \"example_secret_like_value\": \"error\",\n \"example_secret_value\": \"error\",\n \"example_side_effects_invalid\": \"error\",\n \"example_status_invalid\": \"error\",\n \"example_tag_invalid\": \"error\",\n \"example_title_missing\": \"error\",\n \"example_title_too_long\": \"error\",\n \"example_variant_empty\": \"error\",\n \"example_variant_id_duplicate\": \"error\",\n \"example_variant_id_invalid\": \"error\",\n \"example_variant_input_conflict\": \"error\",\n \"example_variant_input_invalid\": \"error\",\n \"example_variant_origin_invalid\": \"error\",\n \"example_variant_unchecked\": \"warning\",\n \"example_variants_too_many\": \"error\",\n \"example_weight_range\": \"error\",\n \"examples_all_held_out\": \"warning\",\n \"examples_block_too_large\": \"error\",\n \"examples_published_with_public_flow\": \"warning\",\n \"examples_too_many\": \"error\",\n \"examples_unreadable_by_judge\": \"warning\"\n }\n },\n \"knownKeys\": {\n \"$comment\": \"Derived by reflection over the reference's Flow type, following yaml.v3's field rules (yaml tag, lowercased field name, inline structs merged). KnownFields(true) refuses any key a struct type does not declare. A shape is scalar | any | map<S> | list<S> | a type name below. any is never inspected (a Go interface, or a type with its own unmarshaller). How it is derived and checked, and how to regenerate it: PARITY.md, 'Unknown keys and value kinds'.\",\n \"root\": \"Flow\",\n \"types\": {\n \"BillingConfig\": {\n \"max_credits\": \"scalar\"\n },\n \"CampaignChildFlowDef\": {\n \"alias\": \"scalar\",\n \"flow_id\": \"scalar\",\n \"flow_name\": \"scalar\"\n },\n \"CampaignConfig\": {\n \"child_flows\": \"list<CampaignChildFlowDef>\",\n \"max_concurrent\": \"scalar\",\n \"max_credits_per_child\": \"scalar\",\n \"max_depth\": \"scalar\",\n \"max_total_children\": \"scalar\",\n \"on_children_complete\": \"scalar\",\n \"shared_memory\": \"scalar\"\n },\n \"Checkpoint\": {\n \"exact\": \"map<any>\",\n \"fields\": \"map<FieldMatcher>\",\n \"min_score\": \"scalar\",\n \"must_not\": \"list<scalar>\",\n \"must_not_contain\": \"list<scalar>\",\n \"optional\": \"scalar\",\n \"reference\": \"ExampleReference\",\n \"rubric\": \"scalar\",\n \"status\": \"scalar\"\n },\n \"CheckpointConfig\": {\n \"enabled\": \"scalar\",\n \"interval_steps\": \"scalar\",\n \"max_per_mission\": \"scalar\",\n \"on_completion\": \"scalar\",\n \"pre_dfm\": \"scalar\"\n },\n \"ConditionDefinition\": {\n \"goto\": \"scalar\",\n \"if\": \"scalar\"\n },\n \"ErrorStrategyDefinition\": {\n \"action\": \"scalar\",\n \"backoff_multiplier\": \"scalar\",\n \"exponential_backoff\": \"scalar\",\n \"goto_step\": \"scalar\",\n \"jitter\": \"scalar\",\n \"max_delay\": \"scalar\",\n \"max_retries\": \"scalar\",\n \"retry_delay\": \"scalar\",\n \"retry_on\": \"list<scalar>\"\n },\n \"ExampleDefinition\": {\n \"checkpoints\": \"map<Checkpoint>\",\n \"expected\": \"Expectation\",\n \"guidance\": \"scalar\",\n \"hold_out\": \"scalar\",\n \"id\": \"scalar\",\n \"input\": \"map<any>\",\n \"input_ref\": \"FileRef\",\n \"min_score\": \"scalar\",\n \"notes\": \"scalar\",\n \"side_effects\": \"scalar\",\n \"tags\": \"list<scalar>\",\n \"title\": \"scalar\",\n \"variants\": \"list<ExampleVariant>\",\n \"weight\": \"scalar\"\n },\n \"ExampleReference\": {\n \"ref\": \"FileRef\",\n \"text\": \"scalar\"\n },\n \"ExampleVariant\": {\n \"expected\": \"Expectation\",\n \"guidance\": \"scalar\",\n \"id\": \"scalar\",\n \"input_patch\": \"map<any>\",\n \"input_ref\": \"FileRef\",\n \"origin\": \"scalar\",\n \"provenance\": \"scalar\",\n \"title\": \"scalar\",\n \"weight\": \"scalar\"\n },\n \"ExecutorDefaultsDefinition\": {\n \"frequency_penalty\": \"scalar\",\n \"max_tokens\": \"scalar\",\n \"presence_penalty\": \"scalar\",\n \"temperature\": \"scalar\",\n \"top_p\": \"scalar\"\n },\n \"ExecutorInstanceDefinition\": {\n \"api_key\": \"scalar\",\n \"base_url\": \"scalar\",\n \"defaults\": \"ExecutorDefaultsDefinition\",\n \"enable_streaming\": \"scalar\",\n \"extra\": \"map<any>\",\n \"organization\": \"scalar\",\n \"service_channel\": \"scalar\",\n \"timeout_seconds\": \"scalar\",\n \"tool_credentials\": \"map<scalar>\"\n },\n \"ExonsUploadsFlowConfig\": {\n \"allowed_models\": \"list<scalar>\",\n \"allowed_providers\": \"list<scalar>\"\n },\n \"Expectation\": {\n \"exact\": \"map<any>\",\n \"fields\": \"map<FieldMatcher>\",\n \"min_score\": \"scalar\",\n \"must_not\": \"list<scalar>\",\n \"must_not_contain\": \"list<scalar>\",\n \"reference\": \"ExampleReference\",\n \"rubric\": \"scalar\",\n \"status\": \"scalar\"\n },\n \"FailoverBreakerConfig\": {\n \"failure_threshold\": \"scalar\",\n \"open_duration\": \"scalar\",\n \"success_threshold\": \"scalar\"\n },\n \"FailoverConfig\": {\n \"chain\": \"list<scalar>\",\n \"circuit_breaker\": \"FailoverBreakerConfig\",\n \"health_gate\": \"scalar\"\n },\n \"FieldExpectationDefinition\": {\n \"description\": \"scalar\",\n \"fallback\": \"any\",\n \"items\": \"PropertyDefinition\",\n \"required\": \"any\",\n \"type\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"FieldMatcher\": {\n \"approx\": \"scalar\",\n \"contains\": \"scalar\",\n \"equals\": \"any\",\n \"matches\": \"scalar\",\n \"not_contains\": \"scalar\",\n \"one_of\": \"list<any>\",\n \"present\": \"scalar\",\n \"tolerance\": \"scalar\"\n },\n \"FileRef\": {\n \"media_type\": \"scalar\",\n \"note\": \"scalar\",\n \"sha256\": \"scalar\",\n \"url\": \"scalar\"\n },\n \"Flow\": {\n \"aigentflow_version\": \"scalar\",\n \"billing\": \"BillingConfig\",\n \"campaign\": \"CampaignConfig\",\n \"checkpoint\": \"CheckpointConfig\",\n \"classification\": \"FlowClassification\",\n \"compliance\": \"FlowCompliance\",\n \"currency\": \"scalar\",\n \"data\": \"map<any>\",\n \"description\": \"scalar\",\n \"discoverable_tools\": \"list<scalar>\",\n \"display_name\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"examples\": \"list<ExampleDefinition>\",\n \"executor_config\": \"map<ExecutorInstanceDefinition>\",\n \"exons_uploads\": \"ExonsUploadsFlowConfig\",\n \"expression_functions\": \"list<map<scalar>>\",\n \"handle\": \"scalar\",\n \"input_schema\": \"InputSchema\",\n \"is_template\": \"scalar\",\n \"max_duration\": \"scalar\",\n \"mock_scenarios\": \"map<map<MockStepDefinition>>\",\n \"name\": \"scalar\",\n \"orchestrator\": \"OrchestratorDefinition\",\n \"output\": \"list<scalar>\",\n \"query\": \"map<QueryDefinition>\",\n \"rate_limit\": \"FlowRateLimitConfig\",\n \"start\": \"scalar\",\n \"steps\": \"map<StepDefinition>\",\n \"strict_templates\": \"scalar\",\n \"tags\": \"list<scalar>\",\n \"template\": \"FlowTemplateMetadata\",\n \"tool_discovery\": \"scalar\",\n \"version\": \"scalar\",\n \"visibility\": \"scalar\"\n },\n \"FlowClassification\": {\n \"ai_act_annex_iii\": \"scalar\",\n \"ai_act_annex_iii_acknowledgment\": \"scalar\",\n \"ai_act_annex_iii_area\": \"scalar\",\n \"ai_act_annex_iii_basis\": \"scalar\",\n \"art22_basis\": \"scalar\",\n \"betriebsrat_agreement_ref\": \"scalar\",\n \"processes_employee_data\": \"scalar\",\n \"processes_personal_data\": \"scalar\"\n },\n \"FlowCompliance\": {\n \"allowed_use_cases\": \"list<scalar>\",\n \"certifications\": \"list<scalar>\",\n \"disallow_training_on_inputs\": \"scalar\",\n \"max_retention\": \"scalar\",\n \"prohibited_use_cases\": \"list<scalar>\",\n \"residency\": \"list<scalar>\"\n },\n \"FlowRateLimitConfig\": {\n \"disabled\": \"scalar\",\n \"public_per_org_per_minute\": \"scalar\"\n },\n \"FlowTemplateMetadata\": {\n \"category\": \"scalar\",\n \"language\": \"scalar\",\n \"screenshot_url\": \"scalar\",\n \"summary\": \"scalar\"\n },\n \"ForEachDefinition\": {\n \"as\": \"scalar\",\n \"items\": \"scalar\",\n \"max_parallel\": \"scalar\",\n \"resolution\": \"scalar\",\n \"throttle\": \"ThrottleDefinition\"\n },\n \"InputSchema\": {\n \"fields\": \"list<InputSchemaField>\",\n \"version\": \"scalar\"\n },\n \"InputSchemaField\": {\n \"accept\": \"list<scalar>\",\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"label\": \"scalar\",\n \"max\": \"scalar\",\n \"max_items\": \"scalar\",\n \"max_length\": \"scalar\",\n \"max_size\": \"scalar\",\n \"min\": \"scalar\",\n \"min_items\": \"scalar\",\n \"min_length\": \"scalar\",\n \"name\": \"scalar\",\n \"pattern\": \"scalar\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"untrusted\": \"scalar\",\n \"visible_when\": \"VisibleWhenPredicate\"\n },\n \"LoopDefinition\": {\n \"max_iterations\": \"scalar\",\n \"steps\": \"list<LoopStepDefinition>\",\n \"vars\": \"map<scalar>\",\n \"while\": \"scalar\"\n },\n \"LoopStepDefinition\": {\n \"allow_untrusted\": \"list<scalar>\",\n \"condition\": \"scalar\",\n \"credential\": \"scalar\",\n \"credentials\": \"map<StepCredentialBinding>\",\n \"description\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"executor\": \"scalar\",\n \"id\": \"scalar\",\n \"next\": \"NextLogicDefinition\",\n \"output_schema\": \"InputSchema\",\n \"post_processing\": \"list<any>\",\n \"pre_processing\": \"list<any>\",\n \"query\": \"map<any>\",\n \"response_evaluation\": \"scalar\",\n \"trusted_output\": \"scalar\"\n },\n \"MockBinaryAsset\": {\n \"filename\": \"scalar\",\n \"id\": \"scalar\",\n \"metadata\": \"map<scalar>\",\n \"mime_type\": \"scalar\",\n \"size\": \"scalar\",\n \"step_id\": \"scalar\"\n },\n \"MockStepDefinition\": {\n \"api_action\": \"scalar\",\n \"binary_assets\": \"map<MockBinaryAsset>\",\n \"content\": \"any\",\n \"cost\": \"scalar\",\n \"delay\": \"scalar\",\n \"error\": \"scalar\"\n },\n \"NextLogicDefinition\": {\n \"conditions\": \"list<ConditionDefinition>\",\n \"default\": \"scalar\",\n \"parallel\": \"ParallelDefinition\"\n },\n \"OrchestratorDefinition\": {\n \"agentic\": \"scalar\",\n \"context_budget_tokens\": \"scalar\",\n \"context_strategy\": \"scalar\",\n \"conversation\": \"scalar\",\n \"deny_tools\": \"list<scalar>\",\n \"discoverable_tools\": \"list<scalar>\",\n \"enable_signals\": \"scalar\",\n \"enforce_region\": \"scalar\",\n \"engram_scope\": \"scalar\",\n \"exons\": \"scalar\",\n \"human_question_timeout\": \"scalar\",\n \"human_question_timeout_response\": \"scalar\",\n \"max_tool_calls\": \"scalar\",\n \"max_tool_turns\": \"scalar\",\n \"max_turns\": \"scalar\",\n \"mode\": \"scalar\",\n \"region\": \"scalar\",\n \"require_approval_for\": \"list<scalar>\",\n \"timeout_seconds\": \"scalar\",\n \"tool_discovery\": \"scalar\",\n \"tools\": \"list<scalar>\",\n \"triggers\": \"list<OrchestratorTriggerDef>\"\n },\n \"OrchestratorTriggerDef\": {\n \"condition\": \"scalar\",\n \"interval\": \"scalar\",\n \"type\": \"scalar\",\n \"watch\": \"scalar\"\n },\n \"ParallelDefinition\": {\n \"rendezvous\": \"scalar\",\n \"resolution\": \"scalar\",\n \"steps\": \"list<scalar>\"\n },\n \"PropertyDefinition\": {\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"format\": \"scalar\",\n \"items\": \"PropertyDefinition\",\n \"max_items\": \"scalar\",\n \"min_items\": \"scalar\",\n \"properties\": \"map<PropertyDefinition>\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"QualityGateDefinition\": {\n \"goto_step\": \"scalar\",\n \"max_retries\": \"scalar\",\n \"model\": \"scalar\",\n \"on_fail\": \"scalar\",\n \"provider\": \"scalar\",\n \"rubric\": \"scalar\",\n \"threshold\": \"scalar\"\n },\n \"QueryDefinition\": {\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"items\": \"PropertyDefinition\",\n \"max_items\": \"scalar\",\n \"min_items\": \"scalar\",\n \"properties\": \"map<PropertyDefinition>\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"untrusted\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"StepCredentialBinding\": {\n \"inject_as\": \"scalar\",\n \"source\": \"scalar\"\n },\n \"StepDefinition\": {\n \"allow_untrusted\": \"list<scalar>\",\n \"condition\": \"scalar\",\n \"credential\": \"scalar\",\n \"credentials\": \"map<StepCredentialBinding>\",\n \"description\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"executor\": \"scalar\",\n \"failover\": \"FailoverConfig\",\n \"for_each\": \"ForEachDefinition\",\n \"loop\": \"LoopDefinition\",\n \"max_duration\": \"scalar\",\n \"next\": \"NextLogicDefinition\",\n \"output_schema\": \"InputSchema\",\n \"post_processing\": \"list<any>\",\n \"pre_processing\": \"list<any>\",\n \"quality_gate\": \"QualityGateDefinition\",\n \"query\": \"map<any>\",\n \"response_evaluation\": \"scalar\",\n \"response_expectation\": \"map<FieldExpectationDefinition>\",\n \"trusted_output\": \"scalar\"\n },\n \"ThrottleDefinition\": {\n \"batch_delay\": \"scalar\",\n \"batch_size\": \"scalar\",\n \"delay\": \"scalar\"\n },\n \"VisibleWhenPredicate\": {\n \"equals\": \"any\",\n \"field\": \"scalar\",\n \"in\": \"list<any>\"\n }\n }\n }\n}\n","// Typed accessor over the vendored enum spec. The JSON is the single source\n// of the protocol/type names; this module exposes it as frozen Sets/values for\n// fast, immutable lookups by the validators.\n\n// The JSON is bundled (inlined) by tsup/esbuild at build time, so there is no\n// runtime JSON module load to worry about across ESM/CJS targets.\nimport spec from './aigentflow-spec.json';\n\n/** The AIgentFlow version whose flow schema this validator tracks. */\nexport const SPEC_VERSION: string = spec.specVersion;\n\n/** Current supported `input_schema.version`. */\nexport const INPUT_SCHEMA_VERSION: number = spec.inputSchemaVersion;\n\n/** Known executor URI schemes. Unknown schemes are warned, not rejected. */\nexport const EXECUTOR_SCHEMES: ReadonlySet<string> = new Set(spec.executorSchemes);\n\n/** Valid data types for query params, array items, and response expectations. */\nexport const DATA_TYPES: ReadonlySet<string> = new Set(spec.dataTypes);\n\n/** Valid `error_strategy.action` values. */\nexport const ERROR_STRATEGY_ACTIONS: ReadonlySet<string> = new Set(spec.errorStrategyActions);\n\n/** Valid `error_strategy.retry_on` error categories. */\nexport const RETRY_ON_CATEGORIES: ReadonlySet<string> = new Set(spec.retryOnCategories);\n\n/**\n * `next` targets the reference's SAVE door accepts without a step of that name:\n * `null` and `orchestrator`. `end` is not one of them — `validateNextLogic`\n * (parser.go) looks `end` up as a step and refuses the flow when none exists.\n */\nexport const NEXT_MARKERS: ReadonlySet<string> = new Set(spec.nextMarkers);\n\n/**\n * Targets the reachability and cycle walks treat as \"control leaves the graph\".\n *\n * Since AIgentFlow v2.760.0 this holds the same values as {@link NEXT_MARKERS}:\n * no reference walk treats `end` as a terminal any more, so a real step named\n * `end` is reachable and a cycle through it is a cycle. Until then this set was\n * WIDER (it carried `end`), and a step named `end` that only `end` routed to was\n * reported `unreachable_step`. The two stay separate spec keys so a future\n * split is a one-value change.\n */\nexport const REACHABILITY_TERMINAL_MARKERS: ReadonlySet<string> = new Set(\n spec.reachabilityTerminalMarkers,\n);\n\n/** Valid `next.parallel.resolution` values. */\nexport const PARALLEL_RESOLUTIONS: ReadonlySet<string> = new Set(spec.parallelResolutions);\n\n/** Valid `for_each.resolution` values. */\nexport const FOR_EACH_RESOLUTIONS: ReadonlySet<string> = new Set(spec.forEachResolutions);\n\n/** Hard cap for `loop.max_iterations`. */\nexport const LOOP_MAX_ITERATIONS_LIMIT: number = spec.loopMaxIterationsLimit;\n\n/**\n * The ONE executor-URL shape, mirrored verbatim from `URL_PATTERN_REGEX` in\n * `aigentflow/aigentflow.domain.executorregistry.go`.\n *\n * AIgentFlow has exactly one executor-URL parser (`ParseExecutorURLString`), and\n * since v2.598.0 (DC-FORGE-30) its own static validation applies it at authoring\n * time — so `openai:///gpt-4` is refused at save instead of failing at dispatch.\n * Note how much stricter it is than a generic URI: the authority segment is\n * required and non-empty, and neither authority nor path may contain a dot.\n */\nexport const EXECUTOR_URL_PATTERN: RegExp = new RegExp(spec.executorUrlPattern);\n\n/** Opening delimiter of a Go-template action; a URL containing one is rendered before dispatch. */\nexport const TEMPLATE_ACTION_OPEN: string = spec.templateActionOpen;\n\n/** Credential binding source prefix (`stored/{provider}/{name}`). */\nexport const CREDENTIAL_REFERENCE_PREFIX: string = spec.credentialReferencePrefix;\n\n/** input_schema constants and limits. */\nexport const INPUT_SCHEMA = {\n types: new Set(spec.inputSchema.types) as ReadonlySet<string>,\n stringTypes: new Set(spec.inputSchema.stringTypes) as ReadonlySet<string>,\n parametricTypes: new Set(spec.inputSchema.parametricTypes) as ReadonlySet<string>,\n fieldNamePattern: new RegExp(spec.inputSchema.fieldNamePattern),\n datePattern: new RegExp(spec.inputSchema.datePattern),\n maxPatternLength: spec.inputSchema.maxPatternLength,\n maxConstraintValue: spec.inputSchema.maxConstraintValue,\n maxInputKeyCount: spec.inputSchema.maxInputKeyCount,\n maxStringInputLength: spec.inputSchema.maxStringInputLength,\n} as const;\n\n/** Valid orchestrator trigger types. */\nexport const ORCHESTRATOR_TRIGGERS: ReadonlySet<string> = new Set(spec.orchestrator.triggers);\n\n/** Recognised orchestrator tool names (vendored allow-list, may lag). */\nexport const ORCHESTRATOR_TOOLS: ReadonlySet<string> = new Set(spec.orchestrator.tools);\n\n/** Orchestrator termination-authority modes (DC-COND-1). Default = monitor. */\nexport const ORCHESTRATOR_MODES: ReadonlySet<string> = new Set(spec.orchestrator.modes);\n\n/** Recognised Go template function names (Go builtins + AIgentFlow registry). */\nexport const TEMPLATE_FUNCTIONS: ReadonlySet<string> = new Set(spec.templateFunctions);\n\n/** Canonical `eval://judge` URL invoked by the quality_gate machinery. */\nexport const EVAL_JUDGE_URL: string = spec.evalJudgeUrl;\n\n/** `quality_gate:` step-block constants and limits (DC-CP-8). */\nexport const QUALITY_GATE = {\n /** Accepted `on_fail` actions. */\n onFailActions: new Set(spec.qualityGate.onFailActions) as ReadonlySet<string>,\n /**\n * `on_fail` values that exist in the Go enum but are currently\n * validation-REJECTED (e.g. `human`, pending the human-task inbox).\n */\n onFailRejected: new Set(spec.qualityGate.onFailRejected) as ReadonlySet<string>,\n thresholdMin: spec.qualityGate.thresholdMin,\n thresholdMax: spec.qualityGate.thresholdMax,\n} as const;\n\n/**\n * The fixed `expression_functions:` catalog (DC-FORGE-72).\n *\n * The catalog is compiled into the AIgentFlow binary — nothing is loaded at run\n * time, ever — so it is an enumerable set, and a `function:` outside it is an\n * error rather than a lag-prone allow-list warning (contrast divergence #4).\n * Every entry carries {@link EXPRESSION_FUNCTION_NAME_PREFIX} so a catalog entry\n * can never shadow a standard template function such as `index` or `default`.\n */\nexport const EXPRESSION_FUNCTION_CATALOG: ReadonlySet<string> = new Set(\n spec.expressionFunctions.catalog,\n);\n\n/** Mandatory namespace prefix carried by every catalog entry. */\nexport const EXPRESSION_FUNCTION_NAME_PREFIX: string = spec.expressionFunctions.namePrefix;\n\n/**\n * Pre/post-processing operation dispatch set and per-operation config keys.\n *\n * Two things are modelled here and neither may be flattened into the other:\n *\n * - **Scope.** The standard handler (every top-level step's pre/post-processing)\n * dispatches {@link PROCESSING_OPERATIONS.standardTypes}. A loop sub-step's\n * post-processing handles `loop.set` / `loop.break` itself before delegating,\n * so those two are legal only there. Keeping them apart is the point: a name\n * in the wrong half is exactly the mistake a merged set cannot see.\n * - **Key sets are PER OPERATION, never a union.** `asset_id` is read by\n * `binary.get`/`binary.update`/`binary.delete` and is NOT read by\n * `binary.transform`, which reads `source_asset_id`. A union-based check would\n * pass the wrong-half key, which is the defect class this rule exists for.\n *\n * `openKeyTypes` are the operations whose config keys are chosen by the AUTHOR\n * (`data.set` writes every key into `.data`, `output.set` into `.output`,\n * `conversation.append` treats every key as a conversation id, `loop.set` as a\n * loop variable), so \"unknown key\" is not a notion that applies to them at all.\n *\n * Scope note: only TOP-LEVEL config keys are modelled. Sub-keys of `metadata:`\n * (the asset store's vocabulary) and `parameters:` (the transformer's) are not.\n */\nexport const PROCESSING_OPERATIONS = {\n /** The optional guard key, a sibling of the operation key rather than a config key. */\n guardKey: spec.processingOperations.guardKey,\n /** Operation types the standard (top-level step) handler dispatches. */\n standardTypes: new Set(spec.processingOperations.standardTypes) as ReadonlySet<string>,\n /** Operation types dispatchable ONLY in a loop sub-step's post_processing. */\n loopSubStepTypes: new Set(spec.processingOperations.loopSubStepTypes) as ReadonlySet<string>,\n /** Operations whose config keys are author-chosen; they have no unknown-key notion. */\n openKeyTypes: new Set(spec.processingOperations.openKeyTypes) as ReadonlySet<string>,\n /** Per-operation top-level config keys, for the operations with a CLOSED key set. */\n closedConfigKeys: spec.processingOperations.closedConfigKeys as Readonly<\n Record<string, readonly string[]>\n >,\n} as const;\n\n/**\n * The top-level config keys an operation reads, and whether that set is CLOSED.\n *\n * A `false` second element means there is no basis for a verdict about a key —\n * either the operation chooses its own key names, or the type is not\n * dispatchable at all. Callers must check the flag rather than the array length.\n */\nexport function processingOperationConfigKeys(operationType: string): [readonly string[], boolean] {\n if (PROCESSING_OPERATIONS.openKeyTypes.has(operationType)) return [[], false];\n const keys = PROCESSING_OPERATIONS.closedConfigKeys[operationType];\n return keys === undefined ? [[], false] : [keys, true];\n}\n\n/**\n * The key set the reference's strict save parser enforces at every level of a\n * flow document, derived from its own types (see the `$comment` in the JSON).\n * `types[T]` maps each key a struct type declares to the SHAPE of its value.\n */\nexport const KNOWN_KEYS = spec.knownKeys as {\n readonly root: string;\n readonly types: Readonly<Record<string, Readonly<Record<string, string>>>>;\n};\n\n/**\n * Which orchestrator tools the inline `.exons` definition's `tools.allow` may\n * withhold (AIgentFlow v2.760.0, `orchestrator_tool_withheld`). A tool is offered\n * only if it passes BOTH `orchestrator.tools` (empty = every tool) AND\n * `tools.allow` (absent = no narrowing). The lifecycle tools, and the signal\n * tools while `enable_signals` is on (the default), are exempt from\n * `tools.allow`.\n */\nexport const ORCHESTRATOR_TOOL_ALLOW = {\n warningField: spec.orchestratorToolAllow.warningField,\n askHumanTool: spec.orchestratorToolAllow.askHumanTool,\n enableSignalsDefault: spec.orchestratorToolAllow.enableSignalsDefault,\n lifecycleTools: spec.orchestratorToolAllow.lifecycleTools as readonly string[],\n signalTools: spec.orchestratorToolAllow.signalTools as readonly string[],\n campaignTools: spec.orchestratorToolAllow.campaignTools as readonly string[],\n} as const;\n\n/** Where an inline `.exons` document arrives at the save door. */\nexport const EXONS = {\n /** A step's document is judged only on an executor with this prefix. */\n executorPrefix: spec.exons.executorPrefix,\n /** The step `query` parameter that carries the document. */\n documentParam: spec.exons.documentParam,\n /** The YAML frontmatter delimiter line. */\n frontmatterDelimiter: spec.exons.frontmatterDelimiter,\n} as const;\n\n/**\n * `executor_config` may expand only the environment variables of the key it is\n * written under (AIgentFlow v2.597.0, `executor_config_env_scope`). `scopes` is\n * the reference's own scope function evaluated for every key that has one; a\n * key absent from it has an EMPTY scope and refuses every reference.\n */\nexport const EXECUTOR_CONFIG_ENV_SCOPES = {\n referencePrefix: spec.executorConfigEnvScopes.referencePrefix,\n referenceSuffix: spec.executorConfigEnvScopes.referenceSuffix,\n fields: spec.executorConfigEnvScopes.fields as readonly string[],\n extraKey: spec.executorConfigEnvScopes.extraKey,\n scopes: spec.executorConfigEnvScopes.scopes as Readonly<Record<string, readonly string[]>>,\n} as const;\n\n/**\n * Executor parameters only the server's credential resolver may set (AIgentFlow\n * CFX-05, `server_owned_query_key`). A step's or loop sub-step's `query:` that\n * declares one is refused. `keys` is matched exactly and case-sensitively; the\n * two formats are the reference's field paths, `%s` filled in order.\n */\nexport const SERVER_OWNED_QUERY_KEYS = {\n keys: spec.serverOwnedQueryKeys.keys as readonly string[],\n stepFieldFormat: spec.serverOwnedQueryKeys.stepFieldFormat,\n loopStepFieldFormat: spec.serverOwnedQueryKeys.loopStepFieldFormat,\n} as const;\n\n/**\n * `flow_data_key_reserved`: top-level `data:` keys that name engine state. `exact`\n * maps a name to its reason; `prefixes` are checked in order, first match wins.\n * `messageFormat` takes the quoted key then the reason; `fieldFormat` the key.\n */\nexport const FLOW_DATA_RESERVED_KEYS = {\n code: spec.flowDataReservedKeys.code,\n fieldFormat: spec.flowDataReservedKeys.fieldFormat,\n messageFormat: spec.flowDataReservedKeys.messageFormat,\n suggestion: spec.flowDataReservedKeys.suggestion,\n exact: spec.flowDataReservedKeys.exact as Readonly<Record<string, string>>,\n prefixes: spec.flowDataReservedKeys.prefixes as readonly {\n readonly prefix: string;\n readonly reason: string;\n }[],\n} as const;\n\n/** One row of the reference's per-protocol credential/endpoint family table. */\nexport interface CredentialEndpointFamily {\n readonly protocol: string;\n readonly configKeys: readonly string[];\n readonly secretParams: readonly string[];\n readonly endpointParams: readonly string[];\n readonly defaultEndpoints: readonly string[];\n readonly configApiKeyParam: string;\n readonly configBaseUrlParam: string;\n readonly implicitServerCredential: boolean;\n readonly expandsServerEnvReferences: boolean;\n /** The family's server-variable set, evaluated from the reference's scope tables. */\n readonly serverEnv: readonly string[];\n}\n\n/**\n * The data of `credential_endpoint_unpaired` (AIgentFlow DC-FORGE-231 and\n * DC-FORGE-233): the ai:// provider rule's names and sets, the per-protocol\n * family table, the default ports, and the reference's field formats (`%s`\n * filled in order). A new family is a change to this data only.\n */\nexport const CREDENTIAL_ENDPOINT_PAIRING = {\n stepFieldFormat: spec.credentialEndpointPairing.stepFieldFormat,\n loopStepFieldFormat: spec.credentialEndpointPairing.loopStepFieldFormat,\n executorConfigBaseUrlFieldFormat: spec.credentialEndpointPairing.executorConfigBaseUrlFieldFormat,\n executorConfigKeyFieldFormat: spec.credentialEndpointPairing.executorConfigKeyFieldFormat,\n executorConfigExtraFieldFormat: spec.credentialEndpointPairing.executorConfigExtraFieldFormat,\n executorConfigApiKeyField: spec.credentialEndpointPairing.executorConfigApiKeyField,\n executorConfigBaseUrlField: spec.credentialEndpointPairing.executorConfigBaseUrlField,\n protocolSeparator: spec.credentialEndpointPairing.protocolSeparator,\n defaultPorts: spec.credentialEndpointPairing.defaultPorts as Readonly<Record<string, string>>,\n ai: {\n protocol: spec.credentialEndpointPairing.ai.protocol,\n genericKeyParam: spec.credentialEndpointPairing.ai.genericKeyParam,\n providerKeyParamSuffix: spec.credentialEndpointPairing.ai.providerKeyParamSuffix,\n providerBaseUrlParamSuffix: spec.credentialEndpointPairing.ai.providerBaseUrlParamSuffix,\n keylessProviders: spec.credentialEndpointPairing.ai.keylessProviders as readonly string[],\n executorConfigProviders: spec.credentialEndpointPairing.ai\n .executorConfigProviders as readonly string[],\n },\n familyKeySeparator: spec.credentialEndpointPairing.familyKeySeparator,\n families: spec.credentialEndpointPairing.families as Readonly<\n Record<string, CredentialEndpointFamily>\n >,\n} as const;\n\n/**\n * The data of `compliance_residency_unenforced` (AIgentFlow v2.821.0): the\n * EU-only residency codes, the region-lane providers, the parameter names and\n * the reference's site, field and message formats.\n */\nexport const COMPLIANCE_RESIDENCY = {\n code: spec.complianceResidency.code,\n euResidencyCodes: spec.complianceResidency.euResidencyCodes as readonly string[],\n regionLaneProviders: spec.complianceResidency.regionLaneProviders as readonly string[],\n aiProtocol: spec.complianceResidency.aiProtocol,\n protocolSeparator: spec.complianceResidency.protocolSeparator,\n regionParam: spec.complianceResidency.regionParam,\n enforceRegionParam: spec.complianceResidency.enforceRegionParam,\n baseUrlParamSuffix: spec.complianceResidency.baseUrlParamSuffix,\n enforceRegionTrueStrings: spec.complianceResidency.enforceRegionTrueStrings as readonly string[],\n stepFieldFormat: spec.complianceResidency.stepFieldFormat,\n loopStepFieldFormat: spec.complianceResidency.loopStepFieldFormat,\n orchestratorField: spec.complianceResidency.orchestratorField,\n siteStepFormat: spec.complianceResidency.siteStepFormat,\n siteLoopStepFormat: spec.complianceResidency.siteLoopStepFormat,\n siteOrchestrator: spec.complianceResidency.siteOrchestrator,\n messageFormat: spec.complianceResidency.messageFormat,\n suggestion: spec.complianceResidency.suggestion,\n} as const;\n\n/** One credential-shaped literal the `examples:` block refuses. */\nexport interface ExampleSecretPattern {\n readonly name: string;\n readonly expr: string;\n readonly flags: string;\n}\n\n/**\n * The data of the `examples:` rules: limits, closed vocabularies, the id / tag /\n * sha256 / media-type patterns, the reserved reference schemes, the\n * credential-shaped-literal set and each code's severity. Every number and\n * pattern the rules use is read from here, never typed into the module.\n */\nexport const EXAMPLES = {\n limits: spec.examples.limits,\n idPattern: new RegExp(spec.examples.idPattern),\n tagPattern: new RegExp(spec.examples.tagPattern),\n sha256Pattern: new RegExp(spec.examples.sha256Pattern),\n mediaTypePattern: new RegExp(spec.examples.mediaTypePattern),\n // The reference writes this pattern case-insensitively (`(?i)`); the spec\n // carries the bare expression, so the flag is applied here.\n signedUrlQueryKeyPattern: new RegExp(spec.examples.signedUrlQueryKeyPattern, 'i'),\n origins: new Set<string>(spec.examples.origins),\n sideEffects: new Set<string>(spec.examples.sideEffects),\n statuses: new Set<string>(spec.examples.statuses),\n reservedRefSchemes: new Set<string>(spec.examples.reservedRefSchemes),\n secretPatterns: (spec.examples.secretPatterns as readonly ExampleSecretPattern[]).map((p) => ({\n name: p.name,\n re: new RegExp(p.expr, p.flags),\n })),\n codes: spec.examples.codes as Readonly<Record<string, 'error' | 'warning'>>,\n} as const;\n\n/** The piped-`default` rule: code, function name, message and suggestion. */\nexport const TEMPLATE_DEFAULT_PIPED = {\n code: spec.templateDefaultPiped.code,\n function: spec.templateDefaultPiped.function,\n messageFormat: spec.templateDefaultPiped.messageFormat,\n suggestion: spec.templateDefaultPiped.suggestion,\n};\n\n/**\n * `unknown_function_operation`: the closed set of built-in `function://` operations\n * (authority + \"/\" + path, sorted). `messageFormat` takes the quoted step id, the\n * operation, then the comma-joined list; `suggestionFormat` takes the list.\n */\nexport const FUNCTION_OPERATIONS = {\n code: spec.functionOperations.code,\n scheme: spec.functionOperations.scheme,\n messageFormat: spec.functionOperations.messageFormat,\n suggestionFormat: spec.functionOperations.suggestionFormat,\n operations: new Set<string>(spec.functionOperations.operations),\n sorted: spec.functionOperations.operations as readonly string[],\n} as const;\n\n/**\n * `atlas://` rules. Every message format takes the quoted step id first; the\n * operation and capability-ref messages take one more value.\n */\nconst atlas = spec.atlasExecutor;\nexport const ATLAS_EXECUTOR = {\n scheme: atlas.scheme,\n providerAgent: atlas.providerAgent,\n providerCapability: atlas.providerCapability,\n agentResource: atlas.agentResource,\n capabilityRefPattern: new RegExp(atlas.capabilityRefPattern),\n operationUnknown: atlas.operationUnknown,\n agentMissing: atlas.agentMissing,\n agentNotLiteral: atlas.agentNotLiteral,\n capabilitiesNotLiteral: atlas.capabilitiesNotLiteral,\n promptMissing: atlas.promptMissing,\n promptBoth: atlas.promptBoth,\n capabilityRefInvalid: atlas.capabilityRefInvalid,\n modelNotLiteral: atlas.modelNotLiteral,\n paramRefused: {\n code: atlas.paramRefused.code,\n messageFormat: atlas.paramRefused.messageFormat,\n suggestion: atlas.paramRefused.suggestion,\n agentKeys: atlas.paramRefused.agentKeys as readonly string[],\n capabilityKeys: atlas.paramRefused.capabilityKeys as readonly string[],\n },\n} as const;\n\n/** `reserved_input_name`: an input declared in the platform's `__` namespace. */\nexport const RESERVED_INPUT_NAMES = {\n prefix: spec.reservedInputNames.prefix,\n code: spec.reservedInputNames.code,\n messageFormat: spec.reservedInputNames.messageFormat,\n suggestion: spec.reservedInputNames.suggestion,\n queryFieldFormat: spec.reservedInputNames.queryFieldFormat,\n schemaFieldFormat: spec.reservedInputNames.schemaFieldFormat,\n} as const;\n","// Executor URI checks.\n//\n// Until AIgentFlow v2.598.0 the Go static validator did not parse executor URLs\n// at all — the live registry decided at dispatch — so this validator carried a\n// deliberately loose \"is it `scheme://path`\" check. DC-FORGE-30 changed that:\n// `FlowParser.ValidateFlow` now applies the ONE parser (`ParseExecutorURLString`,\n// i.e. `URL_PATTERN_REGEX`) to every step executor, and DC-FORGE-38 extended it\n// to `loop.steps[i].executor`. A URL this file accepted and AIgentFlow refuses\n// at save is a false PASS — the worst direction for an offline validator — so\n// the shape check is now that same regex, mirrored verbatim.\n//\n// Classification is unchanged:\n// - unparsable URL → error (`invalid_executor_url`): AIgentFlow refuses it too;\n// - unknown scheme → warning (`unknown_executor_scheme`): the vendored list lags\n// the registry, and the Go side never rejects on scheme. See PARITY.md #1.\n//\n// TEMPLATED URLs ARE SKIPPED, exactly as the Go rule skips them. The engine\n// renders `step.executor` as a Go template before dispatch, so\n// `flow://stored/{{ .query.child_flow_id }}` is legitimate and cannot be checked\n// statically. Omitting this exception rejected eight working bundled flows when\n// the Go rule was first written.\n\nimport type { Flow, LoopSubStep, StepDefinition } from '../types.js';\nimport {\n ATLAS_EXECUTOR,\n EXECUTOR_SCHEMES,\n EXECUTOR_URL_PATTERN,\n FUNCTION_OPERATIONS,\n TEMPLATE_ACTION_OPEN,\n} from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst SCHEME_SEPARATOR = '://';\n\nconst UNKNOWN_SCHEME_BASE = (scheme: string): string =>\n `Unknown executor scheme '${scheme}'. It may be valid in a newer AIgentFlow release, or it could be a typo.`;\nconst DECIDE_SCHEME = 'decide';\nconst DECIDE_HINT =\n 'Decision models run through ai://{provider}/decide (for example ai://openai/decide), not through a scheme of their own.';\nconst MAX_SCHEME_EDIT_DISTANCE = 2;\n\n/** Levenshtein distance over UTF-16 code units (schemes are ASCII). */\nfunction editDistance(a: string, b: string): number {\n let prev = Array.from({ length: b.length + 1 }, (_, j) => j);\n for (let i = 1; i <= a.length; i++) {\n const cur = [i];\n for (let j = 1; j <= b.length; j++) {\n cur[j] = Math.min(\n prev[j]! + 1,\n cur[j - 1]! + 1,\n prev[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1),\n );\n }\n prev = cur;\n }\n return prev[b.length]!;\n}\n\n/**\n * The warning text: the base sentence, then for `decide` the pointer to\n * ai://<p>/decide, else a nearest known scheme within edit distance 2\n * (case-insensitive; the closest wins, ties to the alphabetically first).\n */\nfunction unknownSchemeMessage(scheme: string): string {\n const lower = scheme.toLowerCase();\n const base = UNKNOWN_SCHEME_BASE(scheme);\n if (lower === DECIDE_SCHEME) return `${base} ${DECIDE_HINT}`;\n let best: string | undefined;\n let bestDist = MAX_SCHEME_EDIT_DISTANCE + 1;\n for (const known of [...EXECUTOR_SCHEMES].sort()) {\n const d = editDistance(lower, known);\n if (d < bestDist) {\n best = known;\n bestDist = d;\n }\n }\n return best === undefined ? base : `${base} Did you mean '${best}'?`;\n}\n\nfunction checkExecutor(executor: string, field: string, stepID: string, issues: Issues): void {\n const sepIdx = executor.indexOf(SCHEME_SEPARATOR);\n const scheme = sepIdx > 0 ? executor.slice(0, sepIdx) : '';\n\n // A templated URL is rendered by the engine before dispatch, so its shape\n // cannot be judged here. The scheme is still checked when the scheme itself\n // carries no template, because that half is knowable.\n const templated = executor.includes(TEMPLATE_ACTION_OPEN);\n\n if (!templated && !EXECUTOR_URL_PATTERN.test(executor)) {\n issues.error({\n field,\n message: `Executor '${executor}' is not a usable executor URL`,\n code: 'invalid_executor_url',\n stepId: stepID,\n suggestion:\n \"Use the form 'scheme://authority/path' with a non-empty authority (e.g., 'ai://openai/chat'). \" +\n 'Authority and path accept letters, digits, underscore and hyphen only.',\n });\n return;\n }\n\n if (scheme === '' || scheme.includes(TEMPLATE_ACTION_OPEN)) return;\n\n if (!EXECUTOR_SCHEMES.has(scheme.toLowerCase())) {\n issues.warn({\n field,\n message: unknownSchemeMessage(scheme),\n code: 'unknown_executor_scheme',\n stepId: stepID,\n });\n return;\n }\n\n checkFunctionOperation(executor, field, stepID, templated, issues);\n}\n\n// `atlas://` rules. Runs only for an untemplated `atlas://` URL (the scheme match\n// is exact and case-sensitive). The URL says which Atlas operation the step\n// performs; the query is checked against what that operation needs. `stepField`\n// is the step itself, as the findings are about the step as a whole.\n//\n// The URL is split at the first slash after `atlas://` rather than through the\n// shared executor-URL shape, so a reference the shape refuses (a dot or colon in\n// a capability reference) is still judged by the atlas rules; the shape's own\n// `invalid_executor_url` finding is reported separately, as before.\nfunction checkAtlasStep(\n executor: string,\n query: unknown,\n stepField: string,\n stepID: string,\n issues: Issues,\n): void {\n if (executor.includes(TEMPLATE_ACTION_OPEN)) return;\n const prefix = `${ATLAS_EXECUTOR.scheme}://`;\n if (!executor.startsWith(prefix)) return;\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n const provider = slash < 0 ? rest : rest.slice(0, slash);\n const resource = slash < 0 ? '' : rest.slice(slash + 1);\n const quoted = JSON.stringify(stepID);\n const report = (\n rule: { code: string; messageFormat: string; suggestion: string },\n ...args: string[]\n ): void => {\n let message = rule.messageFormat.replace('%s', () => quoted);\n for (const a of args) message = message.replace('%s', () => a);\n issues.error({\n field: stepField,\n message,\n code: rule.code,\n stepId: stepID,\n suggestion: rule.suggestion,\n });\n };\n const q: Record<string, unknown> = isRecord(query) ? query : {};\n let refusedKeys: readonly string[] = ATLAS_EXECUTOR.paramRefused.capabilityKeys;\n\n if (provider === ATLAS_EXECUTOR.providerCapability) {\n if (!ATLAS_EXECUTOR.capabilityRefPattern.test(resource)) {\n report(ATLAS_EXECUTOR.capabilityRefInvalid, resource);\n }\n } else if (\n provider === ATLAS_EXECUTOR.providerAgent &&\n resource === ATLAS_EXECUTOR.agentResource\n ) {\n refusedKeys = ATLAS_EXECUTOR.paramRefused.agentKeys;\n const agent = q.agent;\n if (typeof agent !== 'string' || agent.trim() === '') {\n report(ATLAS_EXECUTOR.agentMissing);\n } else if (agent.includes(TEMPLATE_ACTION_OPEN)) {\n report(ATLAS_EXECUTOR.agentNotLiteral);\n }\n const hasPrompt = atlasTextPresent(q.prompt);\n const hasTemplate = atlasTextPresent(q.prompt_template);\n if (!hasPrompt && !hasTemplate) report(ATLAS_EXECUTOR.promptMissing);\n else if (hasPrompt && hasTemplate) report(ATLAS_EXECUTOR.promptBoth);\n if (anyTemplate(q.model)) report(ATLAS_EXECUTOR.modelNotLiteral);\n } else {\n report(ATLAS_EXECUTOR.operationUnknown, executor);\n return;\n }\n\n // A templated capability entry is refused wherever the list appears on an\n // atlas:// step, nested values included.\n if (anyTemplate(q.capabilities)) report(ATLAS_EXECUTOR.capabilitiesNotLiteral);\n\n // One finding per step, listing every key the platform owns that it carries.\n const refused = refusedKeys.filter((key) => Object.prototype.hasOwnProperty.call(q, key)).sort();\n if (refused.length > 0) report(ATLAS_EXECUTOR.paramRefused, refused.join(', '));\n}\n\n/** True when a string, or any string nested in a list or mapping, holds a template action. */\nfunction anyTemplate(v: unknown): boolean {\n if (typeof v === 'string') return v.includes(TEMPLATE_ACTION_OPEN);\n if (Array.isArray(v)) return v.some(anyTemplate);\n if (isRecord(v)) return Object.values(v).some(anyTemplate);\n return false;\n}\n\n/** A value that is set: not absent, null, or a string that is empty after trimming. */\nfunction atlasTextPresent(v: unknown): boolean {\n if (v === undefined || v === null) return false;\n return typeof v !== 'string' || v.trim() !== '';\n}\n\n// `unknown_function_operation`: port of `validateFunctionOperationKnown`. Runs\n// only for an untemplated, parsable `function://` URL; the scheme match is exact,\n// as the reference's parsed type comparison is.\nfunction checkFunctionOperation(\n executor: string,\n field: string,\n stepID: string,\n templated: boolean,\n issues: Issues,\n): void {\n if (templated) return;\n const m = EXECUTOR_URL_PATTERN.exec(executor);\n if (m === null || m[1] !== FUNCTION_OPERATIONS.scheme) return;\n const op = `${m[2]}/${m[3]}`;\n if (FUNCTION_OPERATIONS.operations.has(op)) return;\n const list = FUNCTION_OPERATIONS.sorted.join(', ');\n issues.error({\n field,\n message: FUNCTION_OPERATIONS.messageFormat\n .replace('%s', () => JSON.stringify(stepID))\n .replace('%s', () => op)\n .replace('%s', () => list),\n code: FUNCTION_OPERATIONS.code,\n stepId: stepID,\n suggestion: FUNCTION_OPERATIONS.suggestionFormat.replace('%s', () => list),\n });\n}\n\nexport function validateExecutors(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n // A Go `string`: `executor: 42` is the URL \"42\", refused as a URL.\n const executor = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (executor !== null && executor !== '') {\n checkExecutor(executor, `steps.${stepID}.executor`, stepID, issues);\n checkAtlasStep(executor, step.query, `steps.${stepID}`, stepID, issues);\n }\n\n // Loop sub-steps each carry their own executor.\n const loop = step.loop;\n if (isRecord(loop) && Array.isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n const subPath = `steps.${stepID}.loop.steps[${i}]`;\n const subID = issues.stringOf(subStep, 'id', subPath) ?? String(i);\n const subExecutor = issues.stringOf(subStep, 'executor', subPath);\n if (subExecutor !== null && subExecutor !== '') {\n checkExecutor(\n subExecutor,\n `steps.${stepID}.loop.steps[${i}].executor`,\n `${stepID}.${subID}`,\n issues,\n );\n checkAtlasStep(subExecutor, subStep.query, subPath, `${stepID}.${subID}`, issues);\n }\n });\n }\n }\n}\n","// Flow-level `query:` input-parameter schema validation.\n//\n// Mirrors `validateQueryParameters` / `validateProperties` / `validateArrayItems`\n// / `validateArrayConstraints` (parser.go). Note: matching the Go reference,\n// the *top-level* param type is only required to be non-empty — it is NOT\n// constrained to the known data-type set (an unknown top-level type is a\n// warning here). Array *item* types ARE constrained, as in Go.\n\nimport type { Flow, PropertyDefinition } from '../types.js';\nimport { DATA_TYPES } from '../spec/index.js';\nimport { Issues, isInteger, isRecord } from './util.js';\n\nconst TYPE_OBJECT = 'object';\nconst TYPE_ARRAY = 'array';\n\n// Every `type` is a Go `string`, so `type: 1` is the type \"1\" — unknown, not\n// missing. Source spellings are keyed by DOCUMENT path, which the finding paths\n// below do not follow (they omit the `properties` segment and write `[item]`),\n// so each function also takes `src`, the document path of the definition that\n// owns the `items:` / `properties:` it reads.\n\nfunction validateArrayItems(items: unknown, path: string, src: string, issues: Issues): void {\n if (items === undefined || items === null || !isRecord(items)) {\n issues.error({\n field: path,\n message: `Array '${path}' must define an 'items' schema`,\n code: 'array_items_missing',\n });\n return;\n }\n const def = items as PropertyDefinition;\n const srcItems = `${src}.items`;\n const type = issues.stringOf(def, 'type', srcItems);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.items.type`,\n message: `Array items for '${path}' must define a 'type'`,\n code: 'array_items_type_invalid',\n });\n return;\n }\n if (!DATA_TYPES.has(type)) {\n issues.error({\n field: `${path}.items.type`,\n message: `Array items for '${path}' have invalid type '${type}'`,\n code: 'array_items_type_invalid',\n suggestion: `Use one of: ${[...DATA_TYPES].join(', ')}`,\n });\n return;\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, `${path}[item]`, srcItems, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, `${path}[item]`, srcItems, issues);\n }\n}\n\nfunction validateProperties(\n properties: unknown,\n parentPath: string,\n src: string,\n issues: Issues,\n): void {\n if (properties === undefined || properties === null) return;\n if (!isRecord(properties)) {\n issues.error({\n field: `${parentPath}.properties`,\n message: `properties of '${parentPath}' must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n for (const [propName, rawDef] of Object.entries(properties)) {\n const path = `${parentPath}.${propName}`;\n if (!isRecord(rawDef)) {\n issues.error({\n field: path,\n message: `Property '${propName}' must be a mapping`,\n code: 'invalid_type',\n });\n continue;\n }\n const def = rawDef as PropertyDefinition;\n const srcDef = `${src}.properties.${propName}`;\n const type = issues.stringOf(def, 'type', srcDef);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.type`,\n message: `Property '${propName}' in '${parentPath}' is missing a 'type'`,\n code: 'property_type_missing',\n });\n continue;\n }\n if (!DATA_TYPES.has(type)) {\n issues.warn({\n field: `${path}.type`,\n message: `Property '${propName}' has unrecognised type '${type}'`,\n code: 'unknown_data_type',\n });\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, path, srcDef, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, path, srcDef, issues);\n }\n }\n}\n\nfunction validateArrayConstraints(def: PropertyDefinition, path: string, issues: Issues): void {\n const min = def.min_items;\n const max = def.max_items;\n if (min !== undefined) {\n if (!isInteger(min) || min < 0) {\n issues.error({\n field: `${path}.min_items`,\n message: `min_items for '${path}' must be a non-negative integer`,\n code: 'array_min_items_invalid',\n });\n }\n }\n if (isInteger(min) && isInteger(max) && max < min) {\n issues.error({\n field: `${path}.max_items`,\n message: `max_items (${max}) for '${path}' must be >= min_items (${min})`,\n code: 'array_max_items_invalid',\n });\n }\n}\n\nexport function validateQuerySchema(flow: Flow, issues: Issues): void {\n const query = flow.query;\n if (query === undefined || query === null) return;\n if (!isRecord(query)) {\n issues.error({\n field: 'query',\n message: 'query must be a mapping of parameter name to definition',\n code: 'invalid_type',\n });\n return;\n }\n\n for (const [paramName, rawDef] of Object.entries(query)) {\n const path = `query.${paramName}`;\n if (!isRecord(rawDef)) {\n issues.error({\n field: path,\n message: `Query parameter '${paramName}' must be a mapping`,\n code: 'invalid_type',\n });\n continue;\n }\n const def = rawDef as PropertyDefinition;\n const type = issues.stringOf(def, 'type', path);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.type`,\n message: `Query parameter '${paramName}' is missing a 'type'`,\n code: 'query_param_type_missing',\n });\n continue;\n }\n if (!DATA_TYPES.has(type)) {\n issues.warn({\n field: `${path}.type`,\n message: `Query parameter '${paramName}' has unrecognised type '${type}'`,\n code: 'unknown_data_type',\n });\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, path, path, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, path, path, issues);\n validateArrayConstraints(def, path, issues);\n }\n }\n}\n","// Per-step `response_expectation` field validation.\n//\n// Union of the detailed validator (`validateSemantics` → type must be a known\n// data type) and the parser (`ValidateFlow` → array fields require `items`;\n// `required` must be a boolean or a string template). See PARITY.md.\n//\n// Plus `response_expectation_unread` (validation.go\n// `validateResponseExpectationIsRead`, AIF DC-FORGE-145): an expectation that\n// no evaluation mode will ever read.\n\nimport type { Flow, ResponseExpectationField } from '../types.js';\nimport { DATA_TYPES } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst TYPE_ARRAY = 'array';\nconst ASYNC_EXECUTOR_PREFIX = 'async://';\nconst CODE_RESPONSE_EXPECTATION_UNREAD = 'response_expectation_unread';\n\n/**\n * Go's `%q` for the identifiers a step id can hold. `JSON.stringify` produces\n * the same double-quoted, backslash-escaped form for printable ASCII; the two\n * differ only on non-ASCII and control characters, which no step id carries.\n */\nfunction goQuote(s: string): string {\n return JSON.stringify(s);\n}\n\n/**\n * The engine reads `response_expectation` ONLY when `response_evaluation` is\n * set: with no evaluation mode it returns the raw response untouched, so the\n * expectation's `required`, `type` and `fallback` are never consulted. The\n * reference found 25 such steps across 10 of its own bundled flows — among\n * them a requirement meant to fail an answer that had not searched, which\n * would have passed silently.\n *\n * `async://` is exempt: its respond route validates the posted output against\n * the expectation on its own, without any evaluation mode.\n *\n * WARNING, not error, matching the reference: it is consulted at the RUN door\n * over flows that are already stored, and the declaration is INERT — the run\n * does not die. Loop sub-steps cannot declare an expectation, so there is no\n * second step table to walk.\n */\nfunction warnIfUnread(\n stepID: string,\n step: Record<string, unknown>,\n re: Record<string, unknown>,\n issues: Issues,\n): void {\n if (Object.keys(re).length === 0) return;\n const evaluation = issues.stringOf(step, 'response_evaluation', `steps.${stepID}`);\n if (evaluation !== null && evaluation !== '') return;\n const executor = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (executor !== null && executor.startsWith(ASYNC_EXECUTOR_PREFIX)) return;\n issues.warn({\n field: `steps.${stepID}.response_expectation`,\n message: `response_expectation on step ${goQuote(stepID)} is never checked: the engine reads it only when response_evaluation is set, and this step sets none, so required, type and fallback do nothing. Add response_evaluation: \"raw-text\" to check these fields against the executor's response unchanged, or remove response_expectation.`,\n code: CODE_RESPONSE_EXPECTATION_UNREAD,\n stepId: stepID,\n });\n}\n\nexport function validateResponseExpectations(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const re = rawStep.response_expectation;\n if (re === undefined || re === null) continue;\n if (!isRecord(re)) {\n issues.error({\n field: `steps.${stepID}.response_expectation`,\n message: 'response_expectation must be a mapping',\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n\n warnIfUnread(stepID, rawStep, re, issues);\n\n for (const [fieldName, rawField] of Object.entries(re)) {\n const base = `steps.${stepID}.response_expectation.${fieldName}`;\n if (!isRecord(rawField)) {\n issues.error({\n field: base,\n message: `response_expectation field '${fieldName}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n const field = rawField as ResponseExpectationField;\n\n // A Go `string`: `type: 1` is the invalid type \"1\".\n const type = issues.stringOf(field, 'type', base);\n if (type === null || !DATA_TYPES.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Invalid data type: ${type ?? String(field.type ?? '(none)')}`,\n code: 'invalid_data_type',\n stepId: stepID,\n suggestion: `Use one of: ${[...DATA_TYPES].join(', ')}`,\n });\n } else if (type === TYPE_ARRAY && (field.items === undefined || field.items === null)) {\n issues.error({\n field: `${base}.items`,\n message: `Array field '${fieldName}' in step '${stepID}' must define 'items'`,\n code: 'response_expectation_array_items_missing',\n stepId: stepID,\n });\n }\n\n if (field.required !== undefined) {\n const t = typeof field.required;\n if (t !== 'boolean' && t !== 'string') {\n issues.error({\n field: `${base}.required`,\n message: `response_expectation.${fieldName}.required must be a boolean or a string template`,\n code: 'invalid_field_value',\n stepId: stepID,\n });\n }\n }\n }\n }\n}\n","// Flow-level and per-step `error_strategy` validation.\n//\n// Mirrors `validateErrorStrategy` (parser.go): action enum, goto target\n// existence, max_delay duration, backoff_multiplier > 0, retry_on categories —\n// plus `unreachable_error_goto` (validation.go, AIF v2.651.0 / DC-FORGE-81) and\n// `loop_substep_error_goto_ignored` (validation.go, AIF v2.652.0 / DC-FORGE-82).\n\nimport type { ErrorStrategyDefinition, Flow } from '../types.js';\nimport { ERROR_STRATEGY_ACTIONS, RETRY_ON_CATEGORIES } from '../spec/index.js';\nimport { Issues, isNumber, isRecord, isValidGoDuration } from './util.js';\n\nconst ACTION_GOTO = 'goto';\n\nfunction validateOne(\n strategy: ErrorStrategyDefinition,\n steps: Record<string, unknown>,\n field: string,\n stepID: string | undefined,\n issues: Issues,\n): void {\n // Every field below is a Go `string`: `action: 1` is the invalid action \"1\",\n // `goto_step: 2` names the step \"2\".\n const action = issues.stringOf(strategy, 'action', field);\n if (action !== null && action !== '' && !ERROR_STRATEGY_ACTIONS.has(action)) {\n issues.error({\n field: `${field}.action`,\n message: `Invalid error_strategy action '${action}'`,\n code: 'invalid_error_strategy_action',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion: `Use one of: ${[...ERROR_STRATEGY_ACTIONS].join(', ')}`,\n });\n }\n\n const gotoStep = issues.stringOf(strategy, 'goto_step', field);\n if (action === ACTION_GOTO) {\n const goto = gotoStep;\n if (goto === null || goto === '') {\n issues.error({\n field: `${field}.goto_step`,\n message: \"error_strategy action 'goto' requires a 'goto_step'\",\n code: 'goto_step_missing',\n ...(stepID ? { stepId: stepID } : {}),\n });\n } else if (!(goto in steps)) {\n issues.error({\n field: `${field}.goto_step`,\n message: `Referenced step '${goto}' in error_strategy does not exist`,\n code: 'step_not_found',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n }\n\n // A `goto_step` the action can never take. The engine switches on `action`\n // and reads `goto_step` in the `goto` branch ONLY; `retry`, `fail` and an\n // absent action all fall through to failing the mission. The check above only\n // asks whether the target EXISTS, and only once the action already is `goto` —\n // so the one combination that silently does nothing went unasked about.\n //\n // Not hypothetical: both of AIF's bundled example flows declared\n // `action: \"retry\"` beside a `goto_step:` naming an error handler, so neither\n // handler was reachable at all.\n //\n // WARNING, not error, matching the reference: it is consulted at the RUN door\n // over flows that are already stored, and the declaration is INERT rather than\n // fatal — the run does not die, it takes a different path.\n if (action !== ACTION_GOTO && gotoStep !== null && gotoStep !== '') {\n const shown = action === null || action === '' ? '(absent, defaults to fail)' : action;\n issues.warn({\n field: `${field}.goto_step`,\n message: `goto_step '${gotoStep}' on ${stepID ? `step '${stepID}'` : 'the flow-level error_strategy'} can never be taken: the engine reads goto_step only when action is \"goto\", and this action is '${shown}'`,\n code: 'unreachable_error_goto',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion:\n 'Set action: \"goto\" (retries still apply through max_retries), or remove goto_step',\n });\n }\n\n // A Go `string` field, filled from ANY scalar by its source text: `max_delay:\n // 100` is \"100\" (no unit) and refused, as is `0.0`; `0` saves.\n const maxDelay = issues.stringOf(strategy, 'max_delay', field);\n if (maxDelay !== null && maxDelay !== '' && !isValidGoDuration(maxDelay)) {\n issues.error({\n field: `${field}.max_delay`,\n message: `Invalid max_delay duration '${maxDelay}'`,\n code: 'invalid_duration',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n\n const retryDelay = issues.stringOf(strategy, 'retry_delay', field);\n if (retryDelay !== null && retryDelay !== '' && !isValidGoDuration(retryDelay)) {\n issues.warn({\n field: `${field}.retry_delay`,\n message: `retry_delay '${retryDelay}' is not a valid Go duration`,\n code: 'invalid_duration',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n\n if (strategy.backoff_multiplier !== undefined) {\n if (!isNumber(strategy.backoff_multiplier) || strategy.backoff_multiplier <= 0) {\n issues.error({\n field: `${field}.backoff_multiplier`,\n message: `backoff_multiplier must be > 0, got ${strategy.backoff_multiplier}`,\n code: 'invalid_backoff_multiplier',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n }\n\n if (Array.isArray(strategy.retry_on)) {\n strategy.retry_on.forEach((raw: unknown, i: number) => {\n const cat = issues.stringAt(raw, `${field}.retry_on[${i}]`);\n if (cat === null || !RETRY_ON_CATEGORIES.has(cat)) {\n issues.error({\n field: `${field}.retry_on[${i}]`,\n message: `Invalid retry_on category '${cat ?? String(raw)}'`,\n code: 'invalid_retry_on_category',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion: `Use one of: ${[...RETRY_ON_CATEGORIES].join(', ')}`,\n });\n }\n });\n }\n}\n\nexport function validateErrorStrategies(flow: Flow, issues: Issues): void {\n const steps = isRecord(flow.steps) ? flow.steps : {};\n\n if (isRecord(flow.error_strategy)) {\n validateOne(\n flow.error_strategy as ErrorStrategyDefinition,\n steps,\n 'error_strategy',\n undefined,\n issues,\n );\n }\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n if (isRecord(step.error_strategy)) {\n validateOne(\n step.error_strategy as ErrorStrategyDefinition,\n steps,\n `steps.${stepID}.error_strategy`,\n stepID,\n issues,\n );\n }\n validateLoopBodyErrorGoto(step, stepID, issues);\n }\n}\n\n// A loop BODY is a second step table, and the walk above never entered it —\n// which is how the reference's own DC-FORGE-81 check missed this. Inside one,\n// `goto_step` is unreachable under EVERY action, so it is a different finding\n// from `unreachable_error_goto`: that one is fixed by writing `action: \"goto\"`,\n// and this one is not fixable in place at all.\n//\n// `executeLoopStep`'s failure switch has exactly two arms — `continue` (skip to\n// the next sub-step) and a default that aborts the whole loop step — so `goto`\n// lands in the default and the loop FAILS. The strategy the author chose to\n// avoid failing is the one that fails.\n//\n// Deliberately NOT routed through validateOne: the reference's parser does not\n// run its error_strategy checks over loop sub-steps at all, and an oracle that\n// refuses shapes its door accepts is wrong in the more damaging direction.\n// Only the new warning is emitted here.\nfunction validateLoopBodyErrorGoto(\n step: Record<string, unknown>,\n stepID: string,\n issues: Issues,\n): void {\n if (!isRecord(step.loop)) return;\n const subSteps = (step.loop as Record<string, unknown>).steps;\n if (!Array.isArray(subSteps)) return;\n\n subSteps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const strategy = sub.error_strategy;\n if (!isRecord(strategy)) return;\n const subPath = `steps.${stepID}.loop.steps[${i}]`;\n const goto = issues.stringOf(strategy, 'goto_step', `${subPath}.error_strategy`);\n if (goto === null || goto === '') return;\n\n const id = issues.stringOf(sub, 'id', subPath);\n const subID = id !== null && id !== '' ? id : `[${i}]`;\n issues.warn({\n field: `steps.${stepID}.loop.steps.${subID}.error_strategy.goto_step`,\n message: `goto_step '${goto}' on loop step '${stepID}'s sub-step '${subID}' error_strategy is never read: a loop body honours only action \"continue\" (skip to the next sub-step) and fail. Any other action, including \"goto\", aborts the whole loop step — which then routes through the LOOP step's own error_strategy.`,\n code: 'loop_substep_error_goto_ignored',\n stepId: stepID,\n suggestion: `Put the goto_step on the loop step '${stepID}' itself, or use action: \"continue\" here`,\n });\n });\n}\n","// Step connectivity: `next` reference existence (errors), unreachable steps\n// (warnings), and cycle detection (warning).\n//\n// Mirrors `validateStepConnectivity` + `checkForCycles` + `findReachableSteps`\n// (validation.go) and the save door's `validateNextLogic` (parser.go). See the\n// two marker sets below: `end` is a terminal marker for the walks only.\n//\n// ⚠ REACHABILITY AND CYCLES FOLLOW DIFFERENT EDGE SETS, and that is faithful,\n// not an oversight. AIgentFlow v2.598.0 (DC-FORGE-30) widened `findReachableSteps`\n// to the five edge kinds `collectNextTargets` yields — `next.default`,\n// `next.conditions[].goto`, `next.parallel.steps[]`, `next.parallel.rendezvous`\n// and the step-level `error_strategy.goto_step` — plus the FLOW-level\n// `error_strategy.goto_step` seeded into the queue. It did NOT touch\n// `checkForCycles`, which still walks `next.default` + `next.conditions[].goto`\n// only. Widening the cycle walk too would invent a divergence: a rendezvous or an\n// error redirect back to an earlier step is an ordinary shape and would start\n// emitting a spurious `potential_infinite_loop`.\n//\n// The narrow walk was a real defect on the authoring surface: AIgentFlow's Studio\n// renders `unreachable_step` with a jump-to-line, and it was telling authors that\n// three working steps of a bundled flow were dead code.\n\nimport type { Flow, NextCondition, NextLogicDefinition } from '../types.js';\nimport { NEXT_MARKERS, REACHABILITY_TERMINAL_MARKERS } from '../spec/index.js';\nimport { Issues, isRecord, stepNames } from './util.js';\n\n// TWO sets, because the reference gives two answers and both are verdicts.\n//\n// Existence (an ERROR) follows the save door, `validateNextLogic` (parser.go):\n// only `null` and `orchestrator` stand without a step of that name, so\n// `default: end` is refused when no step is called `end`.\n//\n// Reachability and cycles (WARNINGS) follow `findReachableSteps` /\n// `checkForCycles` (validation.go), which still skip `end` as \"control leaves\n// the graph\" — so a real step named `end` that only `end` routes to is reported\n// unreachable, by the reference too.\nfunction isSaveDoorMarker(target: string): boolean {\n return NEXT_MARKERS.has(target);\n}\n\nfunction isMarker(target: string): boolean {\n return REACHABILITY_TERMINAL_MARKERS.has(target);\n}\n\n/**\n * Edges the CYCLE detector follows — deliberately only two. See the header.\n * `nextPath` is the step's `steps.<id>.next`. Every reference is a Go `string`,\n * so `default: 2` is the step \"2\" (read through `issues.stringAt`).\n */\nfunction cycleTargets(next: NextLogicDefinition, nextPath: string, issues: Issues): string[] {\n const out: string[] = [];\n const target = issues.stringOf(next, 'default', nextPath);\n if (target !== null && target !== '' && !isMarker(target)) out.push(target);\n if (Array.isArray(next.conditions)) {\n (next.conditions as NextCondition[]).forEach((cond, i) => {\n if (!isRecord(cond)) return;\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '' && !isMarker(goto)) out.push(goto);\n });\n }\n return out;\n}\n\n/**\n * Edges REACHABILITY follows — all five kinds `collectNextTargets` yields\n * (aigentflow.flow.simulator.go). Under-reporting here is wrong in the silent\n * direction: it turns a missing edge into a confident accusation.\n */\nfunction reachTargets(step: Record<string, unknown>, stepID: string, issues: Issues): string[] {\n const out: string[] = [];\n const push = (target: string | null): void => {\n if (target !== null && target !== '' && !isMarker(target)) out.push(target);\n };\n\n if (isRecord(step.next)) {\n const next = step.next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n out.push(...cycleTargets(next, nextPath, issues));\n\n const parallel = (next as { parallel?: unknown }).parallel;\n if (isRecord(parallel)) {\n const parallelPath = `${nextPath}.parallel`;\n if (Array.isArray(parallel.steps)) {\n parallel.steps.forEach((id: unknown, i: number) =>\n push(issues.stringAt(id, `${parallelPath}.steps[${i}]`)),\n );\n }\n push(issues.stringOf(parallel, 'rendezvous', parallelPath));\n }\n }\n\n // The step-level error redirect is an edge like any other.\n const errorStrategy = step.error_strategy;\n if (isRecord(errorStrategy)) {\n push(issues.stringOf(errorStrategy, 'goto_step', `steps.${stepID}.error_strategy`));\n }\n\n return out;\n}\n\nexport function validateConnectivity(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const names = stepNames(steps);\n const available = new Set(names);\n\n // Reference existence.\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n const next = step.next;\n if (!isRecord(next)) continue;\n const n = next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n\n const target = issues.stringOf(n, 'default', nextPath);\n if (target !== null && target !== '' && !isSaveDoorMarker(target) && !available.has(target)) {\n issues.error({\n field: `steps.${stepID}.next.default`,\n message: `Referenced step '${target}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change to one of: ${names.join(', ')}`,\n });\n }\n\n if (Array.isArray(n.conditions)) {\n n.conditions.forEach((cond: unknown, i: number) => {\n if (!isRecord(cond)) return;\n\n // `goto_step` is the spelling used by error_strategy and quality_gate,\n // and it is WRONG here — a condition's target key is `goto`. AIgentFlow's\n // create/update/validate path parses with KnownFields(true) and refuses\n // the flow outright (\"contains unknown keys that would be silently\n // dropped\"), verified against the Go parser, so this is an error and not\n // a warning. Reported explicitly because the failure is otherwise silent:\n // the branch target simply vanishes.\n // Any value: the key itself is what the reference refuses.\n if ((cond as NextCondition).goto_step !== undefined) {\n issues.error({\n field: `steps.${stepID}.next.conditions[${i}].goto_step`,\n message: \"A condition's branch target key is 'goto', not 'goto_step'\",\n code: 'unknown_yaml_key',\n stepId: stepID,\n suggestion:\n \"Rename 'goto_step' to 'goto' (only error_strategy and quality_gate use 'goto_step')\",\n });\n }\n\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '' && !isSaveDoorMarker(goto) && !available.has(goto)) {\n issues.error({\n field: `steps.${stepID}.next.conditions[${i}].goto`,\n message: `Referenced step '${goto}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change to one of: ${names.join(', ')}`,\n });\n }\n });\n }\n }\n\n const start = issues.stringOf(flow, 'start', '') ?? '';\n if (start === '' || !available.has(start)) {\n // Without a valid start, reachability/cycle analysis is meaningless and\n // the missing-start error is already reported elsewhere.\n return;\n }\n\n // Reachability (BFS from start).\n const reachable = new Set<string>();\n const queue: string[] = [start];\n // The FLOW-level error strategy names a step that nothing else points at. It\n // belongs to the flow, not to a step, so no edge walk can reach it — AIgentFlow\n // seeds it into the queue, and missing it was the remainder found by a live\n // probe after the first pass of the fix.\n const flowErrorStrategy = flow.error_strategy;\n if (isRecord(flowErrorStrategy)) {\n const gotoStep = issues.stringOf(flowErrorStrategy, 'goto_step', 'error_strategy');\n if (gotoStep !== null && gotoStep !== '' && !isMarker(gotoStep)) queue.push(gotoStep);\n }\n while (queue.length > 0) {\n const current = queue.shift() as string;\n if (reachable.has(current)) continue;\n reachable.add(current);\n const step = steps[current];\n if (isRecord(step)) {\n for (const target of reachTargets(step, current, issues)) {\n if (!reachable.has(target)) queue.push(target);\n }\n }\n }\n for (const stepID of names) {\n if (!reachable.has(stepID)) {\n issues.warn({\n field: `steps.${stepID}`,\n message: `Step '${stepID}' is not reachable from start step`,\n code: 'unreachable_step',\n stepId: stepID,\n suggestion: 'Add a path to this step or remove it if not needed',\n });\n }\n }\n\n // Cycle detection: only a cycle with no way out is potentially infinite.\n if (cycleWithoutExit(steps, start, issues)) {\n issues.warn({\n field: 'steps',\n message: 'Potential infinite loop detected in step flow: a cycle of steps has no way out',\n code: 'potential_infinite_loop',\n suggestion:\n 'Give one step in the cycle a `next.conditions` branch that leaves it (or end the flow there)',\n });\n }\n}\n\n/**\n * Every target the cycle analysis follows from a step (`next.default` and\n * `next.conditions[].goto`), INCLUDING the terminal markers, which the exit\n * check needs to see (`cycleTargets` drops them).\n */\nfunction cycleEdges(step: unknown, stepID: string, issues: Issues): string[] {\n if (!isRecord(step) || !isRecord(step.next)) return [];\n const next = step.next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n const out: string[] = [];\n const def = issues.stringOf(next, 'default', nextPath);\n if (def !== null && def !== '') out.push(def);\n if (Array.isArray(next.conditions)) {\n (next.conditions as NextCondition[]).forEach((cond, i) => {\n if (!isRecord(cond)) return;\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '') out.push(goto);\n });\n }\n return out;\n}\n\n/**\n * Whether control can leave the strongly connected set from this step: the flow\n * can end here (no next, or no default so the flow ends when no condition\n * matches), it fans out (parallel edges are not followed, so a fan-out counts as\n * an exit rather than being guessed at), or a branch names a terminal marker or a\n * step outside the set.\n */\nfunction stepLeavesCycle(\n steps: Record<string, unknown>,\n stepID: string,\n inCycle: Set<string>,\n issues: Issues,\n): boolean {\n const step = steps[stepID];\n if (!isRecord(step) || !isRecord(step.next)) return true;\n const next = step.next as NextLogicDefinition;\n if (next.parallel !== undefined && next.parallel !== null) return true;\n const def = issues.stringOf(next, 'default', `steps.${stepID}.next`);\n if (def === null || def === '') return true;\n for (const target of cycleEdges(step, stepID, issues)) {\n if (isMarker(target) || !inCycle.has(target)) return true;\n }\n return false;\n}\n\n/**\n * Whether a cycle reachable from `start` has no exit: Tarjan's strongly\n * connected components over default + condition edges. It cannot prove an exit\n * condition ever fires; that is undecidable from the YAML.\n */\nfunction cycleWithoutExit(steps: Record<string, unknown>, start: string, issues: Issues): boolean {\n let index = 0;\n const indices = new Map<string, number>();\n const low = new Map<string, number>();\n const onStack = new Set<string>();\n const stack: string[] = [];\n let found = false;\n\n const strong = (id: string): void => {\n indices.set(id, index);\n low.set(id, index);\n index++;\n stack.push(id);\n onStack.add(id);\n\n for (const target of cycleEdges(steps[id], id, issues)) {\n if (isMarker(target) || !Object.prototype.hasOwnProperty.call(steps, target)) continue;\n if (!indices.has(target)) {\n strong(target);\n low.set(id, Math.min(low.get(id) as number, low.get(target) as number));\n } else if (onStack.has(target)) {\n low.set(id, Math.min(low.get(id) as number, indices.get(target) as number));\n }\n }\n\n if (low.get(id) !== indices.get(id)) return;\n const component: string[] = [];\n for (;;) {\n const top = stack.pop() as string;\n onStack.delete(top);\n component.push(top);\n if (top === id) break;\n }\n const inCycle = new Set(component);\n const cyclic = component.length > 1 || cycleEdges(steps[id], id, issues).includes(id);\n if (!cyclic) return;\n if (component.some((member) => stepLeavesCycle(steps, member, inCycle, issues))) return;\n found = true;\n };\n\n if (Object.prototype.hasOwnProperty.call(steps, start)) strong(start);\n return found;\n}\n","// `next.parallel` structure + the orchestrator-next rule.\n//\n// Default/condition reference checks live in connectivity.ts (they pair with\n// reachability). This module covers the parser-only additions:\n// `validateNextLogic` parallel block + `validateOrchestratorNext`.\n\nimport type { Flow, NextCondition, NextLogicDefinition, ParallelDefinition } from '../types.js';\nimport { Issues, isRecord } from './util.js';\n\nconst NEXT_NULL = 'null';\nconst NEXT_ORCHESTRATOR = 'orchestrator';\n\nexport function validateNextLogic(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const available = new Set(Object.keys(steps));\n const hasOrchestrator = isRecord(flow.orchestrator);\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n const next = step.next;\n if (!isRecord(next)) continue;\n const n = next as NextLogicDefinition;\n\n // Parallel block.\n if (isRecord(n.parallel)) {\n const par = n.parallel as ParallelDefinition;\n const base = `steps.${stepID}.next.parallel`;\n\n // Go `string` fields: `rendezvous: 9` names the step \"9\".\n const rendezvous = issues.stringOf(par, 'rendezvous', base);\n if (rendezvous === null || rendezvous === '') {\n issues.error({\n field: `${base}.rendezvous`,\n message: 'parallel block requires a rendezvous step',\n code: 'missing_required_field',\n stepId: stepID,\n });\n } else if (rendezvous !== NEXT_NULL && !available.has(rendezvous)) {\n issues.error({\n field: `${base}.rendezvous`,\n message: `Referenced rendezvous step '${rendezvous}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n });\n }\n\n if (!Array.isArray(par.steps) || par.steps.length === 0) {\n issues.error({\n field: `${base}.steps`,\n message: 'parallel block requires at least one step',\n code: 'missing_required_field',\n stepId: stepID,\n });\n } else {\n par.steps.forEach((ps: unknown, i: number) => {\n const member = issues.stringAt(ps, `${base}.steps[${i}]`);\n if (member === null || !available.has(member)) {\n issues.error({\n field: `${base}.steps[${i}]`,\n message: `Referenced parallel step '${member ?? String(ps)}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n });\n }\n });\n }\n }\n\n // \"orchestrator\" as a next target requires an orchestrator block.\n if (!hasOrchestrator) {\n const usesOrch =\n n.default === NEXT_ORCHESTRATOR ||\n (Array.isArray(n.conditions) &&\n (n.conditions as NextCondition[]).some(\n (c) => isRecord(c) && c.goto === NEXT_ORCHESTRATOR,\n ));\n if (usesOrch) {\n issues.error({\n field: `steps.${stepID}.next`,\n message: `Step '${stepID}' routes to 'orchestrator' but the flow has no orchestrator block`,\n code: 'orchestrator_next_requires_orchestrator',\n stepId: stepID,\n });\n }\n }\n }\n}\n","// `expression_functions` validation.\n//\n// Three layers, all mirrored from the Go reference (parser.go):\n//\n// 1. `validateExpressionFunctions` — structural: each entry is a mapping with\n// exactly one key, which must be either `package` or `function`, with a\n// non-empty value. Unchanged since the block existed.\n// 2. `validateExpressionFunctionCatalog` — the catalog rules: `package:` is\n// refused outright, and a `function:` name outside the fixed catalog is\n// refused. The catalog is compiled into the AIgentFlow binary; nothing is\n// loaded at run time, ever, which is why `package:` can never work.\n// 3. `validateExpressionFunctionUsage` — a template action calling an `fn_`\n// name must name a real catalog entry AND be declared by this flow's\n// `expression_functions:` block.\n//\n// Layers 2 and 3 are refused at the SAVE door upstream; a flow stored before\n// the rules existed still RUNS. This validator answers \"would this save\", so\n// both are `error` severity — the same choice already made for the executor-URL\n// shape rule. See PARITY.md.\n\nimport type { Flow } from '../types.js';\nimport { EXPRESSION_FUNCTION_CATALOG, EXPRESSION_FUNCTION_NAME_PREFIX } from '../spec/index.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\n\nconst KEY_PACKAGE = 'package';\nconst KEY_FUNCTION = 'function';\n\n/** Sorted catalog names, for the \"Available:\" half of every refusal message. */\nconst CATALOG_LIST = [...EXPRESSION_FUNCTION_CATALOG].sort().join(', ');\n\n/**\n * One template action, `{{ … }}`. `[\\s\\S]` rather than `.` so a MULTI-LINE\n * action — which YAML block scalars produce — is matched whole, and non-greedy\n * so two actions on one line stay two actions.\n */\nconst TEMPLATE_ACTION_PATTERN = /\\{\\{[\\s\\S]*?\\}\\}/g;\n\n/**\n * A double-quoted or backquoted string inside a template action. Its contents\n * are DATA — a key name — never an identifier, so it is stripped before the call\n * scan runs: `{{ index .data \"fn_result\" }}` reads a data key, it calls nothing.\n */\nconst TEMPLATE_STRING_LITERAL_PATTERN = /\"[^\"]*\"|`[^`]*`/g;\n\n/**\n * A catalog-namespaced identifier being CALLED. Applied ONLY to the text between\n * `{{` and `}}`, so a step description that mentions `fn_slugify` in prose is not\n * read as a call — the same restriction the Go rule carries.\n *\n * ⚠️ THE LOOKBEHIND IS NOT DECORATION. A bare `\\bfn_\\w+` also matches the FIELD\n * reference `{{ .data.fn_total }}`, because `\\b` matches happily between the `.`\n * and the `f`. A flow with a state field, a step, or a data key whose name begins\n * with `fn_` would then be refused with a message about a function it never\n * called — a false refusal on a valid flow, which is worse than a missed\n * detection. A call is preceded by `{{`, `(`, `|` or whitespace: never by a dot\n * or a word character.\n *\n * The Go reference captures and discards the preceding character\n * (`(^|[^.\\w])(fn_…)`) because RE2 has no lookbehind. JS has one, and this\n * package targets Node >= 20, so the equivalent negative lookbehind is used\n * instead: it needs no capture group and cannot consume the delimiter between\n * two adjacent matches.\n */\nconst EXPRESSION_FUNCTION_CALL_PATTERN = new RegExp(\n `(?<![.\\\\w])${EXPRESSION_FUNCTION_NAME_PREFIX}[A-Za-z0-9_]+`,\n 'g',\n);\n\n/** Collect the catalog names this flow declares. */\nfunction declaredFunctions(list: unknown): Set<string> {\n const declared = new Set<string>();\n if (!isArray(list)) return declared;\n for (const entry of list) {\n if (!isRecord(entry)) continue;\n const name = entry[KEY_FUNCTION];\n if (isString(name) && name !== '') declared.add(name);\n }\n return declared;\n}\n\n/** Structural + catalog rules over the `expression_functions:` block itself. */\nfunction validateDeclarations(list: unknown, issues: Issues): void {\n if (list === undefined || list === null) return;\n if (!Array.isArray(list)) {\n issues.error({\n field: 'expression_functions',\n message: 'expression_functions must be a list',\n code: 'invalid_type',\n });\n return;\n }\n\n list.forEach((entry: unknown, i: number) => {\n const field = `expression_functions[${i}]`;\n if (!isRecord(entry)) {\n issues.error({\n field,\n message: 'Each expression_functions entry must be a mapping',\n code: 'invalid_expression_function',\n });\n return;\n }\n const keys = Object.keys(entry);\n if (keys.length !== 1) {\n issues.error({\n field,\n message: 'Each expression_functions entry must have exactly one key (package OR function)',\n code: 'invalid_expression_function',\n });\n return;\n }\n const hasPackage = KEY_PACKAGE in entry;\n const hasFunction = KEY_FUNCTION in entry;\n if (!hasPackage && !hasFunction) {\n issues.error({\n field,\n message: \"expression_functions entry must use key 'package' or 'function'\",\n code: 'invalid_expression_function',\n });\n return;\n }\n const key = hasPackage ? KEY_PACKAGE : KEY_FUNCTION;\n // A Go `string`: `function: 5` is the name \"5\", looked up (and unknown),\n // not an empty value.\n const value = issues.stringOf(entry, key, field);\n if (value === null || value === '') {\n issues.error({\n field: `${field}.${key}`,\n message: `expression_functions '${key}' must have a non-empty value`,\n code: 'invalid_expression_function',\n });\n return;\n }\n\n // `package:` is refused, not ignored. Nothing is loaded at run time, so a\n // flow could never have gotten functions this way — accepting the key in\n // silence is what kept the block inert for so long.\n if (hasPackage) {\n issues.error({\n field: `${field}.${KEY_PACKAGE}`,\n message:\n '`package:` is not supported: expression functions are compiled into AIgentFlow and ' +\n 'nothing is loaded at run time. Use `function:` naming a built-in catalog entry instead.',\n code: 'expression_function_package_unsupported',\n context: `Available: ${CATALOG_LIST}`,\n suggestion: 'Replace the entry with { function: \"fn_<name>\" } from the catalog.',\n });\n return;\n }\n\n if (!EXPRESSION_FUNCTION_CATALOG.has(value)) {\n issues.error({\n field: `${field}.${KEY_FUNCTION}`,\n message: `expression function '${value}' is not in the built-in catalog`,\n code: 'expression_function_unknown',\n context: `Available: ${CATALOG_LIST}`,\n });\n }\n });\n}\n\n/**\n * Walk every string leaf of the document, reporting its dotted path.\n *\n * The Go rule re-serialises the flow struct for the same reason this walks the\n * whole document: template strings live in a dozen unrelated places (step\n * queries, conditions, next-step expressions, output bindings, orchestrator\n * prompts, loop bounds) and a hand-kept field list goes stale the first time a\n * field is added.\n */\nfunction walkStrings(path: string, value: unknown, visit: (path: string, s: string) => void): void {\n if (isString(value)) {\n visit(path, value);\n return;\n }\n if (isArray(value)) {\n value.forEach((item, i) => walkStrings(`${path}[${i}]`, item, visit));\n return;\n }\n if (isRecord(value)) {\n for (const [key, v] of Object.entries(value)) {\n walkStrings(path === '' ? key : `${path}.${key}`, v, visit);\n }\n }\n}\n\n/**\n * Refuse a template that CALLS a catalog function this flow did not declare, or\n * an `fn_` name that is not in the catalog at all. This is what makes the\n * `expression_functions:` block load-bearing rather than decorative.\n */\nfunction validateUsage(flow: Flow, declared: Set<string>, issues: Issues): void {\n // One finding per distinct name: a flow that uses fn_slugify in thirty\n // templates has one problem, not thirty.\n const reported = new Set<string>();\n\n walkStrings('', flow as unknown, (path, text) => {\n if (!text.includes('{{')) return;\n for (const rawAction of text.match(TEMPLATE_ACTION_PATTERN) ?? []) {\n // Quoted spans go first: what they contain is a data key, not a call.\n const action = rawAction.replace(TEMPLATE_STRING_LITERAL_PATTERN, '');\n for (const called of action.match(EXPRESSION_FUNCTION_CALL_PATTERN) ?? []) {\n if (reported.has(called)) continue;\n if (!EXPRESSION_FUNCTION_CATALOG.has(called)) {\n reported.add(called);\n issues.error({\n field: path,\n message: `A template calls '${called}', which is not a built-in expression function`,\n code: 'expression_function_unknown_use',\n context: `Available: ${CATALOG_LIST}`,\n });\n continue;\n }\n if (!declared.has(called)) {\n reported.add(called);\n issues.error({\n field: path,\n message: `A template calls '${called}' but the flow does not declare it`,\n code: 'expression_function_undeclared_use',\n suggestion: `Add it: expression_functions: [{ function: \"${called}\" }]`,\n });\n }\n }\n }\n });\n}\n\nexport function validateExpressionFunctions(flow: Flow, issues: Issues): void {\n validateDeclarations(flow.expression_functions, issues);\n // The usage scan runs even when the block is absent: a flow that calls an\n // `fn_` function and declares nothing is precisely the case the rule exists\n // for.\n validateUsage(flow, declaredFunctions(flow.expression_functions), issues);\n}\n","// `loop`, `for_each`, and `throttle` structural validation.\n//\n// Mirrors `validateLoop`, `validateForEach`, and `validateThrottle`\n// (parser.go).\n\nimport type {\n ForEachDefinition,\n LoopDefinition,\n NextCondition,\n NextLogicDefinition,\n ThrottleDefinition,\n} from '../types.js';\nimport type { Flow } from '../types.js';\nimport { FOR_EACH_RESOLUTIONS, LOOP_MAX_ITERATIONS_LIMIT } from '../spec/index.js';\nimport { Issues, isInteger, isRecord, parseGoDuration } from './util.js';\n\n// Throttle ceilings (Go: FOR_EACH_MAX_THROTTLE_DELAY = 5m, FOR_EACH_MAX_BATCH_DELAY = 30m), in nanoseconds.\nconst MAX_THROTTLE_DELAY_NS = 5 * 60 * 1e9;\nconst MAX_BATCH_DELAY_NS = 30 * 60 * 1e9;\n\nconst RESERVED_STEP_ID_CHAR = '.';\n\n/**\n * The loop result's own summary fields (reference: `LoopResultSummaryFields`,\n * AIF v2.648.0 / DC-FORGE-78). The loop step's committed result carries these\n * AND one entry per sub-step under its id, so a sub-step named `vars` is\n * unreadable through `{{ .data.<loop>.vars }}` — the summary field wins.\n */\nconst LOOP_RESULT_SUMMARY_FIELDS: readonly string[] = [\n 'iterations',\n 'break',\n 'vars',\n 'duration_ms',\n];\n\n/**\n * The two top-level `next:` sentinels. Neither carries any meaning inside a\n * loop body: the reference's `resolveLoopSubStepNext` has no sentinel awareness\n * at all, so `null` cannot end a mission from there and `orchestrator` cannot\n * yield — both take the same \"no such sub-step\" miss path as a plain typo.\n *\n * `end` is deliberately NOT listed. The reference refuses only these two by\n * name and lets everything else fall through to the target-existence check, and\n * that is the honest answer here too: `end` names no sub-step of the loop, so it\n * is reported as a missing target rather than as a reserved marker. Divergence\n * #2 (\"`end` is always terminal\") is about TOP-LEVEL next targets and is not\n * extended into a loop body, where nothing reads it.\n */\nconst LOOP_SUBSTEP_NEXT_SENTINELS = new Set(['null', 'orchestrator']);\n\n/**\n * One loop sub-step's `next:` block, checked against the LOOP's own sub-step\n * table and nothing else (reference: `validateLoopSubStepNext`, parser.go,\n * AIF v2.672.0 / DC-FORGE-102, aigentflow#116).\n *\n * A loop body is a SECOND step table. `validateNextLogic` and the connectivity\n * pass walk `flow.steps` only, so before this rule existed a sub-step could\n * route to `pol` when the sub-step is called `poll` and nothing said a word:\n * the reference stored the flow and the loop driver WARNed at run time and\n * advanced sequentially — the branch the author wrote simply never happened, in\n * the one construct whose entire purpose is branching.\n *\n * Both jump directions are legal (the runtime index covers every sub-step, not\n * only the ones declared earlier), and an EMPTY target is the documented\n * \"advance sequentially\" and must stay legal — which is why this runs as a\n * second pass over the already-collected id set.\n */\nfunction validateLoopSubStepNext(\n sub: Record<string, unknown>,\n subStepIDs: Set<string>,\n base: string,\n index: number,\n stepID: string,\n issues: Issues,\n): void {\n const next = sub.next;\n if (next === undefined || next === null) return;\n const path = `${base}.steps[${index}].next`;\n const subStepID = issues.stringOf(sub, 'id', `${base}.steps[${index}]`) ?? `[${index}]`;\n if (!isRecord(next)) {\n issues.error({\n field: path,\n message: `loop sub-step '${subStepID}' next must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n return;\n }\n const n = next as NextLogicDefinition;\n\n // The loop driver reads conditions and default only, so a parallel block here\n // never fans out and its rendezvous never runs. The reference returns on this\n // one without looking at the targets; so do we.\n if (isRecord(n.parallel)) {\n issues.error({\n field: `${path}.parallel`,\n message: `loop sub-step '${subStepID}' declares next.parallel, which a loop body does not support (sub-steps run sequentially)`,\n code: 'loop_substep_next_parallel',\n stepId: stepID,\n suggestion:\n 'Use next.conditions/default to branch within the iteration, or a top-level step for parallel fan-out',\n });\n return;\n }\n\n const targets: { field: string; value: unknown }[] = [\n { field: `${path}.default`, value: n.default },\n ];\n if (Array.isArray(n.conditions)) {\n (n.conditions as NextCondition[]).forEach((condition, j) => {\n if (!isRecord(condition)) return;\n targets.push({ field: `${path}.conditions[${j}].goto`, value: condition.goto });\n });\n }\n\n for (const target of targets) {\n if (target.value === undefined || target.value === null) continue;\n // A Go `string`: `default: 4` names the sub-step \"4\". Only a mapping or a\n // list fails to decode.\n const value = issues.stringAt(target.value, target.field);\n if (value === null) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' next target must be a string`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n // Empty is the documented sequential advance.\n if (value === '') continue;\n if (LOOP_SUBSTEP_NEXT_SENTINELS.has(value)) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' routes next to the reserved marker '${value}', which has no meaning inside a loop body`,\n code: 'loop_substep_next_sentinel',\n stepId: stepID,\n suggestion:\n 'Name another sub-step of the same loop, or leave the target empty for sequential advance',\n });\n continue;\n }\n if (!subStepIDs.has(value)) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' routes next to '${value}', which is not a sub-step of that loop`,\n code: 'loop_substep_next_target_not_found',\n stepId: stepID,\n suggestion:\n subStepIDs.size > 0\n ? `A sub-step's next: resolves only against loop.steps of the SAME loop. Available: ${[...subStepIDs].sort().join(', ')}`\n : \"A sub-step's next: resolves only against loop.steps of the SAME loop\",\n });\n }\n }\n}\n\nfunction validateThrottle(\n throttle: ThrottleDefinition,\n field: string,\n stepID: string,\n issues: Issues,\n): void {\n // Both delays are Go `string` fields, which yaml.v3 fills from ANY scalar by\n // its source text: `delay: 100` is \"100\" (no unit, refused), `delay: 0` is\n // \"0\" (saves) and `delay: 0.0` is \"0.0\" (refused). A number used to be\n // skipped here, which accepted all three.\n const delay = issues.stringOf(throttle, 'delay', field);\n if (delay !== null && delay !== '') {\n const ns = parseGoDuration(delay);\n if (ns === null) {\n issues.error({\n field: `${field}.delay`,\n message: `Invalid throttle delay '${delay}'`,\n code: 'invalid_duration',\n stepId: stepID,\n });\n } else if (ns > MAX_THROTTLE_DELAY_NS) {\n issues.error({\n field: `${field}.delay`,\n message: `throttle delay '${delay}' exceeds the 5m maximum`,\n code: 'throttle_delay_exceeds_max',\n stepId: stepID,\n });\n }\n }\n\n const batchSize = throttle.batch_size;\n const batchDelay = issues.stringOf(throttle, 'batch_delay', field);\n const hasBatchDelay = batchDelay !== null && batchDelay !== '';\n if (batchSize !== undefined && isInteger(batchSize) && batchSize < 0) {\n issues.error({\n field: `${field}.batch_size`,\n message: `throttle batch_size must be >= 0, got ${batchSize}`,\n code: 'throttle_invalid_batch_size',\n stepId: stepID,\n });\n } else if ((batchSize === undefined || batchSize === 0) && hasBatchDelay) {\n issues.error({\n field: `${field}.batch_delay`,\n message: 'throttle batch_delay requires a batch_size',\n code: 'throttle_batch_delay_without_size',\n stepId: stepID,\n });\n }\n\n if (hasBatchDelay) {\n const ns = parseGoDuration(batchDelay as string);\n if (ns === null) {\n issues.error({\n field: `${field}.batch_delay`,\n message: `Invalid throttle batch_delay '${batchDelay}'`,\n code: 'invalid_duration',\n stepId: stepID,\n });\n } else if (ns > MAX_BATCH_DELAY_NS) {\n issues.error({\n field: `${field}.batch_delay`,\n message: `throttle batch_delay '${batchDelay}' exceeds the 30m maximum`,\n code: 'throttle_batch_delay_exceeds_max',\n stepId: stepID,\n });\n }\n }\n}\n\nfunction validateForEach(step: Record<string, unknown>, stepID: string, issues: Issues): void {\n const fe = step.for_each as ForEachDefinition;\n const base = `steps.${stepID}.for_each`;\n\n // Go `string` fields: `items: 5` is present, `resolution: 1` is the invalid\n // resolution \"1\".\n if (!issues.nonEmptyStringOf(fe, 'items', base)) {\n issues.error({\n field: `${base}.items`,\n message: 'for_each requires a non-empty items expression',\n code: 'for_each_items_required',\n stepId: stepID,\n });\n }\n\n const next = step.next;\n if (isRecord(next) && isRecord(next.parallel)) {\n issues.error({\n field: base,\n message: 'A step cannot use both for_each and next.parallel',\n code: 'for_each_mutual_exclusion',\n stepId: stepID,\n });\n }\n\n if (fe.max_parallel !== undefined && isInteger(fe.max_parallel) && fe.max_parallel < 0) {\n issues.error({\n field: `${base}.max_parallel`,\n message: `for_each max_parallel must be >= 0, got ${fe.max_parallel}`,\n code: 'for_each_invalid_max_parallel',\n stepId: stepID,\n });\n }\n\n const resolution = issues.stringOf(fe, 'resolution', base);\n if (resolution !== null && resolution !== '' && !FOR_EACH_RESOLUTIONS.has(resolution)) {\n issues.error({\n field: `${base}.resolution`,\n message: `Invalid for_each resolution '${resolution}'`,\n code: 'for_each_invalid_resolution',\n stepId: stepID,\n suggestion: `Use one of: ${[...FOR_EACH_RESOLUTIONS].join(', ')}`,\n });\n }\n\n if (isRecord(fe.throttle)) {\n validateThrottle(fe.throttle as ThrottleDefinition, `${base}.throttle`, stepID, issues);\n }\n}\n\nfunction validateLoop(step: Record<string, unknown>, stepID: string, issues: Issues): void {\n const loop = step.loop as LoopDefinition;\n const base = `steps.${stepID}.loop`;\n\n if (!issues.nonEmptyStringOf(loop, 'while', base)) {\n issues.error({\n field: `${base}.while`,\n message: 'loop requires a non-empty while condition',\n code: 'loop_while_required',\n stepId: stepID,\n });\n }\n\n const maxIter = loop.max_iterations;\n if (maxIter === undefined || !isInteger(maxIter) || maxIter <= 0) {\n issues.error({\n field: `${base}.max_iterations`,\n message: 'loop requires max_iterations > 0',\n code: 'loop_max_iterations_required',\n stepId: stepID,\n });\n } else if (maxIter > LOOP_MAX_ITERATIONS_LIMIT) {\n issues.error({\n field: `${base}.max_iterations`,\n message: `loop max_iterations (${maxIter}) exceeds the limit of ${LOOP_MAX_ITERATIONS_LIMIT}`,\n code: 'loop_max_iterations_range',\n stepId: stepID,\n });\n }\n\n const subSteps = loop.steps;\n if (!Array.isArray(subSteps) || subSteps.length === 0) {\n issues.error({\n field: `${base}.steps`,\n message: 'loop requires at least one sub-step',\n code: 'loop_steps_required',\n stepId: stepID,\n });\n } else {\n const seen = new Set<string>();\n subSteps.forEach((sub: unknown, i: number) => {\n const subPath = `${base}.steps[${i}]`;\n if (!isRecord(sub)) {\n issues.error({\n field: subPath,\n message: 'loop sub-step must be a mapping',\n code: 'invalid_type',\n stepId: stepID,\n });\n return;\n }\n // A Go `string`: `id: 3` is the sub-step \"3\".\n const id = issues.stringOf(sub, 'id', subPath);\n if (id === null || id === '') {\n issues.error({\n field: `${subPath}.id`,\n message: `loop sub-step at index ${i} requires an 'id'`,\n code: 'loop_step_id_required',\n stepId: stepID,\n });\n } else {\n if (id.includes(RESERVED_STEP_ID_CHAR)) {\n issues.error({\n field: `${subPath}.id`,\n message: `loop sub-step id '${id}' must not contain '${RESERVED_STEP_ID_CHAR}'`,\n code: 'reserved_step_id_char',\n stepId: stepID,\n });\n }\n if (seen.has(id)) {\n issues.error({\n field: `${subPath}.id`,\n message: `Duplicate loop sub-step id '${id}'`,\n code: 'loop_step_id_duplicate',\n stepId: stepID,\n });\n }\n seen.add(id);\n // A WARNING in the reference, not an error: the sub-step still runs, and\n // its result stays reachable through the flat `index .data \"<loop>.<sub>\"`\n // key. The reference reports it on the `loop.steps` field and names the\n // parent step, so this does too.\n if (LOOP_RESULT_SUMMARY_FIELDS.includes(id)) {\n issues.warn({\n field: `${base}.steps`,\n message: `loop sub-step id '${id}' is also a field of the loop's own result, so {{ .data.${stepID}.${id} }} reads the loop's ${id} instead of this sub-step's output`,\n code: 'loop_sub_step_id_reserved',\n stepId: stepID,\n suggestion: `rename the sub-step; ids reserved by the loop result: ${[...LOOP_RESULT_SUMMARY_FIELDS].sort().join(', ')}`,\n });\n }\n }\n if (!issues.nonEmptyStringOf(sub, 'executor', subPath)) {\n issues.error({\n field: `${subPath}.executor`,\n message: `loop sub-step at index ${i} requires an 'executor'`,\n code: 'loop_step_executor_required',\n stepId: stepID,\n });\n }\n });\n\n // Second pass, deliberately: a FORWARD jump is legal, so the whole id set\n // has to exist before any target can be judged.\n subSteps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n validateLoopSubStepNext(sub, seen, base, i, stepID, issues);\n });\n }\n\n if (step.for_each !== undefined && step.for_each !== null) {\n issues.error({\n field: base,\n message: 'A step cannot use both loop and for_each',\n code: 'loop_mutual_exclusion_for_each',\n stepId: stepID,\n });\n }\n\n if (issues.nonEmptyStringOf(step, 'executor', `steps.${stepID}`)) {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'A loop step must not define its own executor (it defines sub-steps)',\n code: 'loop_mutual_exclusion_executor',\n stepId: stepID,\n });\n }\n}\n\nexport function validateLoopForEachThrottle(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n if (step.for_each !== undefined && step.for_each !== null && isRecord(step.for_each)) {\n validateForEach(step, stepID, issues);\n }\n if (step.loop !== undefined && step.loop !== null && isRecord(step.loop)) {\n validateLoop(step, stepID, issues);\n }\n }\n}\n","// Orchestrator + campaign structural validation.\n//\n// Mirrors the portable parts of `validateOrchestrator` /\n// `validateAndNormalizeCampaign` (parser.go). The exons-spec body is parsed by\n// the go-exons engine in the reference and is NOT re-implemented here — its\n// presence is required, but its contents are out of scope for the static JS\n// validator. See PARITY.md.\n\nimport type {\n Flow,\n OrchestratorDefinition,\n OrchestratorTrigger,\n ValidateOptions,\n} from '../types.js';\nimport { ORCHESTRATOR_MODES, ORCHESTRATOR_TOOLS, ORCHESTRATOR_TRIGGERS } from '../spec/index.js';\nimport { Issues, isRecord, isValidGoDuration, parseGoDuration } from './util.js';\n\nconst TRIGGER_TIMER = 'timer';\nconst MODE_OWNER = 'owner';\nconst NEXT_MARKER_ORCHESTRATOR = 'orchestrator';\n\n// flowHasOrchestratorYieldEdge mirrors the Go helper: does any step route to the\n// orchestrator via next.default or a conditional goto? (DC-COND-1)\nfunction flowHasOrchestratorYieldEdge(flow: Flow): boolean {\n const steps = flow.steps;\n if (!isRecord(steps)) return false;\n for (const step of Object.values(steps)) {\n if (!isRecord(step) || !isRecord(step.next)) continue;\n const next = step.next as { default?: unknown; conditions?: unknown };\n if (next.default === NEXT_MARKER_ORCHESTRATOR) return true;\n if (Array.isArray(next.conditions)) {\n for (const cond of next.conditions) {\n if (isRecord(cond) && (cond as { goto?: unknown }).goto === NEXT_MARKER_ORCHESTRATOR) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/** 2^63: the first float yaml.v3 will not decode into an int64. */\nconst GO_INT64_FLOAT_LIMIT = 2 ** 63;\n\n// decodeGoInt returns the value yaml.v3 stores when it decodes a YAML number\n// into a Go int64 field, or null when the decode fails. A float is truncated\n// toward zero; NaN and anything at or above 2^63 fail; -Inf and very large\n// negative floats land at the bottom of the range (their exact value is\n// platform-defined in Go, but always negative, which is all a caller needs).\nfunction decodeGoInt(v: unknown): number | null {\n if (typeof v !== 'number' || Number.isNaN(v)) return null;\n if (v >= GO_INT64_FLOAT_LIMIT) return null;\n if (v === -Infinity) return -GO_INT64_FLOAT_LIMIT;\n return Math.trunc(v);\n}\n\n// validateCampaignChildFlows ports the first two checks of\n// CampaignConfig.Validate (domain.campaign.go): the campaign needs at least one\n// child flow, and each entry names a `flow_id` or a `flow_name`.\n//\n// ⚠️ yaml.v3 DROPS a null list entry when it decodes the list, so `- ` does not\n// count as an entry — a list of nothing but nulls is \"no child flows\", and a\n// null beside a real entry is simply ignored (measured: both save/refuse as\n// described). `flow_id` and `flow_name` are Go strings, so any scalar counts\n// (`flow_id: 123` saves) and a YAML null is empty. The finding's index is the\n// entry's position in the YAML list; the reference's message counts only the\n// non-null entries.\nfunction validateCampaignChildFlows(campaign: Record<string, unknown>, issues: Issues): void {\n const field = 'campaign.child_flows';\n const raw: unknown = campaign.child_flows;\n if (raw !== undefined && raw !== null && !Array.isArray(raw)) {\n issues.error({ field, message: 'campaign.child_flows must be a list', code: 'invalid_type' });\n return;\n }\n const entries = (Array.isArray(raw) ? raw : [])\n .map((entry: unknown, i: number) => ({ entry, i }))\n .filter(({ entry }) => entry !== null);\n if (entries.length === 0) {\n issues.error({\n field,\n message: 'campaign requires at least one entry in child_flows',\n code: 'campaign_no_child_flows',\n });\n return;\n }\n for (const { entry, i } of entries) {\n if (!isRecord(entry)) {\n issues.error({\n field: `${field}[${i}]`,\n message: 'each campaign.child_flows entry must be a mapping',\n code: 'invalid_type',\n });\n continue;\n }\n const id = issues.stringOf(entry, 'flow_id', `${field}[${i}]`);\n const name = issues.stringOf(entry, 'flow_name', `${field}[${i}]`);\n if ((id !== null && id !== '') || (name !== null && name !== '')) continue;\n issues.error({\n field: `${field}[${i}]`,\n message: `campaign.child_flows[${i}] needs a flow_id or a flow_name`,\n code: 'campaign_child_flow_no_id',\n suggestion: 'Name the child flow with flow_name, or pin it with flow_id',\n });\n }\n}\n\nexport function validateOrchestratorCampaign(\n flow: Flow,\n issues: Issues,\n opts: ValidateOptions,\n): void {\n const hasOrchestrator = isRecord(flow.orchestrator);\n\n if (hasOrchestrator) {\n const orch = flow.orchestrator as OrchestratorDefinition;\n\n // Every field read below is a Go `string` (issues.stringOf): `mode: 1` is\n // the invalid mode \"1\", not an absent one.\n if (!issues.nonEmptyStringOf(orch, 'exons', 'orchestrator')) {\n issues.error({\n field: 'orchestrator.exons',\n message: 'orchestrator requires an exons specification',\n code: 'orchestrator_exons_required',\n });\n }\n\n // AIF v2.695.0 (DC-FORGE-125, aigentflow#124): the per-question HITL\n // deadline. The reference REFUSES an unparseable or non-positive duration\n // (parser.go, beside the timer trigger's interval), so this oracle refuses\n // it too.\n //\n // NOTE the positivity check. `isValidGoDuration('-5m')` is true — it is a\n // well-formed Go duration — and the reference still refuses it, because a\n // deadline in the past is not a deadline. An oracle that accepted it would\n // be LOOSER than the door it predicts, which is the more damaging direction\n // for a \"would this save?\" answer.\n //\n // NOT ported, deliberately: the reference also LOGS a warning when the declared\n // timeout exceeds ORCH_MAX_MISSION_DURATION. That threshold is a server\n // constant this package cannot observe, and hard-coding 60m here would put\n // a second copy of a deployment-side number in another repository. See\n // PARITY.md divergence #12.\n //\n // Empty and null mean ABSENT, as they do in the reference: its field is a Go\n // string, a YAML null decodes to \"\", and the check runs only when the value\n // is non-empty. Refusing either would make this oracle stricter than the door.\n const declared: unknown = orch.human_question_timeout;\n if (declared !== undefined && declared !== null && declared !== '') {\n const text = issues.stringAt(declared, 'orchestrator.human_question_timeout');\n const parsed = text !== null ? parseGoDuration(text) : null;\n if (parsed === null || parsed <= 0) {\n issues.error({\n field: 'orchestrator.human_question_timeout',\n message: `human_question_timeout '${text ?? String(declared)}' is not a valid positive duration`,\n code: 'orchestrator_human_question_timeout_invalid',\n });\n }\n }\n\n // DC-COND-1: termination-authority mode. Empty defaults to monitor (valid).\n const mode = issues.stringOf(orch, 'mode', 'orchestrator');\n if (mode !== null && mode !== '' && !ORCHESTRATOR_MODES.has(mode)) {\n issues.error({\n field: 'orchestrator.mode',\n message: `Invalid orchestrator mode '${mode}'`,\n code: 'orchestrator_mode_invalid',\n suggestion: `Use one of: ${[...ORCHESTRATOR_MODES].join(', ')}`,\n });\n } else if (mode === MODE_OWNER && !flowHasOrchestratorYieldEdge(flow)) {\n // owner mode cedes lifecycle to the LLM, reachable only via an explicit\n // next: orchestrator yield edge. A self-terminating DAG under owner is refused.\n issues.error({\n field: 'orchestrator.mode',\n message:\n \"orchestrator mode 'owner' requires at least one step with next: 'orchestrator' (an explicit yield edge); a self-terminating DAG must use mode 'monitor'\",\n code: 'orchestrator_owner_needs_yield',\n });\n }\n\n // enforce_region makes the provider refuse a call that carries no region, so\n // declaring it without naming one would fail every turn closed; the reference\n // refuses it at save. `region` is a Go string (any scalar, null = empty) and\n // is judged after trimming whitespace.\n if (orch.enforce_region === true) {\n const region = issues.stringOf(orch, 'region', 'orchestrator');\n if (region === null || region.trim() === '') {\n issues.error({\n field: 'orchestrator.enforce_region',\n message:\n 'orchestrator: enforce_region requires region (name the region the model must run in, e.g. region: eu)',\n code: 'orchestrator_enforce_region_needs_region',\n suggestion:\n 'Add `region: eu` (or the region the model must run in), or drop enforce_region',\n });\n }\n }\n\n if (Array.isArray(orch.triggers)) {\n orch.triggers.forEach((rawTrigger: unknown, i: number) => {\n if (!isRecord(rawTrigger)) return;\n const trigger = rawTrigger as OrchestratorTrigger;\n const base = `orchestrator.triggers[${i}]`;\n const type = issues.stringOf(trigger, 'type', base);\n if (type === null || !ORCHESTRATOR_TRIGGERS.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Unknown orchestrator trigger type '${type ?? String(trigger.type)}'`,\n code: 'orchestrator_trigger_unknown',\n suggestion: `Use one of: ${[...ORCHESTRATOR_TRIGGERS].join(', ')}`,\n });\n return;\n }\n if (type === TRIGGER_TIMER) {\n // A Go `string` field, filled from ANY scalar by its source text:\n // `interval: 0` is \"0\" and saves, `interval: 100` is \"100\" (no unit).\n // A number used to read as \"no interval\" here.\n const interval = issues.stringOf(trigger, 'interval', base);\n if (interval === null || interval === '') {\n issues.error({\n field: `${base}.interval`,\n message: 'timer trigger requires an interval',\n code: 'orchestrator_timer_no_interval',\n });\n } else if (!isValidGoDuration(interval)) {\n issues.error({\n field: `${base}.interval`,\n message: `timer trigger interval '${interval}' is not a valid duration`,\n code: 'orchestrator_timer_bad_interval',\n });\n }\n }\n });\n }\n\n if (Array.isArray(orch.tools)) {\n orch.tools.forEach((raw: unknown, i: number) => {\n const tool = issues.stringAt(raw, `orchestrator.tools[${i}]`);\n if (tool === null || ORCHESTRATOR_TOOLS.has(tool)) return;\n const finding = {\n field: `orchestrator.tools[${i}]`,\n message: `Unrecognised orchestrator tool name '${tool}'`,\n code: 'orchestrator_tool_unknown',\n };\n if (opts.strictRegistries) {\n issues.error(finding);\n } else {\n issues.warn(finding);\n }\n });\n }\n\n if (orch.agentic === false) {\n issues.warn({\n field: 'orchestrator.agentic',\n message: 'orchestrator is most useful with agentic: true',\n code: 'orchestrator_not_agentic',\n });\n }\n }\n\n // Campaign requires an orchestrator.\n if (flow.campaign !== undefined && flow.campaign !== null) {\n if (!hasOrchestrator) {\n issues.error({\n field: 'campaign',\n message: 'campaign requires an orchestrator block',\n code: 'campaign_requires_orchestrator',\n });\n }\n const campaign = flow.campaign;\n\n // AIF v2.728.0 (DC-FORGE-155): `max_credits_per_child` is a Go int64 and\n // `CampaignConfig.Validate` refuses a negative value. 0 (and absent, and\n // null) means \"no per-child cap\".\n //\n // ⚠️ A FRACTION SAVES. yaml.v3 decodes a float into an int field by\n // truncating toward zero, so `1.5` is stored as 1 and `-0.5` as 0 (which\n // then passes the `>= 0` check). Measured against the reference's strict\n // save parser; this validator used to refuse every non-integer, which made\n // it stricter than the door it predicts. What still fails to decode: a\n // string, a boolean, NaN, +Inf, and a float at or above 2^63. `-.inf`\n // decodes to a negative int64 and is refused by the `>= 0` check.\n if (isRecord(campaign)) {\n const cap: unknown = campaign.max_credits_per_child;\n if (cap !== undefined && cap !== null) {\n const decoded = decodeGoInt(cap);\n if (decoded === null) {\n issues.error({\n field: 'campaign.max_credits_per_child',\n message: `campaign.max_credits_per_child must be a number of credits, got '${String(cap)}'`,\n code: 'invalid_type',\n });\n } else if (decoded < 0) {\n issues.error({\n field: 'campaign.max_credits_per_child',\n message: 'campaign: max_credits_per_child must be >= 0',\n code: 'campaign_invalid_max_credits_per_child',\n });\n }\n }\n validateCampaignChildFlows(campaign, issues);\n }\n\n // The rest of CampaignConfig.Validate — max_concurrent, max_depth and\n // max_total_children must each be >= 1 — is UNREACHABLE at the save door\n // and deliberately not ported: ApplyDefaults runs first and replaces every\n // value <= 0 with a positive default, so no document can reach it.\n\n // DC-COND-2: on_children_complete (if set) must reference a real step — the\n // engine routes into it deterministically once every child is terminal.\n const target = isRecord(campaign)\n ? issues.stringOf(campaign, 'on_children_complete', 'campaign')\n : null;\n if (target !== null && target !== '') {\n const steps = isRecord(flow.steps) ? flow.steps : {};\n if (!(target in steps)) {\n issues.error({\n field: 'campaign.on_children_complete',\n message: `campaign.on_children_complete references unknown step '${target}'`,\n code: 'campaign_handoff_step_unknown',\n });\n }\n }\n }\n}\n","// Step credential-binding validation.\n//\n// Mirrors `validateStepCredentialBindings` (parser.go): `credentials` and\n// `credential` are mutually exclusive; every source must be\n// `stored/{provider}/{name}` with non-empty provider and name; explicit\n// bindings require a non-empty `inject_as`. Applies to loop sub-steps too.\n\nimport type { CredentialBinding, Flow, LoopSubStep } from '../types.js';\nimport { CREDENTIAL_REFERENCE_PREFIX } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nfunction hasPrefix(source: string): boolean {\n return (\n source.length > CREDENTIAL_REFERENCE_PREFIX.length &&\n source.startsWith(CREDENTIAL_REFERENCE_PREFIX)\n );\n}\n\n// Matches Go's isValidCredentialSourceFormat: first '/' after the prefix must\n// have a non-empty provider before it and a non-empty name after it.\nfunction hasValidFormat(source: string): boolean {\n const rest = source.slice(CREDENTIAL_REFERENCE_PREFIX.length);\n const idx = rest.indexOf('/');\n return idx > 0 && idx < rest.length - 1;\n}\n\ninterface StepCreds {\n credential?: unknown;\n credentials?: unknown;\n}\n\nfunction checkBindings(creds: StepCreds, fieldBase: string, stepID: string, issues: Issues): void {\n const credentialsMap = creds.credentials;\n // Go `string` fields throughout. `fieldBase` is the owner's path plus\n // `.credential`, which is the shorthand's own document path.\n const credential = issues.stringAt(creds.credential, fieldBase);\n const hasCredentialsMap = isRecord(credentialsMap) && Object.keys(credentialsMap).length > 0;\n const hasShorthand = credential !== null && credential !== '';\n\n if (hasCredentialsMap && hasShorthand) {\n issues.error({\n field: fieldBase,\n message: `Step '${stepID}' cannot set both 'credentials' and 'credential'`,\n code: 'cred_bind_mutual_exclusive',\n stepId: stepID,\n });\n }\n\n if (isRecord(credentialsMap)) {\n for (const [bindingName, rawBinding] of Object.entries(credentialsMap)) {\n if (rawBinding === null || rawBinding === undefined) continue;\n if (!isRecord(rawBinding)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}`,\n message: `Credential binding '${bindingName}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n const binding = rawBinding as CredentialBinding;\n const bindingPath = `${fieldBase}s.${bindingName}`;\n const source = issues.stringOf(binding, 'source', bindingPath);\n if (source === null || !hasPrefix(source)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.source`,\n message: `Credential binding '${bindingName}' source must start with '${CREDENTIAL_REFERENCE_PREFIX}'`,\n code: 'cred_bind_invalid_source',\n stepId: stepID,\n });\n } else if (!hasValidFormat(source)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.source`,\n message: `Credential binding '${bindingName}' source must be '${CREDENTIAL_REFERENCE_PREFIX}{provider}/{name}'`,\n code: 'cred_bind_source_format',\n stepId: stepID,\n });\n }\n if (!issues.nonEmptyStringOf(binding, 'inject_as', bindingPath)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.inject_as`,\n message: `Credential binding '${bindingName}' requires a non-empty 'inject_as'`,\n code: 'cred_bind_inject_as_empty',\n stepId: stepID,\n });\n }\n }\n }\n\n if (hasShorthand) {\n const c = credential;\n if (!hasPrefix(c)) {\n issues.error({\n field: fieldBase,\n message: `Shorthand credential must start with '${CREDENTIAL_REFERENCE_PREFIX}'`,\n code: 'cred_bind_shorthand_source',\n stepId: stepID,\n });\n } else if (!hasValidFormat(c)) {\n issues.error({\n field: fieldBase,\n message: `Shorthand credential must be '${CREDENTIAL_REFERENCE_PREFIX}{provider}/{name}'`,\n code: 'cred_bind_shorthand_format',\n stepId: stepID,\n });\n }\n }\n}\n\nexport function validateCredentialBindings(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n checkBindings(step as StepCreds, `steps.${stepID}.credential`, stepID, issues);\n\n const loop = step.loop;\n if (isRecord(loop) && Array.isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n const subID =\n issues.stringOf(subStep, 'id', `steps.${stepID}.loop.steps[${i}]`) ?? String(i);\n checkBindings(\n subStep as StepCreds,\n `steps.${stepID}.loop.steps[${i}].credential`,\n `${stepID}.${subID}`,\n issues,\n );\n });\n }\n }\n}\n","// `input_schema` definition validation + the file-ordering lint.\n//\n// Mirrors `ValidateInputSchemaDefinition` + `LintInputSchemaFieldOrdering`\n// (input_schema.go). This validates the SCHEMA DEFINITION only — payload\n// validation (`ValidateInputAgainstSchema`) is runtime and out of scope.\n//\n// Note: pattern compilation uses the JS regex engine, not Go RE2; a pattern\n// valid in one engine but not the other is a known, documented divergence.\n\nimport type { Flow, InputSchema, InputSchemaField, VisibleWhenPredicate } from '../types.js';\nimport { INPUT_SCHEMA, INPUT_SCHEMA_VERSION } from '../spec/index.js';\nimport { Issues, isInteger, isNumber, isRecord } from './util.js';\n\nconst TYPE_ENUM = 'enum';\nconst TYPE_NUMBER = 'number';\nconst TYPE_ARRAY_OF_STRINGS = 'array_of_strings';\nconst TYPE_FILE = 'file';\n\nfunction fieldPath(schemaPath: string, i: number): string {\n return `${schemaPath}.fields[${i}]`;\n}\n\nfunction validateField(\n f: InputSchemaField,\n schemaPath: string,\n i: number,\n seen: Map<string, number>,\n issues: Issues,\n): void {\n const base = fieldPath(schemaPath, i);\n // `name`, `type` and `pattern` are Go `string` fields: `name: 5` is the name\n // \"5\", `type: 1` the unknown type \"1\".\n const name = issues.stringOf(f, 'name', base);\n const shownName = name ?? String(f.name);\n const pattern = issues.stringOf(f, 'pattern', base);\n\n // Name + duplicate detection.\n if (name === null || !INPUT_SCHEMA.fieldNamePattern.test(name)) {\n issues.error({\n field: base,\n message: `input_schema field name '${shownName}' is invalid (must match ${INPUT_SCHEMA.fieldNamePattern.source})`,\n code: 'input_schema_invalid_field_name',\n });\n } else if (seen.has(name)) {\n issues.error({\n field: base,\n message: `Duplicate input_schema field name '${name}' (first declared at index ${seen.get(name)})`,\n code: 'input_schema_duplicate_field_name',\n });\n } else {\n seen.set(name, i);\n }\n\n // Type — bail on per-type checks if unknown.\n const type = issues.stringOf(f, 'type', base);\n if (type === null || !INPUT_SCHEMA.types.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Unknown input_schema field type '${type ?? String(f.type)}'`,\n code: 'input_schema_unknown_type',\n suggestion: `Use one of: ${[...INPUT_SCHEMA.types].join(', ')}`,\n });\n return;\n }\n\n // Per-type constraint sanity.\n if (type === TYPE_ENUM && (!Array.isArray(f.enum) || f.enum.length === 0)) {\n issues.error({\n field: `${base}.enum`,\n message: `enum field '${shownName}' must list at least one allowed value`,\n code: 'input_schema_enum_empty',\n });\n }\n if (isNumber(f.min) && isNumber(f.max) && f.min > f.max) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min (${f.min}) must be <= max (${f.max})`,\n code: 'input_schema_invalid_range',\n });\n }\n if (isInteger(f.min_length) && isInteger(f.max_length) && f.min_length > f.max_length) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min_length (${f.min_length}) must be <= max_length (${f.max_length})`,\n code: 'input_schema_invalid_range',\n });\n }\n if (isInteger(f.min_items) && isInteger(f.max_items) && f.min_items > f.max_items) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min_items (${f.min_items}) must be <= max_items (${f.max_items})`,\n code: 'input_schema_invalid_range',\n });\n }\n\n // Constraint-to-type compatibility.\n const stringy = INPUT_SCHEMA.stringTypes.has(type);\n const mismatch = (constraint: string): void =>\n issues.error({\n field: `${base}.${constraint}`,\n message: `constraint '${constraint}' is not meaningful for field '${shownName}' of type '${type}'`,\n code: 'input_schema_constraint_type_mismatch',\n });\n if (!stringy) {\n if (f.min_length !== undefined) mismatch('min_length');\n if (f.max_length !== undefined) mismatch('max_length');\n if (pattern !== null && pattern !== '') mismatch('pattern');\n }\n if (type !== TYPE_NUMBER) {\n if (f.min !== undefined) mismatch('min');\n if (f.max !== undefined) mismatch('max');\n }\n if (type !== TYPE_ARRAY_OF_STRINGS) {\n if (f.min_items !== undefined) mismatch('min_items');\n if (f.max_items !== undefined) mismatch('max_items');\n }\n if (type !== TYPE_FILE) {\n if (Array.isArray(f.accept) && f.accept.length > 0) mismatch('accept');\n if (f.max_size !== undefined) mismatch('max_size');\n }\n if (type !== TYPE_ENUM && Array.isArray(f.enum) && f.enum.length > 0) mismatch('enum');\n\n // Constraint value caps.\n const cap = (constraint: string, val: number): void =>\n issues.error({\n field: `${base}.${constraint}`,\n message: `constraint '${constraint}' (${val}) for field '${shownName}' exceeds the maximum of ${INPUT_SCHEMA.maxConstraintValue}`,\n code: 'input_schema_constraint_out_of_range',\n });\n if (isInteger(f.min_length) && f.min_length > INPUT_SCHEMA.maxConstraintValue)\n cap('min_length', f.min_length);\n if (isInteger(f.max_length) && f.max_length > INPUT_SCHEMA.maxConstraintValue)\n cap('max_length', f.max_length);\n if (isInteger(f.min_items) && f.min_items > INPUT_SCHEMA.maxConstraintValue)\n cap('min_items', f.min_items);\n if (isInteger(f.max_items) && f.max_items > INPUT_SCHEMA.maxConstraintValue)\n cap('max_items', f.max_items);\n\n // visible_when first-pass predicate shape.\n if (isRecord(f.visible_when)) {\n const vw = f.visible_when as VisibleWhenPredicate;\n const hasEquals = vw.equals !== undefined && vw.equals !== null;\n const hasIn = Array.isArray(vw.in) && vw.in.length > 0;\n if (!issues.nonEmptyStringOf(vw, 'field', `${base}.visible_when`)) {\n issues.error({\n field: `${base}.visible_when`,\n message: `field '${shownName}': visible_when requires a 'field'`,\n code: 'input_schema_visible_when_no_predicate',\n });\n } else if (hasEquals === hasIn) {\n issues.error({\n field: `${base}.visible_when`,\n message: `field '${shownName}': visible_when requires exactly one of 'equals' or 'in'`,\n code: 'input_schema_visible_when_no_predicate',\n });\n }\n }\n\n // Pattern length + compilation.\n if (pattern !== null && pattern !== '') {\n if (pattern.length > INPUT_SCHEMA.maxPatternLength) {\n issues.error({\n field: `${base}.pattern`,\n message: `field '${shownName}': pattern length ${pattern.length} exceeds the maximum of ${INPUT_SCHEMA.maxPatternLength}`,\n code: 'input_schema_pattern_too_long',\n });\n } else {\n try {\n new RegExp(pattern);\n } catch (e) {\n issues.error({\n field: `${base}.pattern`,\n message: `field '${shownName}': invalid pattern: ${e instanceof Error ? e.message : String(e)}`,\n code: 'input_schema_invalid_pattern',\n });\n }\n }\n }\n}\n\nfunction lintFieldOrdering(fields: InputSchemaField[], schemaPath: string, issues: Issues): void {\n let firstParametricIdx = -1;\n let firstParametricName = '';\n let firstParametricType = '';\n fields.forEach((f, i) => {\n if (!isRecord(f)) return;\n const type = issues.stringOf(f, 'type', fieldPath(schemaPath, i));\n if (type === null) return;\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i)) ?? `#${i}`;\n if (firstParametricIdx === -1 && INPUT_SCHEMA.parametricTypes.has(type)) {\n firstParametricIdx = i;\n firstParametricName = name;\n firstParametricType = type;\n return;\n }\n if (type === TYPE_FILE && firstParametricIdx !== -1) {\n issues.warn({\n field: fieldPath(schemaPath, i),\n message: `file field '${name}' is declared after parametric field '${firstParametricName}' (${firstParametricType}); consider moving file fields first`,\n code: 'input_schema_file_after_parametric',\n });\n }\n });\n}\n\n/**\n * Validate one `InputSchema`-shaped definition at an arbitrary base path.\n *\n * Mirrors the Go `ValidateInputSchemaDefinition`, which is reused verbatim for\n * both `flow.input_schema` and a step's `output_schema` (DC-CP-7). The emitted\n * `code`s are therefore the shared `input_schema_*` set regardless of the site;\n * only the `field` path differs (`schemaPath`).\n */\nexport function validateSchemaDefinition(\n schema: unknown,\n schemaPath: string,\n issues: Issues,\n): void {\n if (schema === undefined || schema === null) return;\n if (!isRecord(schema)) {\n issues.error({\n field: schemaPath,\n message: `${schemaPath} must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n const s = schema as InputSchema;\n\n if (s.version !== INPUT_SCHEMA_VERSION) {\n issues.error({\n field: `${schemaPath}.version`,\n message: `${schemaPath} version ${String(s.version)} is not supported (expected ${INPUT_SCHEMA_VERSION})`,\n code: 'input_schema_invalid_version',\n });\n }\n\n const fields = s.fields;\n if (fields === undefined || fields === null) return;\n if (!Array.isArray(fields)) {\n issues.error({\n field: `${schemaPath}.fields`,\n message: `${schemaPath}.fields must be a list`,\n code: 'invalid_type',\n });\n return;\n }\n\n // Resolution index for visible_when (forward references allowed).\n const allNames = new Set<string>();\n fields.forEach((f: unknown, i: number) => {\n if (!isRecord(f)) return;\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i));\n if (name !== null && name !== '') allNames.add(name);\n });\n\n const seen = new Map<string, number>();\n fields.forEach((rawField, i) => {\n if (!isRecord(rawField)) {\n issues.error({\n field: fieldPath(schemaPath, i),\n message: `${schemaPath} field at index ${i} must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n validateField(rawField as InputSchemaField, schemaPath, i, seen, issues);\n });\n\n // Second pass: visible_when references must resolve.\n fields.forEach((rawField, i) => {\n if (!isRecord(rawField)) return;\n const f = rawField as InputSchemaField;\n if (!isRecord(f.visible_when)) return;\n const vw = f.visible_when as VisibleWhenPredicate;\n const ref = issues.stringOf(vw, 'field', `${fieldPath(schemaPath, i)}.visible_when`);\n if (ref !== null && ref !== '' && !allNames.has(ref)) {\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i)) ?? `#${i}`;\n issues.error({\n field: `${fieldPath(schemaPath, i)}.visible_when.field`,\n message: `field '${name}': visible_when references unknown field '${ref}'`,\n code: 'input_schema_visible_when_unknown_field',\n });\n }\n });\n\n lintFieldOrdering(fields as InputSchemaField[], schemaPath, issues);\n}\n\nexport function validateInputSchema(flow: Flow, issues: Issues): void {\n validateSchemaDefinition(flow.input_schema, 'input_schema', issues);\n}\n","// `reserved_input_name`: an input the flow declares in the platform's `__`\n// namespace.\n//\n// The platform keeps that namespace for values it writes itself: the acting\n// person, the credential manifest, the untrusted-input marker. A declared default\n// under such a name used to be a way for a flow author to write one of them, and a\n// value or default written there is never delivered at run time, so the author\n// learns at save that the name cannot carry data.\n//\n// Both places an input is declared are read: the keys of the top-level `query:`\n// mapping (reported sorted, field `query.<name>`) and the `name` of every\n// `input_schema.fields[]` entry (in file order, field `input_schema.fields.<name>`).\n// A schema field is addressed by NAME, not by index like this port's other\n// input_schema findings, because the reference reports it that way and a host that\n// merges several verdicts drops a finding only when code and field both match.\n// A non-string name is skipped (`input_schema_invalid_field_name` names it).\n// Findings carry no step id.\n\nimport type { Flow } from '../types.js';\nimport { RESERVED_INPUT_NAMES } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nfunction formatField(format: string, name: string): string {\n return format.replace('%s', () => name);\n}\n\nexport function validateReservedInputNames(flow: Flow, issues: Issues): void {\n const rule = RESERVED_INPUT_NAMES;\n const report = (name: string, fieldFormat: string): void => {\n issues.error({\n field: formatField(fieldFormat, name),\n message: rule.messageFormat.replace('%s', () => JSON.stringify(name)),\n code: rule.code,\n suggestion: rule.suggestion,\n });\n };\n const query = (flow as { query?: unknown }).query;\n if (isRecord(query)) {\n for (const name of Object.keys(query).sort()) {\n if (name.startsWith(rule.prefix)) report(name, rule.queryFieldFormat);\n }\n }\n const schema = (flow as { input_schema?: unknown }).input_schema;\n const fields = isRecord(schema) ? schema.fields : undefined;\n if (!Array.isArray(fields)) return;\n for (const f of fields) {\n if (!isRecord(f)) continue;\n if (typeof f.name === 'string' && f.name.startsWith(rule.prefix)) {\n report(f.name, rule.schemaFieldFormat);\n }\n }\n}\n","// Per-step `output_schema` definition validation (DC-CP-7).\n//\n// A step may declare `output_schema`, the typed shape of its own output. In the\n// Go reference this reuses the SAME structure and validator as `input_schema`\n// (`ValidateInputSchemaDefinition` is called verbatim on `step.OutputSchema`),\n// so we delegate to the shared `validateSchemaDefinition` and only differ in the\n// base field path. It is optional (opt-in): a step without `output_schema` keeps\n// lenient behavior. Loop sub-steps may also carry an `output_schema`.\n//\n// NOTE: the companion `unresolvable_data_path` rule (a `.data.<step>.<field>`\n// reference to a field NOT declared in `<step>`'s output_schema) requires\n// resolving template field references against the state graph — the same\n// runtime concern this validator deliberately does NOT reproduce for templates.\n// It is a documented divergence; see PARITY.md.\n\nimport type { Flow, LoopSubStep, StepDefinition } from '../types.js';\nimport { Issues, isArray, isRecord } from './util.js';\nimport { validateSchemaDefinition } from './inputSchema.js';\n\nexport function validateOutputSchemas(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n if (step.output_schema !== undefined) {\n validateSchemaDefinition(step.output_schema, `steps.${stepID}.output_schema`, issues);\n }\n\n // Loop sub-steps each carry their own optional output_schema.\n const loop = step.loop;\n if (isRecord(loop) && isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n if (subStep.output_schema !== undefined) {\n validateSchemaDefinition(\n subStep.output_schema,\n `steps.${stepID}.loop.steps[${i}].output_schema`,\n issues,\n );\n }\n });\n }\n }\n}\n","// Per-step `quality_gate:` block validation (DC-CP-8).\n//\n// Mirrors `FlowParser.validateQualityGate` (parser.go): rubric non-empty;\n// threshold in [0,1]; on_fail ∈ {fail,goto,retry} (the Go enum also lists\n// `human`, but it is validation-REJECTED pending the human-task inbox, so we\n// reject it too — with its own code); when on_fail=goto, goto_step is required,\n// must name an existing step, and must not point at the gate's own step (a\n// failing self-goto loops forever). The Go layer additionally refuses a gate on\n// a composite step (loop/for_each/parallel) or on a member of another step's\n// parallel fan-out, because gate routing is only wired into the sequential\n// driver; those static guards are ported here as well.\n//\n// Comparison contract is the `code` set (the Go layer uses a single\n// ErrFlowValidation error class with distinct messages; the stable codes below\n// are this validator's parity surface).\n\nimport type { Flow, NextLogicDefinition, QualityGateDefinition, StepDefinition } from '../types.js';\nimport { QUALITY_GATE } from '../spec/index.js';\nimport { Issues, isNumber, isRecord } from './util.js';\n\nconst ON_FAIL_GOTO = 'goto';\n\nfunction isCompositeStep(step: StepDefinition): boolean {\n const next = step.next as NextLogicDefinition | undefined;\n return (\n isRecord(step.loop) || isRecord(step.for_each) || (isRecord(next) && isRecord(next.parallel))\n );\n}\n\n/** Step IDs that appear in some OTHER step's `next.parallel.steps` fan-out. */\nfunction parallelMembers(steps: Record<string, unknown>, issues: Issues): Map<string, string> {\n const members = new Map<string, string>();\n for (const [ownerID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const next = (rawStep as StepDefinition).next as NextLogicDefinition | undefined;\n const list = isRecord(next) && isRecord(next.parallel) ? next.parallel.steps : undefined;\n if (!Array.isArray(list)) continue;\n list.forEach((raw: unknown, i: number) => {\n const memberID = issues.stringAt(raw, `steps.${ownerID}.next.parallel.steps[${i}]`);\n if (memberID !== null && !members.has(memberID)) members.set(memberID, ownerID);\n });\n }\n return members;\n}\n\nfunction validateGate(\n gate: QualityGateDefinition,\n stepID: string,\n step: StepDefinition,\n steps: Record<string, unknown>,\n members: Map<string, string>,\n issues: Issues,\n): void {\n const field = `steps.${stepID}.quality_gate`;\n\n // rubric — required, non-empty.\n // Go `string` fields throughout: `rubric: 5` is a rubric, `on_fail: 1` is the\n // invalid action \"1\", `goto_step: 2` names the step \"2\".\n const rubric = issues.stringOf(gate, 'rubric', field);\n if (rubric === null || rubric.trim() === '') {\n issues.error({\n field: `${field}.rubric`,\n message: `quality_gate on step '${stepID}' requires a non-empty 'rubric'`,\n code: 'quality_gate_missing_rubric',\n stepId: stepID,\n });\n }\n\n // threshold — when set, must be in [0,1].\n if (gate.threshold !== undefined) {\n if (\n !isNumber(gate.threshold) ||\n gate.threshold < QUALITY_GATE.thresholdMin ||\n gate.threshold > QUALITY_GATE.thresholdMax\n ) {\n issues.error({\n field: `${field}.threshold`,\n message: `quality_gate on step '${stepID}' has threshold ${String(gate.threshold)} out of range [${QUALITY_GATE.thresholdMin},${QUALITY_GATE.thresholdMax}]`,\n code: 'quality_gate_threshold_out_of_range',\n stepId: stepID,\n });\n }\n }\n\n // on_fail — optional; when set must be a supported action.\n const onFail = issues.stringOf(gate, 'on_fail', field);\n if (onFail !== null && onFail !== '') {\n if (QUALITY_GATE.onFailRejected.has(onFail)) {\n // Present in the Go enum but not yet supported (e.g. `human`).\n issues.error({\n field: `${field}.on_fail`,\n message: `quality_gate on step '${stepID}' uses on_fail='${onFail}', which is not yet supported; use one of: ${[...QUALITY_GATE.onFailActions].join(', ')}`,\n code: 'quality_gate_on_fail_unsupported',\n stepId: stepID,\n });\n } else if (!QUALITY_GATE.onFailActions.has(onFail)) {\n issues.error({\n field: `${field}.on_fail`,\n message: `quality_gate on step '${stepID}' has invalid on_fail '${onFail}'`,\n code: 'quality_gate_invalid_on_fail',\n stepId: stepID,\n suggestion: `Use one of: ${[...QUALITY_GATE.onFailActions].join(', ')}`,\n });\n }\n }\n\n // goto_step — required + must resolve when on_fail=goto, and not be a self-goto.\n if (onFail === ON_FAIL_GOTO) {\n const goto = issues.stringOf(gate, 'goto_step', field);\n if (goto === null || goto === '') {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' uses on_fail=goto but goto_step is empty`,\n code: 'quality_gate_goto_missing',\n stepId: stepID,\n });\n } else if (!(goto in steps)) {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' goto_step '${goto}' does not name an existing step`,\n code: 'step_not_found',\n stepId: stepID,\n });\n } else if (goto === stepID) {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' uses on_fail=goto pointing at itself; a failing self-goto loops forever (use on_fail=retry with max_retries)`,\n code: 'quality_gate_goto_self',\n stepId: stepID,\n });\n }\n }\n\n // Composite / parallel-member scope guards.\n if (isCompositeStep(step)) {\n issues.error({\n field,\n message: `quality_gate on step '${stepID}' is not supported on loop/for_each/parallel steps`,\n code: 'quality_gate_on_composite',\n stepId: stepID,\n });\n }\n const owner = members.get(stepID);\n if (owner !== undefined) {\n issues.error({\n field,\n message: `quality_gate on step '${stepID}' is not supported because it is a parallel member of step '${owner}'`,\n code: 'quality_gate_on_parallel_member',\n stepId: stepID,\n });\n }\n}\n\nexport function validateQualityGates(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const members = parallelMembers(steps, issues);\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n if (!isRecord(step.quality_gate)) continue;\n validateGate(step.quality_gate as QualityGateDefinition, stepID, step, steps, members, issues);\n }\n}\n","// Focused syntax checker for Go `text/template` source.\n//\n// This is NOT a renderer and NOT a full parser. It reproduces the subset of\n// Go's `template.Parse` *syntax* failures that matter for static flow\n// validation, with a deliberate bias against false positives:\n//\n// 1. Unclosed `{{` action delimiters (respecting quoted strings + comments).\n// 2. Control-flow nesting balance: if / range / with / block / define must\n// each be closed by `end`; `else` must sit inside if / with / range.\n// 3. Empty actions (`{{}}`).\n// 4. (opt-in) Unknown function names in command position.\n//\n// Stray `}}` in text is NOT an error (Go treats it as literal text), matching\n// the reference behaviour. Field/variable/literal pipelines are intentionally\n// not deeply parsed — that would invite false positives without catching bugs\n// a flow author cares about at authoring time.\n\n/** A single Go-template syntax problem. */\nexport interface TemplateSyntaxError {\n message: string;\n /** When true, this came from the opt-in function allow-list pass. */\n isFunctionError?: boolean;\n}\n\nexport interface TemplateCheckOptions {\n /** Function names recognised by the AIgentFlow template engine. */\n knownFunctions?: ReadonlySet<string>;\n /** When true, an unknown command-position function name is reported. */\n strictFunctions?: boolean;\n}\n\nconst BLOCK_OPENERS = new Set(['if', 'range', 'with', 'block', 'define']);\nconst ELSE_CONTEXTS = new Set(['if', 'range', 'with']);\nconst KEYWORDS = new Set(['if', 'range', 'with', 'block', 'define', 'template', 'else', 'end']);\nconst LITERALS = new Set(['true', 'false', 'nil']);\n\nexport interface Action {\n /** Raw inner text between the delimiters (trim markers stripped). */\n body: string;\n /** True for comment actions (the Go `comment` action form). */\n isComment: boolean;\n}\n\n/**\n * Split template source into actions, respecting quoted strings and comments.\n * Returns the actions plus a fatal error if a `{{` is never closed.\n */\nexport function lexActions(src: string): { actions: Action[]; fatal?: TemplateSyntaxError } {\n const actions: Action[] = [];\n let i = 0;\n const n = src.length;\n\n while (i < n) {\n const open = src.indexOf('{{', i);\n if (open === -1) break;\n\n let j = open + 2;\n // Optional left-trim marker `{{-`.\n if (src[j] === '-') j += 1;\n\n // Comment action: `{{/* ... */}}`.\n const afterWs = skipSpaces(src, j);\n if (src.startsWith('/*', afterWs)) {\n const closeComment = src.indexOf('*/', afterWs + 2);\n if (closeComment === -1) {\n return { actions, fatal: { message: 'unclosed comment in action: missing \"*/\"' } };\n }\n let k = skipSpaces(src, closeComment + 2);\n if (src[k] === '-') k += 1;\n if (!src.startsWith('}}', k)) {\n return {\n actions,\n fatal: { message: 'unclosed action delimiter: expected \"}}\" after comment' },\n };\n }\n actions.push({ body: '', isComment: true });\n i = k + 2;\n continue;\n }\n\n // Scan for the closing `}}`, skipping over quoted strings.\n let k = j;\n let closed = -1;\n while (k < n) {\n const c = src[k];\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(src, k, c);\n if (end === -1) {\n return {\n actions,\n fatal: { message: `unterminated string in action: missing closing ${c}` },\n };\n }\n k = end + 1;\n continue;\n }\n if (c === '}' && src[k + 1] === '}') {\n closed = k;\n break;\n }\n k += 1;\n }\n if (closed === -1) {\n return { actions, fatal: { message: 'unclosed action delimiter \"{{\"' } };\n }\n\n let bodyEnd = closed;\n // Strip right-trim marker ` -}}` → the `-` immediately before `}}`.\n if (src[bodyEnd - 1] === '-') bodyEnd -= 1;\n const body = src.slice(j, bodyEnd).trim();\n actions.push({ body, isComment: false });\n i = closed + 2;\n }\n\n return { actions };\n}\n\nfunction skipSpaces(src: string, idx: number): number {\n let i = idx;\n while (\n i < src.length &&\n (src[i] === ' ' || src[i] === '\\t' || src[i] === '\\n' || src[i] === '\\r')\n ) {\n i += 1;\n }\n return i;\n}\n\n/** Returns the index of the closing quote, or -1 if unterminated. */\nexport function scanString(src: string, start: number, quote: string): number {\n let i = start + 1;\n const raw = quote === '`'; // backtick raw strings have no escapes\n while (i < src.length) {\n const c = src[i];\n if (!raw && c === '\\\\') {\n i += 2;\n continue;\n }\n if (c === quote) return i;\n i += 1;\n }\n return -1;\n}\n\n/** First whitespace-delimited token of an action body. */\nfunction firstToken(body: string): string {\n const m = /^[a-zA-Z]+/.exec(body);\n return m ? m[0] : '';\n}\n\n/**\n * Check Go template source for syntax errors. Returns one entry per problem;\n * an empty array means the template parses (to the depth this checker models).\n */\nexport function checkGoTemplateSyntax(\n src: string,\n opts: TemplateCheckOptions = {},\n): TemplateSyntaxError[] {\n const errors: TemplateSyntaxError[] = [];\n const { actions, fatal } = lexActions(src);\n if (fatal) {\n errors.push(fatal);\n return errors;\n }\n\n // Track control-flow nesting.\n const stack: string[] = [];\n\n for (const action of actions) {\n if (action.isComment) continue;\n if (action.body === '') {\n errors.push({ message: 'empty action \"{{}}\"' });\n continue;\n }\n\n const tok = firstToken(action.body);\n if (KEYWORDS.has(tok)) {\n if (tok === 'end') {\n if (stack.length === 0) {\n errors.push({ message: 'unexpected \"{{end}}\" with no matching block' });\n } else {\n stack.pop();\n }\n } else if (tok === 'else') {\n const top = stack[stack.length - 1];\n if (top === undefined || !ELSE_CONTEXTS.has(top)) {\n errors.push({ message: 'unexpected \"{{else}}\" outside of if / range / with' });\n }\n } else if (BLOCK_OPENERS.has(tok)) {\n stack.push(tok);\n }\n // `template` takes no `end` — nothing to push.\n continue;\n }\n\n // Non-keyword leading token. Optionally check the function allow-list.\n if (opts.strictFunctions && opts.knownFunctions) {\n checkFunctions(action.body, opts.knownFunctions, errors);\n }\n }\n\n for (let s = stack.length - 1; s >= 0; s--) {\n errors.push({ message: `unclosed \"{{${stack[s]}}}\" action: missing \"{{end}}\"` });\n }\n\n return errors;\n}\n\n/**\n * Opt-in: flag bare identifiers in command position that are not known\n * functions. A bare leading word in a Go pipeline stage is a function call;\n * fields (`.x`), variables (`$x`), and literals are skipped. Conservative by\n * design — see PARITY.md for why this is off by default.\n */\nfunction checkFunctions(\n body: string,\n known: ReadonlySet<string>,\n errors: TemplateSyntaxError[],\n): void {\n // Split into pipeline stages on top-level `|` (ignore `|` inside strings).\n const stages = splitPipeline(body);\n for (const stage of stages) {\n const trimmed = stage.trim();\n if (trimmed === '') continue;\n const first = trimmed.split(/\\s+/)[0] as string;\n // Skip fields, variables, parenthesised sub-pipelines, string/number\n // literals, assignment, and keywords.\n if (\n first.startsWith('.') ||\n first.startsWith('$') ||\n first.startsWith('(') ||\n first.startsWith('\"') ||\n first.startsWith('`') ||\n first.startsWith(\"'\") ||\n /^[-+]?[0-9]/.test(first) ||\n KEYWORDS.has(first) ||\n LITERALS.has(first)\n ) {\n continue;\n }\n const name = /^[a-zA-Z_][a-zA-Z0-9_]*/.exec(first)?.[0];\n if (name && !known.has(name)) {\n errors.push({\n message: `function \"${name}\" not defined`,\n isFunctionError: true,\n });\n }\n }\n}\n\nfunction splitPipeline(body: string): string[] {\n const stages: string[] = [];\n let current = '';\n let i = 0;\n while (i < body.length) {\n const c = body[i] as string;\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(body, i, c);\n if (end === -1) {\n current += body.slice(i);\n break;\n }\n current += body.slice(i, end + 1);\n i = end + 1;\n continue;\n }\n if (c === '|') {\n stages.push(current);\n current = '';\n i += 1;\n continue;\n }\n current += c;\n i += 1;\n }\n stages.push(current);\n return stages;\n}\n","// Detects a value PIPED into the template function `default`.\n//\n// `default` takes the value first (`default .x \"fallback\"`). A pipe hands the\n// piped value to the LAST parameter, so `{{ .x | default \"w\" }}` is\n// `default \"w\" .x`: the literal is the \"value\", it is never empty, and the\n// result is always the fallback. Nothing fails at run time, the data is simply\n// never used.\n//\n// The reference walks Go's parse tree. This port has no parse tree, so it runs\n// a small tokenizer over each `{{ ... }}` action instead — never a regex over\n// the raw text. It respects string, raw-string and character literals and\n// comments, splits a pipeline on top-level `|`, recurses into parentheses, and\n// recognises the pipeline of `if` / `else if` / `range` / `with` / `template` /\n// `block` actions and of a `$v :=` declaration. Only a bare identifier `default`\n// in command position counts; a field (`.query.default`), a variable\n// (`$default`) and a literal never do. Known limits are in PARITY.md.\n\nimport { lexActions, scanString } from './gotmpl-syntax.js';\n\nconst FUNCTION_NAME = 'default';\nconst PIPE = '|';\nconst OPEN_PAREN = '(';\nconst CLOSE_PAREN = ')';\n/**\n * Parenthesis nesting past which a pipeline is left unexamined. The validator runs on untrusted\n * flow documents (browser, CLI, a service), and a template of thousands of `(` would otherwise\n * overflow the stack; Go's own template parser caps nesting too, so such a template never\n * runs. Real templates nest a handful of levels.\n */\nconst MAX_NESTING_DEPTH = 100;\n\n/** Control keywords whose remainder is a pipeline (longest first). */\nconst PIPELINE_KEYWORDS = /^(?:else\\s+if|else\\s+with|if|range|with|template|block)(?![\\w$.])/;\n/** `define \"name\"` carries no pipeline; neither does a bare `else`/`end`. */\nconst NO_PIPELINE = /^(?:define|else|end|break|continue)(?![\\w$.])/;\n/** A variable declaration or assignment that opens a pipeline. */\nconst DECLARATION = /^\\$\\w*(?:\\s*,\\s*\\$\\w*)*\\s*:?=/;\n\ninterface Parsed {\n /** Printed form of the pipeline just parsed. */\n text: string;\n /** Index just past what was consumed. */\n end: number;\n}\n\n/** Returns the sorted, de-duplicated pipelines of `src` that pipe into `default`. */\nexport function pipedDefaultPipelines(src: string): string[] {\n const { actions, fatal } = lexActions(src);\n if (fatal) return [];\n const found = new Set<string>();\n try {\n for (const action of actions) {\n if (action.isComment || action.body === '') continue;\n scanAction(action.body, found);\n }\n } catch (err) {\n // A rule must never take the validator down: a template this module cannot walk is simply\n // not examined (the syntax check has its own say about it).\n if (!(err instanceof RangeError)) throw err;\n return [];\n }\n return [...found].sort();\n}\n\nfunction scanAction(body: string, found: Set<string>): void {\n let rest = body;\n const kw = PIPELINE_KEYWORDS.exec(rest);\n if (!kw && NO_PIPELINE.test(rest)) return;\n if (kw) {\n rest = rest.slice(kw[0].length).trimStart();\n const keyword = kw[0].replace(/\\s+/g, ' ');\n if (keyword === 'template' || keyword === 'block') {\n // Skip the template name literal; the remainder is the pipeline.\n const q = rest[0];\n if (q === '\"' || q === '`') {\n const end = scanString(rest, 0, q);\n if (end === -1) return;\n rest = rest.slice(end + 1).trimStart();\n }\n }\n }\n if (rest === '') return;\n parsePipeline(rest, 0, false, found, 0);\n}\n\n/**\n * Parses one pipeline starting at `start`; when `nested`, stops after the `)`\n * that closes it. Every pipeline met on the way (this one and any parenthesised\n * one) is checked and recorded in `found`.\n */\nfunction parsePipeline(\n src: string,\n start: number,\n nested: boolean,\n found: Set<string>,\n depth: number,\n): Parsed {\n if (depth > MAX_NESTING_DEPTH) return { text: src.slice(start), end: src.length };\n let i = start;\n const n = src.length;\n let decl = '';\n const decMatch = DECLARATION.exec(src.slice(i));\n if (decMatch) {\n decl = decMatch[0].replace(/\\s+/g, ' ') + ' ';\n i += decMatch[0].length;\n }\n\n const commands: string[][] = [];\n let current: string[] = [];\n let firstWords: string[] = [];\n let pipedDefault = false;\n const pushCommand = (): void => {\n if (current.length > 0) {\n commands.push(current);\n firstWords.push(current[0] as string);\n }\n current = [];\n };\n\n while (i < n) {\n const c = src[i] as string;\n if (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n i += 1;\n continue;\n }\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(src, i, c);\n const stop = end === -1 ? n - 1 : end;\n current.push(src.slice(i, stop + 1));\n i = stop + 1;\n continue;\n }\n if (c === OPEN_PAREN) {\n const inner = parsePipeline(src, i + 1, true, found, depth + 1);\n current.push(`(${inner.text})`);\n i = inner.end;\n continue;\n }\n if (c === CLOSE_PAREN) {\n if (nested) {\n i += 1;\n break;\n }\n i += 1; // stray: tolerate\n continue;\n }\n if (c === PIPE) {\n pushCommand();\n i += 1;\n continue;\n }\n let j = i;\n while (j < n && !/[\\s|()\"`']/.test(src[j] as string)) j += 1;\n if (j === i) j = i + 1;\n current.push(src.slice(i, j));\n i = j;\n }\n pushCommand();\n\n firstWords.forEach((word, idx) => {\n if (idx > 0 && word === FUNCTION_NAME) pipedDefault = true;\n });\n const text = decl + commands.map((cmd) => cmd.join(' ')).join(` ${PIPE} `);\n if (pipedDefault) found.add(text);\n return { text, end: i };\n}\n","// Shape of a pre/post-processing operation: is the operation type one the\n// engine dispatches, and does the operation's handler read the config keys it\n// was given?\n//\n// Mirrors `validateProcessingOperationShape` (validation.go). Both verdicts are\n// WARNINGS in the reference and here: a flow carrying either mistake saves and\n// runs. That is the whole reason the rule is worth having — an operation type\n// the engine cannot dispatch fails at run time with \"unsupported operation\n// type\", and a config key the handler never reads is simply ignored, so a\n// `transformation:` written where the handler reads `transformer:` produces a\n// step that succeeds and does nothing.\n//\n// This module also owns the ONE enumeration of processing operations, which\n// `templates.ts` shares — the two rules disagree about nothing structural, and\n// a second walk would be a second place for the guard key to be mishandled.\n\nimport type { Flow, StepDefinition, ValidationIssue } from '../types.js';\nimport { PROCESSING_OPERATIONS, processingOperationConfigKeys } from '../spec/index.js';\nimport { Issues, isArray, isRecord } from './util.js';\n\n/** The optional guard key on a processing operation; every other key names the operation. */\nexport const PROCESSING_OP_GUARD_KEY = PROCESSING_OPERATIONS.guardKey;\n\n/** The two phases a processing operation can be declared in, in execution order. */\nconst PROCESSING_PHASES = ['pre_processing', 'post_processing'] as const;\n\n/**\n * One entry of a `pre_processing:` / `post_processing:` list, decomposed the way\n * the reference's custom unmarshaller decomposes it.\n *\n * A processing operation is written as a single-key map — `- data.set: { … }` —\n * plus an optional `if:` guard. `ProcessingOperationDefinition` unmarshals that\n * key into `OperationType` and its body into an INLINE `Config`, which is why\n * the operation name is NOT a path segment in any finding: the reference\n * addresses `steps.<id>.post_processing[0].<configKey>`.\n */\nexport interface ProcessingOperationRef {\n stepId: string;\n /** `steps.<id>.post_processing[0]` — the operation itself. */\n basePath: string;\n /** The raw list entry, for callers that must handle a non-map entry. */\n raw: unknown;\n /** The `if:` guard value when the entry carries one. */\n guard?: unknown;\n /**\n * Every non-guard key of the entry, as written. The reference refuses a map\n * with more than one such key at unmarshal time; this validator has no typed\n * unmarshal, so it carries them all and each rule decides what it can say.\n */\n entries: Array<readonly [string, unknown]>;\n /** Which handler will dispatch this operation — the dispatch set differs. */\n scope: ProcessingOperationScope;\n}\n\n/**\n * WHERE a processing operation is declared, because the dispatch set is not the\n * same in both places.\n *\n * `standard` is the top-level handler. `loopSubStep` is `executeLoopPostProcessing`,\n * which dispatches `loop.set` / `loop.break` ITSELF and falls through to the\n * standard handler for everything else — a strict superset. ⛔ The two are a\n * PARTITION and never a union: `loop.set` at the top level is an operation the\n * standard handler cannot dispatch, and saying otherwise would silently accept a\n * flow that fails at run time.\n */\nexport type ProcessingOperationScope = 'standard' | 'loopSubStep';\n\n/** The operation types dispatchable in a scope. */\nexport function dispatchableOperationTypes(scope: ProcessingOperationScope): ReadonlySet<string> {\n if (scope === 'standard') return PROCESSING_OPERATIONS.standardTypes;\n return new Set([\n ...PROCESSING_OPERATIONS.standardTypes,\n ...PROCESSING_OPERATIONS.loopSubStepTypes,\n ]);\n}\n\n/** Decompose both processing phases of one step, in declaration order. */\nexport function processingOperationsOfStep(\n stepId: string,\n step: StepDefinition,\n): ProcessingOperationRef[] {\n return decomposePhases(stepId, step as Record<string, unknown>, `steps.${stepId}`, 'standard');\n}\n\n/**\n * Decompose the processing operations of every sub-step of a `loop:` step.\n *\n * ⛔ The reference's `validateStepsInOrder` walks `flow.steps`, and a loop body\n * is a SECOND step table — so until v2.648.0 no template and no operation shape\n * inside a loop sub-step had been looked at by either implementation. This\n * validator inherited the same blind spot, recorded in PARITY.md as a scope note\n * rather than a divergence. DC-FORGE-78 closed it on both sides.\n *\n * Findings are attributed to the PARENT step id, because that is the id every\n * other surface knows this work by; the sub-step is named by its INDEX in the\n * field path, matching the reference's `steps.<id>.loop.steps[i]…`.\n */\nexport function loopSubStepProcessingOperations(\n stepId: string,\n step: StepDefinition,\n): ProcessingOperationRef[] {\n const refs: ProcessingOperationRef[] = [];\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n refs.push(...decomposePhases(stepId, sub.raw, sub.basePath, 'loopSubStep'));\n }\n return refs;\n}\n\n/** One sub-step of a `loop:` body, with the field path the reference addresses it by. */\nexport interface LoopSubStepRef {\n /** `steps.<parent>.loop.steps[i]` */\n basePath: string;\n raw: Record<string, unknown>;\n}\n\n/** Enumerate a loop step's sub-steps. Empty for a step with no `loop:` block. */\nexport function loopSubStepsOfStep(stepId: string, step: StepDefinition): LoopSubStepRef[] {\n const loop = (step as Record<string, unknown>).loop;\n if (!isRecord(loop)) return [];\n const subSteps = (loop as Record<string, unknown>).steps;\n if (!isArray(subSteps)) return [];\n const refs: LoopSubStepRef[] = [];\n subSteps.forEach((sub, i) => {\n if (!isRecord(sub)) return;\n refs.push({\n basePath: `steps.${stepId}.loop.steps[${i}]`,\n raw: sub as Record<string, unknown>,\n });\n });\n return refs;\n}\n\nfunction decomposePhases(\n stepId: string,\n container: Record<string, unknown>,\n pathPrefix: string,\n scope: ProcessingOperationScope,\n): ProcessingOperationRef[] {\n const refs: ProcessingOperationRef[] = [];\n for (const phase of PROCESSING_PHASES) {\n const ops = container[phase];\n if (!isArray(ops)) continue;\n ops.forEach((op, i) => {\n const basePath = `${pathPrefix}.${phase}[${i}]`;\n if (!isRecord(op)) {\n refs.push({ stepId, basePath, raw: op, entries: [], scope });\n return;\n }\n const ref: ProcessingOperationRef = { stepId, basePath, raw: op, entries: [], scope };\n for (const [key, value] of Object.entries(op)) {\n if (key === PROCESSING_OP_GUARD_KEY) {\n ref.guard = value;\n continue;\n }\n ref.entries.push([key, value] as const);\n }\n refs.push(ref);\n });\n }\n return refs;\n}\n\nfunction unknownOperationIssue(\n ref: ProcessingOperationRef,\n operationType: string,\n): Omit<ValidationIssue, 'severity'> {\n const known = [...dispatchableOperationTypes(ref.scope)].sort().join(', ');\n return {\n // The operation type is the YAML MAP KEY (`- data.set: {…}`), not a field.\n // Addressing a `.operation_type` here would send the author looking for\n // something the grammar does not have, so the finding points at the\n // operation itself.\n field: ref.basePath,\n message:\n `Processing operation type '${operationType}' is not dispatched by the engine; ` +\n 'at run time the step fails with \"unsupported operation type\" unless the ' +\n \"operation's `if:` guard is false\",\n code: 'unknown_processing_operation',\n stepId: ref.stepId,\n suggestion: `Operation types the engine dispatches here: ${known}`,\n };\n}\n\n/**\n * Warn about an operation type the standard handler cannot dispatch and about a\n * config key its handler never reads.\n *\n * Both scopes are walked (DC-FORGE-78): the top-level steps, where `loop.set` /\n * `loop.break` are correctly UNKNOWN because the standard handler has no case for\n * them, and every `loop:` body, where they are dispatchable. ⛔ Merging the two\n * sets would accept `loop.set` at the top level, which fails at run time.\n */\nexport function validateProcessingOperations(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepId, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n for (const ref of [\n ...processingOperationsOfStep(stepId, step),\n ...loopSubStepProcessingOperations(stepId, step),\n ]) {\n // The reference refuses an entry that is not a one-key map outright, at\n // unmarshal time. There is no operation to have an opinion about here, so\n // this rule says nothing and leaves the verdict to the structural pass.\n if (ref.entries.length !== 1) continue;\n const [operationType, config] = ref.entries[0] as readonly [string, unknown];\n\n if (!dispatchableOperationTypes(ref.scope).has(operationType)) {\n issues.warn(unknownOperationIssue(ref, operationType));\n // An unknown type has no key set, so every key under it would warn a\n // second time for the same one mistake. One verdict per defect.\n continue;\n }\n\n const [allowed, closed] = processingOperationConfigKeys(operationType);\n // Not closed: the author names the keys (`data.set` writes each one into\n // `.data`, and so on). There is no unknown key to find.\n if (!closed) continue;\n // The reference requires the config to be a mapping and fails to unmarshal\n // otherwise; a non-map config is not a key question.\n if (!isRecord(config)) continue;\n\n const permitted = new Set(allowed);\n const readable = [...allowed].sort().join(', ');\n // Sorted so one flow's verdicts keep a stable order between runs.\n for (const key of Object.keys(config).sort()) {\n if (permitted.has(key)) continue;\n issues.warn({\n field: `${ref.basePath}.${key}`,\n message:\n `Operation '${operationType}' does not read the config key '${key}', ` +\n 'so it is silently ignored at run time',\n code: 'unknown_processing_config_key',\n stepId: ref.stepId,\n suggestion: `'${operationType}' reads: ${readable}`,\n });\n }\n }\n }\n}\n","// Template syntax validation across a step's templated fields.\n//\n// Mirrors `validateTemplates` / `validateStepTemplates` / `countTemplates`\n// (validation.go): walk string leaves of `query`, `pre_processing`,\n// `post_processing`, and `next.conditions[].if`; anything containing `{{` is\n// run through the Go-template syntax checker. Runtime field-resolution\n// warnings (the reference's execution pass) are intentionally NOT reproduced —\n// see PARITY.md.\n\nimport type {\n Flow,\n NextCondition,\n NextLogicDefinition,\n StepDefinition,\n ValidateOptions,\n} from '../types.js';\nimport { TEMPLATE_FUNCTIONS, TEMPLATE_DEFAULT_PIPED } from '../spec/index.js';\nimport { checkGoTemplateSyntax } from '../template/gotmpl-syntax.js';\nimport { pipedDefaultPipelines } from '../template/gotmpl-default.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\nimport {\n PROCESSING_OP_GUARD_KEY,\n processingOperationsOfStep,\n loopSubStepProcessingOperations,\n loopSubStepsOfStep,\n type ProcessingOperationRef,\n type LoopSubStepRef,\n} from './processingOperations.js';\n\nfunction isTemplate(value: string): boolean {\n return value.includes('{{');\n}\n\n/** Counter threaded through the walk for the summary statistics. */\ninterface TemplateStats {\n found: number;\n syntaxErrors: number;\n}\n\nfunction checkTemplateString(\n value: string,\n field: string,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n demote = false,\n): void {\n if (!isTemplate(value)) return;\n stats.found += 1;\n const errors = checkGoTemplateSyntax(value, {\n knownFunctions: TEMPLATE_FUNCTIONS,\n // Always look up function names. PARITY.md divergence #4 promises a WARNING\n // for an unknown function by default and an error only under\n // strictRegistries; skipping the lookup entirely (as this did) said nothing\n // at all, while the reference refuses the flow.\n strictFunctions: true,\n });\n // DC-FORGE-78: a finding from inside a LOOP BODY is a warning, never an error.\n //\n // ⛔ The reference consults this validator at its RUN door\n // (FlowYAMLResolver.validateFlowWithQueryParams refuses the mission when the\n // result is invalid), over flows stored long before the loop body was walked\n // by anything. ⚠️ The \"the run already died anyway\" licence that would make an\n // Error safe requires the failing path to be UNCONDITIONAL, and inside a loop\n // body four of the six evaluation sites SWALLOW a template failure and carry\n // on with the raw string. So the walk warns, uniformly, and the CODE survives\n // the demotion — only the severity changes.\n const report = demote ? issues.warn.bind(issues) : issues.error.bind(issues);\n for (const err of errors) {\n if (err.isFunctionError) {\n const reportFunction = opts.strictRegistries === true ? report : issues.warn.bind(issues);\n reportFunction({\n field,\n message: `Template ${err.message}`,\n code: 'template_function_unknown',\n stepId: stepID,\n context: `Template: ${value}`,\n });\n } else {\n stats.syntaxErrors += 1;\n report({\n field,\n message: `Template syntax error: ${err.message}`,\n code: 'template_syntax_error',\n stepId: stepID,\n context: `Template: ${value}`,\n suggestion: 'Check Go template syntax: https://pkg.go.dev/text/template',\n });\n }\n }\n // The reference walks a parse tree, which exists only for a template that\n // parses: with any finding above there is nothing to walk, so say nothing.\n if (errors.length > 0) return;\n // A flow that RUNS with the wrong data is a save-time judgement: an error at\n // the top level, a warning in a loop body, exactly like the syntax error.\n for (const pipe of pipedDefaultPipelines(value)) {\n report({\n field,\n message: TEMPLATE_DEFAULT_PIPED.messageFormat.replace('%s', () => pipe),\n code: TEMPLATE_DEFAULT_PIPED.code,\n stepId: stepID,\n context: `Template: ${value}`,\n suggestion: TEMPLATE_DEFAULT_PIPED.suggestion,\n });\n }\n}\n\n/** Walk string leaves of an arbitrary value, mirroring walkObjectRecursive. */\nfunction walkStrings(\n basePath: string,\n value: unknown,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n check: boolean,\n demote = false,\n): void {\n if (isString(value)) {\n if (check) {\n checkTemplateString(value, basePath, stepID, issues, stats, opts, demote);\n } else if (isTemplate(value)) {\n stats.found += 1;\n }\n return;\n }\n if (isArray(value)) {\n value.forEach((item, i) => {\n walkStrings(`${basePath}[${i}]`, item, stepID, issues, stats, opts, check, demote);\n });\n return;\n }\n if (isRecord(value)) {\n for (const [key, v] of Object.entries(value)) {\n walkStrings(`${basePath}.${key}`, v, stepID, issues, stats, opts, check, demote);\n }\n }\n}\n\n/**\n * Walk one processing operation, producing the field paths the REFERENCE produces.\n *\n * A processing operation is written as a single-key map — `- data.set: { … }` —\n * plus an optional `if:` guard. Go's `ProcessingOperationDefinition` unmarshals\n * that key into `OperationType` and its body into an INLINE `Config`, so the\n * reference reports `…post_processing[0].<configKey>` and `…post_processing[0].if`.\n * Walking the raw record instead inserts the operation name as a path segment\n * (`…post_processing[0].data.set.<configKey>`), which is the same finding under a\n * different address.\n *\n * The decomposition itself lives in `processingOperations.ts` and is shared with\n * the operation-shape rules, so the guard key is recognised in exactly one place.\n */\nfunction walkProcessingOperation(\n ref: ProcessingOperationRef,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n): void {\n const demote = ref.scope === 'loopSubStep';\n if (!isRecord(ref.raw)) {\n walkStrings(ref.basePath, ref.raw, ref.stepId, issues, stats, opts, true, demote);\n return;\n }\n if (ref.guard !== undefined) {\n walkStrings(\n `${ref.basePath}.${PROCESSING_OP_GUARD_KEY}`,\n ref.guard,\n ref.stepId,\n issues,\n stats,\n opts,\n true,\n demote,\n );\n }\n for (const [, value] of ref.entries) {\n // The operation name is absorbed into OperationType; its body is inline.\n walkStrings(ref.basePath, value, ref.stepId, issues, stats, opts, true, demote);\n }\n}\n\n/**\n * Walk one loop sub-step's own templates — `condition:`, `query:` and\n * `next.conditions[].if`. Its processing operations come through\n * walkProcessingOperation like any other, because the decomposition is shared.\n *\n * ⛔ None of this was reachable before DC-FORGE-78: the walk below iterates\n * `flow.steps`, and a loop body is a second step table.\n */\nfunction walkLoopSubStep(\n sub: LoopSubStepRef,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n): void {\n const condition = sub.raw.condition;\n if (isString(condition) && condition !== '') {\n checkTemplateString(condition, `${sub.basePath}.condition`, stepID, issues, stats, opts, true);\n }\n if (sub.raw.query !== undefined) {\n walkStrings(`${sub.basePath}.query`, sub.raw.query, stepID, issues, stats, opts, true, true);\n }\n const next = sub.raw.next;\n if (isRecord(next) && isArray((next as NextLogicDefinition).conditions)) {\n (next as NextLogicDefinition).conditions!.forEach(\n (cond: NextCondition | unknown, i: number) => {\n if (!isRecord(cond)) return;\n const ifExpr = (cond as NextCondition).if;\n if (isString(ifExpr) && ifExpr !== '') {\n stats.found += 1;\n checkTemplateString(\n ifExpr,\n `${sub.basePath}.next.conditions[${i}].if`,\n stepID,\n issues,\n stats,\n opts,\n true,\n );\n }\n },\n );\n }\n}\n\nexport function validateTemplates(\n flow: Flow,\n issues: Issues,\n opts: ValidateOptions,\n): TemplateStats {\n const stats: TemplateStats = { found: 0, syntaxErrors: 0 };\n const steps = flow.steps;\n if (!isRecord(steps)) return stats;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n if (step.query !== undefined) {\n walkStrings(`steps.${stepID}.query`, step.query, stepID, issues, stats, opts, true);\n }\n for (const ref of processingOperationsOfStep(stepID, step)) {\n walkProcessingOperation(ref, issues, stats, opts);\n }\n for (const sub of loopSubStepsOfStep(stepID, step)) {\n walkLoopSubStep(sub, stepID, issues, stats, opts);\n }\n for (const ref of loopSubStepProcessingOperations(stepID, step)) {\n walkProcessingOperation(ref, issues, stats, opts);\n }\n // response_expectation templates are counted (matching countTemplates) but\n // not syntax-checked (matching validateStepTemplates).\n if (step.response_expectation !== undefined) {\n walkStrings(\n `steps.${stepID}.response_expectation`,\n step.response_expectation,\n stepID,\n issues,\n stats,\n opts,\n false,\n );\n }\n // next.conditions[].if expressions are syntax-checked (not counted).\n const next = step.next;\n if (isRecord(next) && isArray((next as NextLogicDefinition).conditions)) {\n (next as NextLogicDefinition).conditions!.forEach(\n (cond: NextCondition | unknown, i: number) => {\n if (!isRecord(cond)) return;\n const ifExpr = (cond as NextCondition).if;\n if (isString(ifExpr) && ifExpr !== '') {\n // Conditions are counted toward found so a syntax error there does\n // not push templatesValid above templatesFound.\n stats.found += 1;\n checkTemplateString(\n ifExpr,\n `steps.${stepID}.next.conditions[${i}].if`,\n stepID,\n issues,\n stats,\n opts,\n );\n }\n },\n );\n }\n }\n\n return stats;\n}\n","// A step `max_duration:` the reference's engine cannot turn into a deadline.\n//\n// Mirrors `validateStepMaxDurationIsApplied` (validation.go, AIF DC-FORGE-147).\n// The reference bounds each executor invocation of a step by its\n// `max_duration`. Two declarations fall outside that, and both are WARNINGS:\n//\n// - a value that does not parse as a Go duration. The engine runs the step\n// with no time limit rather than fail a stored flow at its run door.\n// - a value on a `loop:` step, which makes no executor call of its own.\n//\n// Loop sub-steps have no `max_duration` field in the reference, so there is no\n// second step table to walk.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, parseGoDuration } from './util.js';\n\nconst CODE_STEP_MAX_DURATION_IGNORED = 'step_max_duration_ignored';\nconst FIELD_MAX_DURATION = 'max_duration';\n\n/** The reference's no-bound spellings (shared with its async/HITL park expiry). */\nconst NO_BOUND_SPELLINGS: ReadonlySet<string> = new Set(['none', 'never', 'infinite']);\n\n/** Go's `%q` for the strings this rule quotes — see unreadLimits' note on non-ASCII. */\nfunction goQuote(s: string): string {\n return JSON.stringify(s);\n}\n\n/**\n * The reference's `parseStepMaxDuration`: true when the value is a no-bound\n * spelling or a Go `time.ParseDuration` string. \"0s\" and negative values parse\n * (the engine treats them as no bound), so they do not warn.\n */\nexport function isApplicableStepMaxDuration(raw: string): boolean {\n return NO_BOUND_SPELLINGS.has(raw) || parseGoDuration(raw) !== null;\n}\n\nexport function validateStepMaxDuration(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n // A Go `string`, filled from any scalar by its source text: `max_duration:\n // 90` arrives as \"90\", which then fails to parse.\n const declared = issues.stringOf(rawStep, FIELD_MAX_DURATION, `steps.${stepID}`);\n if (declared === null || declared === '') continue;\n const field = `steps.${stepID}.${FIELD_MAX_DURATION}`;\n if (!isApplicableStepMaxDuration(declared)) {\n issues.warn({\n field,\n message: `max_duration ${goQuote(declared)} on step ${goQuote(stepID)} is not a duration, so the step runs with no time limit. Use a Go duration such as \"90s\", \"5m\" or \"2h\" (there is no day unit: write \"48h\", not \"2d\"; templates are not rendered here), or \"none\" for no limit.`,\n code: CODE_STEP_MAX_DURATION_IGNORED,\n });\n continue;\n }\n if (isRecord(rawStep.loop)) {\n issues.warn({\n field,\n message: `max_duration ${goQuote(declared)} on loop step ${goQuote(stepID)} bounds nothing: a loop step makes no executor call of its own, and loop sub-steps have no max_duration key. Bound the loop with loop.max_iterations, or remove max_duration.`,\n code: CODE_STEP_MAX_DURATION_IGNORED,\n });\n }\n }\n}\n","// Grammar keys AIgentFlow deleted because nothing read them (AIF DC-FORGE-150,\n// v2.721.0): the top-level `budget:`, the top-level `max_retries:`, and a\n// `max_retries:` directly on a step. Plus `campaign.budget_max_per_child`\n// (AIF DC-FORGE-155, v2.728.0).\n//\n// The reference's save door (create / update / `POST /flows/validate`) parses\n// with yaml `KnownFields(true)`, so a flow declaring any of them is REFUSED, and\n// its `retiredGrammarKeys` table (parser.go) attaches migration advice to the\n// refusal. Stored flows still load leniently and run. This validator answers\n// \"would this save\", so each is an ERROR here — reported with the same code as\n// the other key the reference refuses specifically, `unknown_yaml_key`\n// (connectivity.ts, `next.conditions[].goto_step`).\n//\n// The working keys one level DOWN must never be reported: `error_strategy.\n// max_retries` (flow and step level) and `quality_gate.max_retries` are live\n// grammar, and `billing.max_credits` is the enforced spend ceiling.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE_UNKNOWN_YAML_KEY = 'unknown_yaml_key';\nconst KEY_BUDGET = 'budget';\nconst KEY_MAX_RETRIES = 'max_retries';\nconst REMOVED_IN = 'v2.721.0';\nconst KEY_BUDGET_MAX_PER_CHILD = 'budget_max_per_child';\nconst BUDGET_MAX_PER_CHILD_REMOVED_IN = 'v2.728.0';\n\nconst BUDGET_MAX_PER_CHILD_MESSAGE =\n `\\`campaign.budget_max_per_child\\` (USD) was removed from the grammar in AIgentFlow ` +\n `${BUDGET_MAX_PER_CHILD_REMOVED_IN} because it capped nothing, and AIgentFlow refuses to ` +\n 'save a flow that declares it.';\nconst BUDGET_MAX_PER_CHILD_SUGGESTION =\n 'Use `campaign.max_credits_per_child: N` (a whole number of credits) — it is checked ' +\n 'before each agentic turn of a child, and a spawn may lower it with `max_credits`.';\n\nconst BUDGET_MESSAGE =\n `The flow-level \\`budget:\\` key was removed from the grammar in AIgentFlow ${REMOVED_IN} ` +\n 'because nothing read it (it limited no spend), and AIgentFlow refuses to save a flow ' +\n 'that declares it.';\nconst BUDGET_SUGGESTION =\n 'Delete it. To cap spend use `billing: { max_credits: N }` — it caps the credit ' +\n 'reservation and refuses further agentic turns (agentic ai://, exons://, the ' +\n 'orchestrator); plain chat steps and flow:// sub-flows are not checked against it.';\n\nfunction maxRetriesMessage(owner: string): string {\n return (\n `\\`max_retries:\\` on ${owner} was removed from the grammar in AIgentFlow ${REMOVED_IN} ` +\n 'because the retry engine never read it, and AIgentFlow refuses to save a flow that ' +\n 'declares it.'\n );\n}\nconst MAX_RETRIES_SUGGESTION =\n 'Delete it. To retry a step write `error_strategy: { action: \"retry\", max_retries: N }` ' +\n 'on that step (or on the flow) — the same key one level down, which is the one that ' +\n 'works (N counts attempts, including the first).';\n\n/** Key PRESENCE, not value: the strict decoder refuses the key whatever it holds, `0` and `null` included. */\nfunction declares(record: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(record, key);\n}\n\nexport function validateRetiredKeys(flow: Flow, issues: Issues): void {\n const root = flow as Record<string, unknown>;\n\n if (declares(root, KEY_BUDGET)) {\n issues.error({\n field: KEY_BUDGET,\n message: BUDGET_MESSAGE,\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: BUDGET_SUGGESTION,\n });\n }\n\n if (declares(root, KEY_MAX_RETRIES)) {\n issues.error({\n field: KEY_MAX_RETRIES,\n message: maxRetriesMessage('the flow'),\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n }\n\n // AIF v2.728.0 (DC-FORGE-155): the campaign's per-child USD cap, replaced by\n // `max_credits_per_child`. Same mechanism as the keys above: the strict\n // decoder refuses it and `retiredGrammarKeys` attaches the advice.\n const campaign = root.campaign;\n if (isRecord(campaign) && declares(campaign, KEY_BUDGET_MAX_PER_CHILD)) {\n issues.error({\n field: `campaign.${KEY_BUDGET_MAX_PER_CHILD}`,\n message: BUDGET_MAX_PER_CHILD_MESSAGE,\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: BUDGET_MAX_PER_CHILD_SUGGESTION,\n });\n }\n\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n if (declares(rawStep, KEY_MAX_RETRIES)) {\n issues.error({\n field: `steps.${stepID}.${KEY_MAX_RETRIES}`,\n message: maxRetriesMessage(`step '${stepID}'`),\n code: CODE_UNKNOWN_YAML_KEY,\n stepId: stepID,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n }\n\n // A loop sub-step's type in the reference never had a `max_retries` field,\n // so the strict decoder refuses it there too — and the reference's advice\n // table matches the key name, not the type, so it attaches this same\n // advice. Reported for \"would this save\" parity (see PARITY.md).\n const loop = rawStep.loop;\n if (!isRecord(loop) || !Array.isArray(loop.steps)) continue;\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub) || !declares(sub, KEY_MAX_RETRIES)) return;\n const subID = issues.stringOf(sub, 'id', `steps.${stepID}.loop.steps[${i}]`) ?? String(i);\n issues.error({\n field: `steps.${stepID}.loop.steps[${i}].${KEY_MAX_RETRIES}`,\n message: maxRetriesMessage(`loop sub-step '${stepID}.${subID}'`),\n code: CODE_UNKNOWN_YAML_KEY,\n stepId: `${stepID}.${subID}`,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n });\n }\n}\n","// `flow_data_key_reserved`: a key of the top-level `data:` map may not name\n// engine state.\n//\n// Port of the reference's `FlowDataKeyReservation` /\n// `validateFlowDataKeysAreNotReserved`. `data:` is seeded into the mission's\n// `.data` namespace before the first step, and that namespace is also where the\n// engine keeps its own bookkeeping (the current flow, taint lists, the\n// orchestrator's and campaign's state, the memory scope, the mission's\n// organization). A flow declaring one of those names writes into engine state\n// instead of authoring data, so the save door refuses it. ERROR, with no loop\n// demotion: a `data:` block has no loop-body twin.\n//\n// Matching is exact and case-sensitive over the spec (`flowDataReservedKeys`):\n// the `exact` names, then the `prefixes` in order. Keys that merely contain a\n// reserved word (`memory_notes`, `orgid`) are legal. Findings are sorted by key.\n// The reference's run door tolerates this code on stored flows; this validator\n// answers \"would this save\", so it is an ordinary error here.\n\nimport type { Flow } from '../types.js';\nimport { FLOW_DATA_RESERVED_KEYS } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst KEY_DATA = 'data';\n\n/** Go's `%q` for a plain string: double-quoted with the escapes JSON shares. */\nfunction quote(key: string): string {\n return JSON.stringify(key);\n}\n\n/** Why `key` names engine state, or undefined when it is an author's key. */\nexport function flowDataKeyReservation(key: string): string | undefined {\n if (Object.prototype.hasOwnProperty.call(FLOW_DATA_RESERVED_KEYS.exact, key)) {\n return FLOW_DATA_RESERVED_KEYS.exact[key];\n }\n for (const p of FLOW_DATA_RESERVED_KEYS.prefixes) {\n if (key.startsWith(p.prefix)) return p.reason;\n }\n return undefined;\n}\n\nexport function validateFlowDataKeys(flow: Flow, issues: Issues): void {\n const data = flow[KEY_DATA];\n if (!isRecord(data)) return;\n for (const key of Object.keys(data).sort()) {\n const reason = flowDataKeyReservation(key);\n if (reason === undefined) continue;\n issues.error({\n field: FLOW_DATA_RESERVED_KEYS.fieldFormat.replace('%s', () => key),\n message: FLOW_DATA_RESERVED_KEYS.messageFormat\n .replace('%s', () => quote(key))\n .replace('%s', () => reason),\n code: FLOW_DATA_RESERVED_KEYS.code,\n suggestion: FLOW_DATA_RESERVED_KEYS.suggestion,\n });\n }\n}\n","// Three save-door refusals from `FlowParser.ValidateFlow` (parser.go) that are\n// pure functions of the document: the `tool_discovery` vocabulary, the mock\n// scenario `delay`, and an empty `output:` entry.\n//\n// Every one is an ERROR, because the reference refuses the flow at save. Two of\n// them (tool_discovery, mock delay) are routed through the reference's\n// `refuseRetroactively`, so a flow stored before the rule existed is only\n// logged at the load door and still runs. This validator answers \"would this\n// save\", so it reports them as errors — the same choice as the executor-URL\n// shape rule (PARITY.md, divergence #10).\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, isString, parseGoDuration } from './util.js';\n\n/** The closed `tool_discovery` vocabulary (reference: IsValidDiscoveryMode). */\nconst TOOL_DISCOVERY_MODES: ReadonlySet<string> = new Set(['eager', 'lazy', 'off']);\nconst TEMPLATE_ACTION_OPEN = '{{';\nconst KEY_TOOL_DISCOVERY = 'tool_discovery';\n\nexport function validateSaveDoorExtras(flow: Flow, issues: Issues): void {\n validateToolDiscovery(flow, issues);\n validateMockScenarioDelays(flow, issues);\n validateOutputParameters(flow, issues);\n}\n\n// validateToolDiscovery mirrors validateToolDiscoveryVocabulary (AIF\n// DC-FORGE-48). The value decides TOOL EXPOSURE, and every consuming switch\n// treats an unknown value as `eager` — so `tool_discovery: of`, a typo for\n// `off`, injected every tool. An empty value means \"unset\" and a templated one\n// is rendered at run time; both are skipped.\n//\n// The flow root and the orchestrator carry a Go `string` field, which yaml.v3\n// fills from ANY scalar: `tool_discovery: 5` is the string \"5\" and is refused.\n// On a step the surface is a free-form `query` key, so only a YAML string is\n// judged there — a number or boolean is left to the executor.\nfunction validateToolDiscovery(flow: Flow, issues: Issues): void {\n const check = (value: string | null, field: string, stepId?: string): void => {\n if (value === null || value === '' || value.includes(TEMPLATE_ACTION_OPEN)) return;\n if (TOOL_DISCOVERY_MODES.has(value)) return;\n issues.error({\n field,\n message: `tool_discovery '${value}' is not a recognised mode`,\n code: 'tool_discovery_invalid',\n ...(stepId !== undefined ? { stepId } : {}),\n suggestion: `Use one of: ${[...TOOL_DISCOVERY_MODES].join(', ')}, or omit the key`,\n });\n };\n\n if (KEY_TOOL_DISCOVERY in flow) {\n check(issues.stringOf(flow, KEY_TOOL_DISCOVERY, ''), KEY_TOOL_DISCOVERY);\n }\n const orch: unknown = flow.orchestrator;\n if (isRecord(orch) && KEY_TOOL_DISCOVERY in orch) {\n check(\n issues.stringOf(orch, KEY_TOOL_DISCOVERY, 'orchestrator'),\n `orchestrator.${KEY_TOOL_DISCOVERY}`,\n );\n }\n if (!isRecord(flow.steps)) return;\n for (const [stepID, step] of Object.entries(flow.steps as Record<string, unknown>)) {\n if (!isRecord(step) || !isRecord(step.query)) continue;\n const value: unknown = step.query[KEY_TOOL_DISCOVERY];\n if (!isString(value)) continue;\n check(value, `steps.${stepID}.query.${KEY_TOOL_DISCOVERY}`, stepID);\n }\n}\n\n// validateMockScenarioDelays mirrors the reference rule of the same name (AIF\n// DC-FORGE-51). yaml.v3 decodes `delay: 100` into the string \"100\", which has\n// no unit; the live call site discarded the parse error and ran with NO delay.\n// The reference refuses anything `time.ParseDuration` rejects rather than\n// guessing a unit, so `100` is refused and `100ms` saves.\n//\n// Every scenario and every step key is checked, including a step id the flow\n// does not define — the reference walks the map, not the step table.\nfunction validateMockScenarioDelays(flow: Flow, issues: Issues): void {\n const scenarios: unknown = flow.mock_scenarios;\n if (!isRecord(scenarios)) return;\n for (const [scenario, steps] of Object.entries(scenarios)) {\n if (!isRecord(steps)) continue;\n for (const [stepID, mock] of Object.entries(steps)) {\n if (!isRecord(mock)) continue;\n const field = `mock_scenarios.${scenario}.${stepID}.delay`;\n // Judged by the SOURCE spelling: `delay: 0.0` is the text \"0.0\" to the\n // reference (no unit, refused) although it parses to the number 0.\n const delay = issues.stringAt(mock.delay, field);\n if (delay === null || delay === '') continue;\n if (parseGoDuration(delay) !== null) continue;\n issues.error({\n field,\n message: `mock delay '${delay}' in scenario '${scenario}' step '${stepID}' is not a Go duration`,\n code: 'mock_delay_invalid',\n suggestion: 'Write a unit, e.g. \"100ms\" or \"2s\"; a bare number would run with no delay',\n });\n }\n }\n}\n\n// validateOutputParameters mirrors the reference rule of the same name. Only\n// an empty STRING is refused: a YAML null entry (`- ` or `- ~`) is dropped by\n// yaml.v3 when it decodes the list, so it never reaches the check and the flow\n// saves (measured against the reference).\nfunction validateOutputParameters(flow: Flow, issues: Issues): void {\n const output: unknown = flow.output;\n if (!Array.isArray(output)) return;\n output.forEach((entry: unknown, i: number) => {\n if (entry !== '') return;\n issues.error({\n field: `output[${i}]`,\n message: `output entry ${i} is an empty string`,\n code: 'output_param_empty',\n suggestion: 'Name the output parameter, or remove the entry',\n });\n });\n}\n","// Generic unknown-key rejection and value-KIND checks, derived from the\n// reference's own types.\n//\n// The reference's save door (create / update / `POST /flows/validate` / the\n// Studio assistant) decodes a flow with yaml.v3 `KnownFields(true)`\n// (`NewStrictFlowParser`, parser.go). That refuses, at EVERY depth, a key that\n// the containing Go struct does not declare — a step-level `output:`, a typo\n// such as `excutor:`, an unknown key inside `next:`, `error_strategy:`, a mock\n// scenario step, a query parameter definition, an orchestrator trigger. It also\n// fails to decode a value of the wrong KIND: `next: end` (a scalar where a\n// mapping is required), a mapping where a string is required, a mapping where a\n// list is required. Both are \"would not save\", so both are errors here.\n//\n// The key sets are NOT hand-listed. `KNOWN_KEYS` is generated by reflection over\n// the reference's `Flow` type with yaml.v3's own field rules, and was checked\n// against the reference's strict parser for every type and every key (PARITY.md).\n//\n// What stays open, because the reference leaves it open: a Go `map` has\n// author-chosen keys (`steps`, `query` definitions, `mock_scenarios`,\n// `executor_config`), a Go interface (`any`) is never inspected (a step's\n// `query:`, `data:`, a mock's `content:`), and a pre/post-processing entry has\n// its own unmarshaller (divergence #11 keeps its shape out of scope).\n//\n// Scalars are judged only for KIND (not mapping, not list). Whether `5` fits an\n// int field or `abc` a bool is left to the rules that already own those fields\n// (divergence #8).\n\nimport type { Flow } from '../types.js';\nimport { KNOWN_KEYS } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE_UNKNOWN_YAML_KEY = 'unknown_yaml_key';\nconst CODE_INVALID_TYPE = 'invalid_type';\n\nconst SHAPE_SCALAR = 'scalar';\nconst SHAPE_ANY = 'any';\nconst MAP_PREFIX = 'map<';\nconst LIST_PREFIX = 'list<';\nconst SHAPE_SUFFIX = '>';\n\n/**\n * Keys the reference DELETED from the grammar (`retiredGrammarKeys`, parser.go).\n * Its refusal names them wherever they appear, because the advice table matches\n * the key NAME in the decoder's error, not the type. The specific locations with\n * full advice are reported by retiredKeys.ts; this only keeps the generic\n * message from calling a once-valid key a typo.\n */\nconst RETIRED_KEYS: ReadonlySet<string> = new Set([\n 'budget',\n 'budget_exceeded_policy',\n 'budget_max_per_child',\n 'binary_results',\n 'conversations',\n 'max_retries',\n 'message_templates',\n 'unique_items',\n]);\n\ntype Shape =\n | { kind: 'scalar' }\n | { kind: 'any' }\n | { kind: 'struct'; name: string }\n | { kind: 'map'; elem: Shape }\n | { kind: 'list'; elem: Shape };\n\nconst shapeCache = new Map<string, Shape>();\n\nfunction parseShape(text: string): Shape {\n const cached = shapeCache.get(text);\n if (cached) return cached;\n let shape: Shape;\n if (text === SHAPE_SCALAR) shape = { kind: 'scalar' };\n else if (text === SHAPE_ANY) shape = { kind: 'any' };\n else if (text.startsWith(MAP_PREFIX) && text.endsWith(SHAPE_SUFFIX)) {\n shape = { kind: 'map', elem: parseShape(text.slice(MAP_PREFIX.length, -1)) };\n } else if (text.startsWith(LIST_PREFIX) && text.endsWith(SHAPE_SUFFIX)) {\n shape = { kind: 'list', elem: parseShape(text.slice(LIST_PREFIX.length, -1)) };\n } else if (Object.prototype.hasOwnProperty.call(KNOWN_KEYS.types, text)) {\n shape = { kind: 'struct', name: text };\n } else {\n // A spec defect, not a document defect: fail open rather than accuse every\n // flow. The spec test asserts every shape resolves, so this is unreachable\n // from a shipped build.\n shape = { kind: 'any' };\n }\n shapeCache.set(text, shape);\n return shape;\n}\n\nfunction child(path: string, key: string): string {\n return path === '' ? key : `${path}.${key}`;\n}\n\n/** The step id a finding under `steps.<id>` belongs to, for the summary count. */\nfunction stepIdOf(path: string): string | undefined {\n if (!path.startsWith('steps.')) return undefined;\n const rest = path.slice('steps.'.length);\n const end = rest.search(/[.[]/);\n return end === -1 ? rest : rest.slice(0, end);\n}\n\nfunction kindName(value: unknown): string {\n if (Array.isArray(value)) return 'a list';\n if (isRecord(value)) return 'a mapping';\n return 'a scalar';\n}\n\nexport function validateUnknownKeys(flow: Flow, issues: Issues): void {\n // Locations another rule already reported (with more specific advice) are not\n // reported twice: the retired keys and a condition's `goto_step`.\n const reported = new Set(\n issues.errors\n .filter((e) => e.code === CODE_UNKNOWN_YAML_KEY || e.code === CODE_INVALID_TYPE)\n .map((e) => `${e.code}\\u0000${e.field}`),\n );\n\n const report = (code: string, field: string, message: string, suggestion?: string): void => {\n const id = `${code}\\u0000${field}`;\n if (reported.has(id)) return;\n reported.add(id);\n const stepId = stepIdOf(field);\n issues.error({\n field,\n message,\n code,\n ...(stepId !== undefined ? { stepId } : {}),\n ...(suggestion !== undefined ? { suggestion } : {}),\n });\n };\n\n const walk = (value: unknown, shape: Shape, path: string): void => {\n // A YAML null decodes to the zero value of any Go type.\n if (value === null || value === undefined) return;\n\n switch (shape.kind) {\n case 'any':\n return;\n case 'scalar':\n if (isRecord(value) || Array.isArray(value)) {\n report(\n CODE_INVALID_TYPE,\n path,\n `'${path}' must be a single value, not ${kindName(value)}`,\n );\n }\n return;\n case 'list':\n if (!Array.isArray(value)) {\n report(CODE_INVALID_TYPE, path, `'${path}' must be a list, not ${kindName(value)}`);\n return;\n }\n value.forEach((item: unknown, i: number) => walk(item, shape.elem, `${path}[${i}]`));\n return;\n case 'map':\n if (!isRecord(value)) {\n report(CODE_INVALID_TYPE, path, `'${path}' must be a mapping, not ${kindName(value)}`);\n return;\n }\n for (const [key, item] of Object.entries(value)) walk(item, shape.elem, child(path, key));\n return;\n case 'struct': {\n if (!isRecord(value)) {\n report(\n CODE_INVALID_TYPE,\n path,\n `'${path === '' ? 'the flow' : path}' must be a mapping, not ${kindName(value)}`,\n );\n return;\n }\n const keys = KNOWN_KEYS.types[shape.name] ?? {};\n for (const [key, item] of Object.entries(value)) {\n const field = child(path, key);\n const declared = keys[key];\n if (declared === undefined) {\n const retired = RETIRED_KEYS.has(key)\n ? ' It was removed from the grammar and AIgentFlow refuses to save a flow that still declares it.'\n : '';\n report(\n CODE_UNKNOWN_YAML_KEY,\n field,\n `Unknown key '${key}'${path === '' ? ' at the top level' : ` in '${path}'`}.` +\n ` AIgentFlow refuses to save a flow with a key its grammar does not declare, because the key would be silently dropped.${retired}`,\n `Known keys here: ${Object.keys(keys).sort().join(', ')}`,\n );\n continue;\n }\n walk(item, parseShape(declared), field);\n }\n return;\n }\n }\n };\n\n walk(flow, { kind: 'struct', name: KNOWN_KEYS.root }, '');\n}\n\n/** Every shape string in the spec, for the spec self-test. */\nexport function unresolvedKnownKeyShapes(): string[] {\n const bad: string[] = [];\n const check = (text: string): boolean => {\n if (text === SHAPE_SCALAR || text === SHAPE_ANY) return true;\n if (text.startsWith(MAP_PREFIX) && text.endsWith(SHAPE_SUFFIX))\n return check(text.slice(MAP_PREFIX.length, -1));\n if (text.startsWith(LIST_PREFIX) && text.endsWith(SHAPE_SUFFIX))\n return check(text.slice(LIST_PREFIX.length, -1));\n return Object.prototype.hasOwnProperty.call(KNOWN_KEYS.types, text);\n };\n if (!check(KNOWN_KEYS.root)) bad.push(KNOWN_KEYS.root);\n for (const [typeName, keys] of Object.entries(KNOWN_KEYS.types)) {\n for (const [key, text] of Object.entries(keys)) {\n if (!check(text)) bad.push(`${typeName}.${key}: ${text}`);\n }\n }\n return bad;\n}\n","// `executor_config_env_scope`: an `executor_config:` value may name only the\n// environment variables of the key it is written under.\n//\n// Port of the reference's `ValidateExecutorConfigEnvScopes` (AIgentFlow\n// v2.597.0), which the save door applies to the whole block. `executor_config`\n// is author-written, so without it an author could point `base_url` at their\n// own endpoint and have the server expand a secret that belongs to another\n// provider into `api_key`.\n//\n// The checked values are the three Go-`string` fields (`api_key`, `base_url`,\n// `organization`), read by SOURCE TEXT like every string field, and every YAML\n// STRING in `extra` (the reference type-asserts `.(string)` on an `any`, so a\n// number there is never a reference). A value is a reference when it is exactly\n// `${NAME}` with NAME non-empty; `${A}${B}` is the single name `A}${B` and is\n// refused unless a scope names it, as in the reference.\n//\n// The scopes are the reference's scope function evaluated for every key that\n// has one (spec `executorConfigEnvScopes.scopes`). Any other key has an EMPTY\n// scope and refuses every reference: the reference reads those values raw, so a\n// `${...}` there would be sent verbatim as a credential.\n//\n// The reference stops at the first violation (a parse-door refusal); this\n// validator reports each one. The verdict is the same.\n\nimport type { Flow } from '../types.js';\nimport { EXECUTOR_CONFIG_ENV_SCOPES } from '../spec/index.js';\nimport { Issues, isRecord, isString } from './util.js';\n\nconst KEY_EXECUTOR_CONFIG = 'executor_config';\nconst CODE = 'executor_config_env_scope';\nconst NO_SCOPE: readonly string[] = [];\n\nexport function validateExecutorConfigEnvScopes(flow: Flow, issues: Issues): void {\n const config: unknown = flow[KEY_EXECUTOR_CONFIG];\n if (!isRecord(config)) return;\n const { fields, extraKey, scopes } = EXECUTOR_CONFIG_ENV_SCOPES;\n\n for (const configKey of Object.keys(config).sort()) {\n const instance = config[configKey];\n // null is skipped by the reference; any other non-mapping is an\n // `invalid_type` from the unknown-keys rule.\n if (!isRecord(instance)) continue;\n const base = `${KEY_EXECUTOR_CONFIG}.${configKey}`;\n // Own properties only: `constructor` or `toString` is an ordinary key with\n // an empty scope, not a lookup into Object.prototype.\n const scope = Object.prototype.hasOwnProperty.call(scopes, configKey)\n ? (scopes[configKey] ?? NO_SCOPE)\n : NO_SCOPE;\n\n for (const field of fields) {\n const value = issues.stringOf(instance, field, base);\n if (value === null) continue;\n checkReference(issues, `${base}.${field}`, configKey, field, value, scope);\n }\n const extra = instance[extraKey];\n if (!isRecord(extra)) continue;\n for (const extraName of Object.keys(extra).sort()) {\n const value = extra[extraName];\n if (!isString(value)) continue;\n checkReference(\n issues,\n `${base}.${extraKey}.${extraName}`,\n configKey,\n `${extraKey}.${extraName}`,\n value,\n scope,\n );\n }\n }\n}\n\nfunction checkReference(\n issues: Issues,\n field: string,\n configKey: string,\n fieldName: string,\n value: string,\n scope: readonly string[],\n): void {\n const name = envReferenceName(value);\n if (name === null || scope.includes(name)) return;\n const permitted =\n scope.length > 0 ? scope.join(', ') : '(none: this key expands no environment variables)';\n issues.error({\n field,\n code: CODE,\n message:\n `executor_config key '${configKey}' sets ${fieldName} to environment variable '${name}', ` +\n 'which it may not expand; a flow may only expand the variables belonging to the provider ' +\n `or protocol it writes them under. Permitted here: ${permitted}`,\n suggestion:\n 'To use an organisation secret, bind a stored credential on the step instead: ' +\n 'credentials: {<name>: {source: \"stored/<provider>/<credential>\", inject_as: \"api_key\"}}',\n });\n}\n\n/** The reference's isAuthorEnvReference: exactly `${NAME}`, NAME non-empty. */\nexport function envReferenceName(value: string): string | null {\n const { referencePrefix: prefix, referenceSuffix: suffix } = EXECUTOR_CONFIG_ENV_SCOPES;\n if (\n value.length < prefix.length + suffix.length ||\n !value.startsWith(prefix) ||\n !value.endsWith(suffix)\n ) {\n return null;\n }\n const name = value.slice(prefix.length, value.length - suffix.length);\n return name === '' ? null : name;\n}\n","// `server_owned_query_key`: a step's `query:`, or a loop sub-step's `query:`,\n// may not declare an executor parameter only the server sets.\n//\n// Port of the reference's `validateNoServerOwnedStepQueryKeys` /\n// `IsServerOwnedParamKey` (AIgentFlow CFX-05). The `aiv://` executor sends the\n// running org's aigentverse credential, or a signed token naming the running\n// person, to the base URL in its parameters, and the reference used to lay a\n// step's query over the credential resolver's output — so a shared flow\n// declaring `aiv_base_url: https://attacker.example` chose where that\n// credential went. The engine now discards such a value at run time; this is\n// the named refusal at save. ERROR: no legitimate flow sets these keys.\n//\n// Matching is exact and case-sensitive, over the key set in the spec\n// (`serverOwnedQueryKeys.keys`). Exactly the reference's two surfaces are\n// scanned: a top-level step's `query:` and a loop sub-step's `query:`. A\n// parallel branch or a for_each body is a top-level step. Any value is refused,\n// null and templates included.\n//\n// A loop sub-step is addressed by its id as written (source text, like every\n// Go-string field). A sub-step without an id is addressed by the empty string,\n// the reference's format with its zero value; the reference itself refuses the\n// missing id at parse (`loop_step_id_required` here), so the verdict is the same.\n\nimport type { Flow } from '../types.js';\nimport { SERVER_OWNED_QUERY_KEYS } from '../spec/index.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE = 'server_owned_query_key';\nconst KEY_QUERY = 'query';\nconst KEY_ID = 'id';\nconst SERVER_OWNED: ReadonlySet<string> = new Set(SERVER_OWNED_QUERY_KEYS.keys);\n\n/** Go's `fmt.Sprintf` for the `%s`-only field formats in the spec. */\nfunction formatField(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%s/g, () => args[i++] ?? '');\n}\n\nexport function validateServerOwnedQueryKeys(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const stepID of Object.keys(steps).sort()) {\n const step = steps[stepID];\n if (!isRecord(step)) continue;\n const query = (step as Record<string, unknown>)[KEY_QUERY];\n if (isRecord(query)) {\n for (const key of Object.keys(query).sort()) {\n if (!SERVER_OWNED.has(key)) continue;\n refuse(\n issues,\n stepID,\n key,\n formatField(SERVER_OWNED_QUERY_KEYS.stepFieldFormat, stepID, key),\n );\n }\n }\n for (const sub of loopSubStepsOfStep(stepID, step)) {\n const subQuery = sub.raw[KEY_QUERY];\n if (!isRecord(subQuery)) continue;\n const subID = issues.stringOf(sub.raw, KEY_ID, sub.basePath) ?? '';\n for (const key of Object.keys(subQuery).sort()) {\n if (!SERVER_OWNED.has(key)) continue;\n refuse(\n issues,\n stepID,\n key,\n formatField(SERVER_OWNED_QUERY_KEYS.loopStepFieldFormat, stepID, subID, key),\n );\n }\n }\n }\n}\n\nfunction refuse(issues: Issues, stepId: string, key: string, field: string): void {\n issues.error({\n field,\n message: `query key '${key}' on step '${stepId}' is set by the server only (it carries the aigentverse credential and where it is sent), so a flow may not declare it`,\n code: CODE,\n stepId,\n suggestion:\n \"Remove it: the running org's aigentverse connection, or the signed-in person, is used automatically\",\n });\n}\n","// The origin reduction `credential_endpoint_unpaired` compares endpoints by,\n// ported from the reference (`credentialEndpointOrigin`), which is Go's\n// `net/url.Parse` (Go 1.25) plus `strings.TrimSpace` / `strings.ToLower`. The\n// rule only ever asks \"is this endpoint the family's DEFAULT origin?\", so the\n// port has to agree with Go on exactly two things: which strings Go refuses\n// (a refused string is compared as text, and can never equal a default), and\n// the scheme and host Go extracts from the rest.\n//\n// Not ported, verdict-neutral: Go validates a bracketed IPv6 literal with\n// `netip.ParseAddr`. A bracketed host is never a default's host, parsed or\n// refused, so the answer to the one question asked is the same.\n\n/** Go's `unicode.IsSpace` set, which `strings.TrimSpace` trims (not JS `trim`: Go keeps U+FEFF and trims U+0085). */\nconst GO_SPACE =\n '\\\\t\\\\n\\\\v\\\\f\\\\r \\\\u0085\\\\u00A0\\\\u1680\\\\u2000-\\\\u200A\\\\u2028\\\\u2029\\\\u202F\\\\u205F\\\\u3000';\nconst GO_TRIM_SPACE_RE = new RegExp(`^[${GO_SPACE}]+|[${GO_SPACE}]+$`, 'g');\n\n/** Go's `strings.TrimSpace`. */\nexport function goTrimSpace(s: string): string {\n return s.replace(GO_TRIM_SPACE_RE, '');\n}\n\n/**\n * Go's `strings.ToLower`: SIMPLE case mapping, one code point at a time. JS\n * `toLowerCase` applies SpecialCasing, which turns U+0130 into two code points\n * (Go: `i`) and a final sigma into U+03C2 (Go: U+03C3).\n */\nexport function goToLower(s: string): string {\n let out = '';\n for (const ch of s) {\n out += ch === '\\u0130' ? 'i' : ch.toLowerCase();\n }\n return out;\n}\n\n/** Go's `encoding` modes, the ones `parse` uses. */\nconst Mode = {\n Path: 1,\n Host: 2,\n Zone: 3,\n UserPassword: 4,\n Fragment: 5,\n} as const;\ntype EncodeMode = (typeof Mode)[keyof typeof Mode];\n\nfunction isAlnum(c: number): boolean {\n return (c >= 0x61 && c <= 0x7a) || (c >= 0x41 && c <= 0x5a) || (c >= 0x30 && c <= 0x39);\n}\n\nfunction isHex(c: number | undefined): boolean {\n return (\n c !== undefined &&\n ((c >= 0x30 && c <= 0x39) || (c >= 0x61 && c <= 0x66) || (c >= 0x41 && c <= 0x46))\n );\n}\n\nfunction unhex(c: number): number {\n if (c >= 0x30 && c <= 0x39) return c - 0x30;\n if (c >= 0x61 && c <= 0x66) return c - 0x61 + 10;\n return c - 0x41 + 10;\n}\n\n/** Go's `shouldEscape` for the modes `parse` uses. */\nfunction shouldEscape(c: number, mode: EncodeMode): boolean {\n if (isAlnum(c)) return false;\n const ch = String.fromCharCode(c);\n if ((mode === Mode.Host || mode === Mode.Zone) && `!$&'()*+,;=:[]<>\"`.includes(ch)) return false;\n if ('-_.~'.includes(ch)) return false;\n if ('$&+,/:;=?@'.includes(ch)) {\n switch (mode) {\n case Mode.Path:\n return ch === '?';\n case Mode.UserPassword:\n return ch === '@' || ch === '/' || ch === '?' || ch === ':';\n case Mode.Fragment:\n return false;\n default:\n break;\n }\n }\n if (mode === Mode.Fragment && '!()*'.includes(ch)) return false;\n return true;\n}\n\n/** Go's `unescape` over UTF-8 bytes: the decoded bytes, or null where Go returns an error. */\nfunction unescape(s: Uint8Array, mode: EncodeMode): Uint8Array | null {\n const out: number[] = [];\n for (let i = 0; i < s.length; ) {\n const c = s[i] as number;\n if (c === 0x25 /* % */) {\n const h1 = s[i + 1];\n const h2 = s[i + 2];\n if (i + 2 >= s.length || !isHex(h1) || !isHex(h2)) return null;\n const hi = unhex(h1 as number);\n const lo = unhex(h2 as number);\n const isPct25 = hi === 2 && lo === 5;\n if (mode === Mode.Host && hi < 8 && !isPct25) return null;\n if (mode === Mode.Zone) {\n const v = (hi << 4) | lo;\n if (!isPct25 && v !== 0x20 && shouldEscape(v, Mode.Host)) return null;\n }\n out.push((hi << 4) | lo);\n i += 3;\n continue;\n }\n if ((mode === Mode.Host || mode === Mode.Zone) && c < 0x80 && shouldEscape(c, mode)) {\n return null;\n }\n out.push(c);\n i++;\n }\n return Uint8Array.from(out);\n}\n\nconst utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder('utf-8');\n\nfunction unescapeText(s: string, mode: EncodeMode): string | null {\n const bytes = unescape(utf8Encoder.encode(s), mode);\n return bytes === null ? null : utf8Decoder.decode(bytes);\n}\n\n/** Go's `validOptionalPort`: \"\" or `:` followed by digits only. */\nfunction validOptionalPort(port: string): boolean {\n if (port === '') return true;\n if (port[0] !== ':') return false;\n return /^[0-9]*$/.test(port.slice(1));\n}\n\n/** Go's `validUserinfo`. */\nfunction validUserinfo(s: string): boolean {\n for (const ch of s) {\n const c = ch.codePointAt(0) as number;\n if (c < 0x80 && isAlnum(c)) continue;\n if (`-._:~!$&'()*+,;=%@`.includes(ch)) continue;\n return false;\n }\n return true;\n}\n\n/** Go's `parseHost`: the unescaped host (with port), or null on error. */\nfunction parseHost(host: string): string | null {\n const open = host.lastIndexOf('[');\n if (open !== -1) {\n const close = host.lastIndexOf(']');\n if (close < 0) return null;\n const colonPort = host.slice(close + 1);\n if (!validOptionalPort(colonPort)) return null;\n const port = unescapeText(colonPort, Mode.Host);\n if (port === null) return null;\n const hostname = host.slice(open + 1, close);\n const zone = hostname.indexOf('%25');\n let name: string | null;\n if (zone >= 0) {\n const hostPart = unescapeText(hostname.slice(0, zone), Mode.Host);\n const zonePart = unescapeText(hostname.slice(zone), Mode.Zone);\n name = hostPart === null || zonePart === null ? null : hostPart + zonePart;\n } else {\n name = unescapeText(hostname, Mode.Host);\n }\n if (name === null) return null;\n return `[${name}]${port}`;\n }\n const colon = host.lastIndexOf(':');\n if (colon !== -1 && !validOptionalPort(host.slice(colon))) return null;\n return unescapeText(host, Mode.Host);\n}\n\n/** Go's `parseAuthority`: the host, and whether the authority carries userinfo (`u.User != nil`). */\nfunction parseAuthority(authority: string): { host: string; hasUser: boolean } | null {\n const at = authority.lastIndexOf('@');\n const host = parseHost(at < 0 ? authority : authority.slice(at + 1));\n if (host === null) return null;\n if (at < 0) return { host, hasUser: false };\n const userinfo = authority.slice(0, at);\n if (!validUserinfo(userinfo)) return null;\n const colon = userinfo.indexOf(':');\n const parts = colon < 0 ? [userinfo] : [userinfo.slice(0, colon), userinfo.slice(colon + 1)];\n for (const part of parts) {\n if (unescapeText(part, Mode.UserPassword) === null) return null;\n }\n return { host, hasUser: true };\n}\n\n/** Go's `getScheme`: null for \"missing protocol scheme\". */\nfunction getScheme(raw: string): { scheme: string; rest: string } | null {\n for (let i = 0; i < raw.length; i++) {\n const c = raw.charCodeAt(i);\n if ((c >= 0x61 && c <= 0x7a) || (c >= 0x41 && c <= 0x5a)) continue;\n if ((c >= 0x30 && c <= 0x39) || c === 0x2b || c === 0x2d || c === 0x2e) {\n if (i === 0) return { scheme: '', rest: raw };\n continue;\n }\n if (c === 0x3a /* : */) {\n if (i === 0) return null;\n return { scheme: raw.slice(0, i), rest: raw.slice(i + 1) };\n }\n return { scheme: '', rest: raw };\n }\n return { scheme: '', rest: raw };\n}\n\nfunction containsCTL(s: string): boolean {\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n if (c < 0x20 || c === 0x7f) return true;\n }\n return false;\n}\n\n/** What {@link goParseURLParts} extracts from a URL Go accepts. */\nexport interface GoURLParts {\n scheme: string;\n /** `u.Host`: the host with its port, after any userinfo. */\n host: string;\n /** `u.User != nil`: an `@` in the authority, even an empty userinfo. */\n hasUser: boolean;\n /** `u.RawQuery`: the text after the first `?`. */\n rawQuery: string;\n /** `u.Fragment`, still escaped (callers judge only its emptiness). */\n fragment: string;\n}\n\n/**\n * Go's `url.Parse`, reduced to what it yields for `Scheme` and `Host`; null\n * where Go returns an error.\n */\nexport function goParseSchemeHost(rawURL: string): { scheme: string; host: string } | null {\n const u = goParseURLParts(rawURL);\n return u === null ? null : { scheme: u.scheme, host: u.host };\n}\n\n/**\n * Go's `url.Parse`, reduced to the parts the `examples:` file-reference rule\n * reads (scheme, host, userinfo presence, query, fragment); null where Go\n * returns an error.\n */\nexport function goParseURLParts(rawURL: string): GoURLParts | null {\n const hash = rawURL.indexOf('#');\n const main = hash < 0 ? rawURL : rawURL.slice(0, hash);\n const frag = hash < 0 ? '' : rawURL.slice(hash + 1);\n\n if (containsCTL(main)) return null;\n if (main === '*') {\n return { scheme: '', host: '', hasUser: false, rawQuery: '', fragment: frag };\n }\n const split = getScheme(main);\n if (split === null) return null;\n const scheme = split.scheme.toLowerCase(); // ASCII by construction\n let rest = split.rest;\n const questionMarks = rest.split('?').length - 1;\n let rawQuery = '';\n if (rest.endsWith('?') && questionMarks === 1) {\n rest = rest.slice(0, -1);\n } else if (questionMarks > 0) {\n rawQuery = rest.slice(rest.indexOf('?') + 1);\n rest = rest.slice(0, rest.indexOf('?'));\n }\n\n if (!rest.startsWith('/')) {\n if (scheme !== '') return finish({ scheme, host: '', hasUser: false, rawQuery }, frag); // opaque\n const slash = rest.indexOf('/');\n const segment = slash < 0 ? rest : rest.slice(0, slash);\n if (segment.includes(':')) return null;\n }\n\n let host = '';\n let hasUser = false;\n if ((scheme !== '' || !rest.startsWith('///')) && rest.startsWith('//')) {\n let authority = rest.slice(2);\n rest = '';\n const slash = authority.indexOf('/');\n if (slash >= 0) {\n rest = authority.slice(slash);\n authority = authority.slice(0, slash);\n }\n const parsed = parseAuthority(authority);\n if (parsed === null) return null;\n host = parsed.host;\n hasUser = parsed.hasUser;\n }\n if (unescapeText(rest, Mode.Path) === null) return null;\n return finish({ scheme, host, hasUser, rawQuery }, frag);\n}\n\nfunction finish(u: Omit<GoURLParts, 'fragment'>, frag: string): GoURLParts | null {\n if (frag !== '' && unescapeText(frag, Mode.Fragment) === null) return null;\n return { ...u, fragment: frag };\n}\n\n/**\n * The KEYS of Go's `url.Values` for a raw query (`u.Query()`): pairs split on\n * `&`, a pair containing `;` skipped, a key that does not unescape skipped,\n * `+` read as a space.\n */\nexport function goQueryKeys(rawQuery: string): string[] {\n const keys: string[] = [];\n for (const pair of rawQuery.split('&')) {\n if (pair === '' || pair.includes(';')) continue;\n const eq = pair.indexOf('=');\n const rawKey = eq < 0 ? pair : pair.slice(0, eq);\n const key = unescapeText(rawKey.replace(/\\+/g, ' '), Mode.Path);\n if (key !== null) keys.push(key);\n }\n return keys;\n}\n\n/**\n * The reference's `credentialEndpointOrigin`: lower-cased `scheme://host:port`\n * with the scheme's default port filled; a value Go does not parse, or with no\n * scheme or no host, is its trimmed, lower-cased self without trailing slashes.\n */\nexport function goEndpointOrigin(\n raw: string,\n defaultPorts: Readonly<Record<string, string>>,\n protocolSeparator: string,\n): string {\n const trimmed = goTrimSpace(raw);\n const u = goParseSchemeHost(trimmed);\n if (u === null || u.scheme === '' || u.host === '') {\n return goToLower(trimmed.replace(/\\/+$/, ''));\n }\n const scheme = goToLower(u.scheme);\n let host = goToLower(u.host);\n const lastColon = host.lastIndexOf(':');\n if (lastColon < 0 || lastColon <= host.lastIndexOf(']')) {\n if (Object.prototype.hasOwnProperty.call(defaultPorts, scheme)) {\n host += `:${defaultPorts[scheme]}`;\n }\n }\n return scheme + protocolSeparator + host;\n}\n","// `credential_endpoint_unpaired` (WARNING): a step names an endpoint its\n// credential will never be sent to.\n//\n// Port of the reference's `validateCredentialEndpointPairing` (AIgentFlow\n// DC-FORGE-231) and `validateFamilyCredentialEndpointPairing` (DC-FORGE-233),\n// together with the Go port (go-aigentflow-validator v0.6.2).\n//\n// AIgentFlow sends a credential the SERVER supplied (an org's or the\n// platform's stored key, or a value of one of the deployment's environment\n// variables) only to the endpoint that came with it: the default, the stored\n// credential's own base URL, or a deployment-configured one. An endpoint the\n// flow names is honoured only with a credential the flow supplies. That\n// run-time refusal is the control; this is the save-time warning about the\n// shapes that are statically certain to meet it. A warning, never an error: a\n// run may still bring its own key, and a warning never changes the verdict.\n//\n// Two arms, over the same steps (a top-level step and a loop sub-step):\n//\n// - ai:// — a step's `<provider>_base_url` with no key of the flow's own\n// (the step query's `api_key` / `<provider>_api_key`, or a literal\n// `executor_config.<provider>.api_key`), and a literal\n// `executor_config.<provider>.base_url` for an AI provider with no literal\n// key beside it, unless at least one step uses the provider and every such\n// step brings its own key. ollama and vllm are exempt.\n// - the families in the spec's table — a secret that is `${NAME}` for one of\n// the family's server variables (on a family whose plugin expands\n// references) beside an endpoint that is certainly the author's: not\n// templated, not a reference, not the family's default origin. A family\n// with an implicit service credential is not judged.\n//\n// Values are read as the reference reads them: a step `query:` and an `extra:`\n// block are Go `any` there, so only a YAML string counts; `api_key` and\n// `base_url` under `executor_config.<key>` are Go `string` fields, read by\n// source text. Two JS-only approximations, both looser (PARITY.md): an\n// endpoint shaped like a YAML timestamp is not read as a string (yaml.v3\n// decodes a PLAIN one into `time.Time`), and a `!!binary` value is not one.\n\nimport type { Flow } from '../types.js';\nimport {\n CREDENTIAL_ENDPOINT_PAIRING as CFG,\n TEMPLATE_ACTION_OPEN,\n EXECUTOR_CONFIG_ENV_SCOPES,\n} from '../spec/index.js';\nimport type { CredentialEndpointFamily } from '../spec/index.js';\nimport { envReferenceName } from './executorConfigEnv.js';\nimport { goEndpointOrigin } from './goUrl.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE = 'credential_endpoint_unpaired';\nconst KEY_EXECUTOR_CONFIG = 'executor_config';\nconst KEY_EXECUTOR = 'executor';\nconst KEY_QUERY = 'query';\nconst KEY_ID = 'id';\n\ntype Rec = Record<string, unknown>;\n\n/**\n * A string yaml.v3 may have decoded into `time.Time` from a plain scalar\n * (its `parseTimestamp` formats, over-approximated: no range checks). Only\n * consulted where reading a value as a string can ADD a warning.\n */\nconst YAML_TIMESTAMP_LIKE =\n /^\\d{4}-\\d{1,2}-\\d{1,2}(?:[Tt]\\d{1,2}:\\d{1,2}:\\d{1,2}(?:[.,]\\d+)?(?:Z|[+-]\\d{2}:\\d{2})| \\d{1,2}:\\d{1,2}:\\d{1,2}(?:[.,]\\d+)?)?$/;\n\n/** An own property of a plain object (never one of Object.prototype's). */\nfunction own(m: unknown, key: string): unknown {\n if (!isRecord(m) || !Object.prototype.hasOwnProperty.call(m, key)) return undefined;\n return m[key];\n}\n\n/** Go's `fmt.Sprintf` for the `%s`-only field formats in the spec. */\nfunction formatField(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%s/g, () => args[i++] ?? '');\n}\n\n/** The reference's `query[key].(string)`, non-empty. */\nfunction nonEmptyString(m: unknown, key: string): string | null {\n const v = own(m, key);\n return typeof v === 'string' && v !== '' ? v : null;\n}\n\n/** {@link nonEmptyString} for an ENDPOINT: a timestamp-shaped value is not a string there. */\nfunction nonEmptyEndpoint(m: unknown, key: string): string | null {\n const v = nonEmptyString(m, key);\n return v === null || YAML_TIMESTAMP_LIKE.test(v) ? null : v;\n}\n\ninterface CredStep {\n executor: string;\n query: unknown;\n field: (key: string) => string;\n}\n\nfunction credentialEndpointSteps(flow: Flow, issues: Issues): CredStep[] {\n const steps = flow.steps;\n if (!isRecord(steps)) return [];\n const out: CredStep[] = [];\n for (const stepId of Object.keys(steps).sort()) {\n const step = steps[stepId];\n if (!isRecord(step)) continue;\n out.push({\n executor: issues.stringOf(step, KEY_EXECUTOR, `steps.${stepId}`) ?? '',\n query: own(step, KEY_QUERY),\n field: (key) => formatField(CFG.stepFieldFormat, stepId, key),\n });\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n const subId = issues.stringOf(sub.raw, KEY_ID, sub.basePath) ?? '';\n out.push({\n executor: issues.stringOf(sub.raw, KEY_EXECUTOR, sub.basePath) ?? '',\n query: own(sub.raw, KEY_QUERY),\n field: (key) => formatField(CFG.loopStepFieldFormat, stepId, subId, key),\n });\n }\n }\n return out;\n}\n\nfunction configInstance(flow: Flow, key: string): Rec | null {\n const inst = own(own(flow, KEY_EXECUTOR_CONFIG), key);\n return isRecord(inst) ? inst : null;\n}\n\n/** A Go-`string` field of an executor_config instance, by source text; \"\" when absent or null. */\nfunction configStringField(inst: Rec, configKey: string, field: string, issues: Issues): string {\n return issues.stringOf(inst, field, `${KEY_EXECUTOR_CONFIG}.${configKey}`) ?? '';\n}\n\nexport function validateCredentialEndpointPairing(flow: Flow, issues: Issues): void {\n const steps = credentialEndpointSteps(flow, issues);\n validateAI(flow, steps, issues);\n validateFamilies(flow, steps, issues);\n}\n\n// --- ai:// -----------------------------------------------------------------\n\nfunction aiStepProvider(executor: string): string {\n const prefix = CFG.ai.protocol + CFG.protocolSeparator;\n if (!executor.startsWith(prefix)) return '';\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n return slash < 0 ? rest : rest.slice(0, slash);\n}\n\nfunction aiQueryHasOwnKey(query: unknown, provider: string): boolean {\n return [CFG.ai.genericKeyParam, provider + CFG.ai.providerKeyParamSuffix].some(\n (key) => nonEmptyString(query, key) !== null,\n );\n}\n\nfunction aiConfigHasOwnKey(flow: Flow, provider: string, issues: Issues): boolean {\n const inst = configInstance(flow, provider);\n if (inst === null) return false;\n const key = configStringField(inst, provider, CFG.executorConfigApiKeyField, issues);\n return key !== '' && envReferenceName(key) === null;\n}\n\nfunction validateAI(flow: Flow, steps: CredStep[], issues: Issues): void {\n const keyless = new Set(CFG.ai.keylessProviders);\n const stepsUsing = new Map<string, number>();\n const stepsWithoutOwnKey = new Map<string, number>();\n for (const step of steps) {\n const provider = aiStepProvider(step.executor);\n if (provider === '' || keyless.has(provider)) continue;\n stepsUsing.set(provider, (stepsUsing.get(provider) ?? 0) + 1);\n const queryOwn = aiQueryHasOwnKey(step.query, provider);\n if (!queryOwn) stepsWithoutOwnKey.set(provider, (stepsWithoutOwnKey.get(provider) ?? 0) + 1);\n const urlKey = provider + CFG.ai.providerBaseUrlParamSuffix;\n if (\n nonEmptyEndpoint(step.query, urlKey) !== null &&\n !queryOwn &&\n !aiConfigHasOwnKey(flow, provider, issues)\n ) {\n warnStoredShape(issues, step.field(urlKey), provider);\n }\n }\n\n const config = own(flow, KEY_EXECUTOR_CONFIG);\n if (!isRecord(config)) return;\n const providers = new Set(CFG.ai.executorConfigProviders);\n for (const provider of Object.keys(config).sort()) {\n const inst = own(config, provider);\n if (!isRecord(inst) || !providers.has(provider) || keyless.has(provider)) continue;\n const baseUrl = configStringField(inst, provider, CFG.executorConfigBaseUrlField, issues);\n if (baseUrl === '') continue;\n if (envReferenceName(baseUrl) !== null) continue; // the deployment's endpoint\n if (aiConfigHasOwnKey(flow, provider, issues)) continue;\n if ((stepsUsing.get(provider) ?? 0) > 0 && (stepsWithoutOwnKey.get(provider) ?? 0) === 0) {\n continue; // every step brings its own key\n }\n warnStoredShape(issues, formatField(CFG.executorConfigBaseUrlFieldFormat, provider), provider);\n }\n}\n\nfunction warnStoredShape(issues: Issues, field: string, provider: string): void {\n issues.warn({\n field,\n code: CODE,\n message:\n `${field} names an endpoint for \"${provider}\" but the flow supplies no ${provider} key of its own. ` +\n `At run time the org's (or the platform's) stored ${provider} credential is never sent to a host ` +\n 'the flow chooses, so this step will be refused unless the run supplies its own key.',\n suggestion:\n \"To use a custom endpoint with the org's credential, store the base_url on the credential; \" +\n \"to use the provider's default endpoint, remove this field\",\n });\n}\n\n// --- the executor families -------------------------------------------------\n\nfunction familyOf(executor: string): { key: string; family: CredentialEndpointFamily } | null {\n const sep = executor.indexOf(CFG.protocolSeparator);\n if (sep <= 0) return null;\n const protocol = executor.slice(0, sep);\n const rest = executor.slice(sep + CFG.protocolSeparator.length);\n const slash = rest.indexOf('/');\n const driver = slash < 0 ? rest : rest.slice(0, slash);\n const candidates =\n driver === '' ? [protocol] : [protocol + CFG.familyKeySeparator + driver, protocol];\n for (const key of candidates) {\n const family = own(CFG.families, key);\n if (family !== undefined) return { key, family: family as CredentialEndpointFamily };\n }\n return null;\n}\n\nfunction serverEnvRef(family: CredentialEndpointFamily, value: string): string | null {\n const name = envReferenceName(value);\n if (name === null || !family.expandsServerEnvReferences || !family.serverEnv.includes(name)) {\n return null;\n }\n return name;\n}\n\nfunction listHas(list: readonly string[], s: string): boolean {\n return s !== '' && list.includes(s);\n}\n\ninterface FamilySecret {\n envName: string | null;\n field: string;\n}\n\n/** The step's credential: the step query first, then each executor_config block. */\nfunction familySecret(\n flow: Flow,\n family: CredentialEndpointFamily,\n step: CredStep,\n issues: Issues,\n): FamilySecret | null {\n for (const key of family.secretParams) {\n const v = nonEmptyString(step.query, key);\n if (v !== null) return { envName: serverEnvRef(family, v), field: step.field(key) };\n }\n for (const configKey of family.configKeys) {\n const inst = configInstance(flow, configKey);\n if (inst === null) continue;\n const apiKey = configStringField(inst, configKey, CFG.executorConfigApiKeyField, issues);\n if (apiKey !== '' && listHas(family.secretParams, family.configApiKeyParam)) {\n return {\n envName: serverEnvRef(family, apiKey),\n field: formatField(\n CFG.executorConfigKeyFieldFormat,\n configKey,\n CFG.executorConfigApiKeyField,\n ),\n };\n }\n const extra = own(inst, EXECUTOR_CONFIG_ENV_SCOPES.extraKey);\n for (const key of family.secretParams) {\n const v = nonEmptyString(extra, key);\n if (v !== null) {\n return {\n envName: serverEnvRef(family, v),\n field: formatField(CFG.executorConfigExtraFieldFormat, configKey, key),\n };\n }\n }\n }\n return null;\n}\n\nfunction isAuthorLiteral(family: CredentialEndpointFamily, v: string): boolean {\n if (v === '' || v.includes(TEMPLATE_ACTION_OPEN)) return false;\n if (envReferenceName(v) !== null) return false;\n const origin = goEndpointOrigin(v, CFG.defaultPorts, CFG.protocolSeparator);\n return !family.defaultEndpoints.some(\n (d) => goEndpointOrigin(d, CFG.defaultPorts, CFG.protocolSeparator) === origin,\n );\n}\n\n/** The field of the endpoint the step will use when it is certainly the author's, or null. */\nfunction familyAuthorEndpoint(\n flow: Flow,\n family: CredentialEndpointFamily,\n step: CredStep,\n issues: Issues,\n): string | null {\n const decide = (v: string, field: string): string | null =>\n isAuthorLiteral(family, v) ? field : null;\n for (const key of family.endpointParams) {\n const v = nonEmptyEndpoint(step.query, key);\n if (v !== null) return decide(v, step.field(key));\n }\n for (const configKey of family.configKeys) {\n const inst = configInstance(flow, configKey);\n if (inst === null) continue;\n const baseUrl = configStringField(inst, configKey, CFG.executorConfigBaseUrlField, issues);\n if (baseUrl !== '' && listHas(family.endpointParams, family.configBaseUrlParam)) {\n return decide(baseUrl, formatField(CFG.executorConfigBaseUrlFieldFormat, configKey));\n }\n const extra = own(inst, EXECUTOR_CONFIG_ENV_SCOPES.extraKey);\n for (const key of family.endpointParams) {\n const v = nonEmptyEndpoint(extra, key);\n if (v !== null)\n return decide(v, formatField(CFG.executorConfigExtraFieldFormat, configKey, key));\n }\n }\n return null;\n}\n\nfunction validateFamilies(flow: Flow, steps: CredStep[], issues: Issues): void {\n for (const step of steps) {\n const found = familyOf(step.executor);\n if (found === null || found.family.implicitServerCredential) continue;\n const { key: familyKey, family } = found;\n const secret = familySecret(flow, family, step, issues);\n if (secret === null || secret.envName === null) continue;\n const endpointField = familyAuthorEndpoint(flow, family, step, issues);\n if (endpointField === null) continue;\n issues.warn({\n field: endpointField,\n code: CODE,\n message:\n `${endpointField} names an endpoint for ${familyKey} while the step's credential ${secret.field} ` +\n `comes from the server's environment (${secret.envName}). A server-supplied credential is only ` +\n \"sent to the executor's default or deployment-configured endpoint, so this step is refused at \" +\n \"run time unless that endpoint is the deployment's own.\",\n suggestion:\n \"Supply the endpoint's own credential, or remove the endpoint (or name it by its deployment \" +\n \"variable) to use the deployment's\",\n });\n }\n}\n","// The orchestrator's inline `.exons` document, judged where the reference's\n// save door judges it: the exons half of `validateOrchestrator` (parser.go),\n// the `requirements.resources` refusal (AIgentFlow v2.767.0) and the\n// `orchestrator_tool_withheld` warning (v2.760.0).\n//\n// ⚠ This validator has NO `.exons` template engine and must not grow one: a\n// second implementation of that grammar would be a second opinion about it. It\n// reads the YAML FRONTMATTER only, the way the engine extracts and decodes it,\n// and refuses only where the engine is certain to refuse as well. What it cannot\n// see (PARITY.md, divergence #16): a document that fails to parse for any other\n// reason, including a spec the engine's own validation refuses; a tag that\n// cannot render (`exons_attributes`, on a step's `query.exons` and on the\n// orchestrator); and a frontmatter containing a tag, which the engine EXECUTES\n// before decoding, so it is not read at all. The direction is always looser,\n// never stricter.\n\nimport { isMap, isScalar, isSeq, parseAllDocuments } from 'yaml';\nimport type { Flow } from '../types.js';\nimport { EXONS, ORCHESTRATOR_TOOL_ALLOW } from '../spec/index.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\n\nconst CODE_PARSE_FAILED = 'orchestrator_exons_parse_failed';\nconst CODE_NO_PROVIDER = 'orchestrator_exons_no_provider';\nconst CODE_RESOURCES = 'exons_resources_unhonoured';\nconst CODE_TOOL_WITHHELD = 'orchestrator_tool_withheld';\n\n/** The engine's tag opener. A frontmatter containing it is executed before it is decoded. */\nconst EXONS_OPEN_DELIM = '{~';\n/** The retired JSON config-block opener; the engine refuses a document starting with it. */\nconst EXONS_LEGACY_CONFIG_OPEN = '{~exons.config~}';\nconst UTF8_BOM = '';\nconst MAX_ALIAS_COUNT = 100;\n\n/** One `requirements.resources` entry. */\nexport interface ExonsResource {\n ref: string;\n kind: string;\n scope: string;\n}\n\n/**\n * What the save-door rules know about one `.exons` document, from its\n * frontmatter alone. Mirrors the Go port's `ExonsReport` minus the fields only\n * an engine can fill.\n */\nexport interface ExonsFrontmatterReport {\n /**\n * Why the engine's parse is CERTAIN to refuse the document (an unclosed\n * frontmatter, the retired config block), or null.\n */\n parseError: string | null;\n /**\n * true when the fields below are known. false when the frontmatter cannot be\n * read the way the engine would (it contains a tag, or its YAML does not\n * decode into the fields the rules read); then no rule reads them.\n */\n specRead: boolean;\n /** The document declares a frontmatter spec. */\n hasSpec: boolean;\n /** `execution.provider`, '' when absent. */\n provider: string;\n /** An absent `tools.allow` (no narrowing) is not an empty one. */\n toolsAllowDeclared: boolean;\n toolsAllow: string[];\n resources: ExonsResource[];\n}\n\nconst UNREAD: ExonsFrontmatterReport = {\n parseError: null,\n specRead: false,\n hasSpec: false,\n provider: '',\n toolsAllowDeclared: false,\n toolsAllow: [],\n resources: [],\n};\n\n// Go's strings.TrimSpace (unicode.IsSpace), which differs from String.trim():\n// it trims U+0085 and does NOT trim U+FEFF.\nconst GO_SPACE =\n '\\\\t\\\\n\\\\v\\\\f\\\\r \\\\u0085\\\\u00a0\\\\u1680\\\\u2000-\\\\u200a\\\\u2028\\\\u2029\\\\u202f\\\\u205f\\\\u3000';\nconst GO_TRIM_SPACE = new RegExp(`^[${GO_SPACE}]+|[${GO_SPACE}]+$`, 'g');\n\nexport function goTrimSpace(s: string): string {\n return s.replace(GO_TRIM_SPACE, '');\n}\n\ninterface Frontmatter {\n frontmatter: string;\n hasFrontmatter: boolean;\n parseError: string | null;\n}\n\n/**\n * The engine's frontmatter extraction: after an optional UTF-8 BOM and leading\n * spaces or tabs (not newlines), the document must start with the delimiter\n * and a line break (LF or CRLF); the frontmatter ends at the next line that\n * starts with the delimiter followed by a line break (any CR counts) or the end\n * of the input, and is trimmed. A document without the opening delimiter has no\n * frontmatter; one whose frontmatter never closes, or that starts with the\n * retired config block, is refused.\n */\nexport function extractExonsFrontmatter(source: string): Frontmatter {\n const delim = EXONS.frontmatterDelimiter;\n let start = source.startsWith(UTF8_BOM) ? source.slice(UTF8_BOM.length) : source;\n start = start.replace(/^[ \\t]+/, '');\n if (start.startsWith(EXONS_LEGACY_CONFIG_OPEN)) {\n return {\n frontmatter: '',\n hasFrontmatter: false,\n parseError: 'legacy JSON config block detected; use YAML frontmatter',\n };\n }\n if (!start.startsWith(delim)) return { frontmatter: '', hasFrontmatter: false, parseError: null };\n let rest = start.slice(delim.length);\n if (rest.startsWith('\\n')) rest = rest.slice(1);\n else if (rest.startsWith('\\r\\n')) rest = rest.slice(2);\n else return { frontmatter: '', hasFrontmatter: false, parseError: null };\n\n let pos = 0;\n while (pos <= rest.length) {\n const line = rest.slice(pos);\n if (line.startsWith(delim)) {\n const after = line.slice(delim.length);\n if (after === '' || after[0] === '\\n' || after[0] === '\\r') {\n return {\n frontmatter: goTrimSpace(rest.slice(0, pos)),\n hasFrontmatter: true,\n parseError: null,\n };\n }\n }\n const nl = line.indexOf('\\n');\n if (nl < 0) break;\n pos += nl + 1;\n }\n return {\n frontmatter: '',\n hasFrontmatter: true,\n parseError: 'YAML frontmatter not properly closed',\n };\n}\n\n/**\n * Every number or boolean scalar becomes its SOURCE text, before conversion.\n * The fields the rules read are all Go `string`s (or lists of them), which\n * yaml.v3 fills from any scalar by its text; a scalar where a mapping or list\n * belongs is a decode error either way.\n */\nfunction retagScalars(node: unknown): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n retagScalars(pair.key);\n retagScalars(pair.value);\n }\n } else if (isSeq(node)) {\n for (const item of node.items) retagScalars(item);\n } else if (\n isScalar(node) &&\n (typeof node.value === 'number' || typeof node.value === 'boolean') &&\n typeof node.source === 'string'\n ) {\n node.value = node.source;\n }\n}\n\n/** A declared field of the wrong shape: yaml.v3 fails the whole decode. */\nclass DecodeError extends Error {}\n\n/** yaml.v3 into a Go `string`: null is '', a scalar its text, anything else a decode error. */\nfunction goString(v: unknown): string {\n if (v === null || v === undefined) return '';\n if (isString(v)) return v;\n throw new DecodeError('not a string');\n}\n\n/**\n * yaml.v3 into a `[]string`: null is nil (absent). A null ELEMENT is dropped,\n * not decoded to '': yaml.v3 appends an element only when the decode set it,\n * and a null sets nothing in a string or a struct.\n */\nfunction goStringList(v: unknown): string[] | null {\n if (v === null || v === undefined) return null;\n if (!isArray(v)) throw new DecodeError('not a list');\n return v.filter((item) => item !== null).map(goString);\n}\n\n/** yaml.v3 into a struct pointer: null is nil. */\nfunction goStruct(v: unknown): Record<string, unknown> | null {\n if (v === null || v === undefined) return null;\n if (!isRecord(v)) throw new DecodeError('not a mapping');\n return v;\n}\n\n/**\n * The decode of the frontmatter into the fields the rules read, as the\n * engine's non-strict yaml.v3 decode does it: an undeclared key is ignored, a\n * declared one of the wrong shape fails the whole decode. null when it fails.\n */\nfunction decodeSpecFields(\n frontmatter: string,\n): Omit<ExonsFrontmatterReport, 'parseError' | 'specRead' | 'hasSpec'> | null {\n let value: unknown;\n try {\n // yaml.v3's Unmarshal decodes the first document only.\n const docs = parseAllDocuments(frontmatter, { merge: true });\n const doc = Array.isArray(docs) ? docs[0] : undefined;\n if (doc === undefined) {\n value = null;\n } else {\n if (doc.errors.length > 0) return null;\n retagScalars(doc.contents);\n value = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n }\n } catch {\n return null;\n }\n try {\n const root = goStruct(value) ?? {};\n const execution = goStruct(root.execution);\n const tools = goStruct(root.tools);\n const requirements = goStruct(root.requirements);\n const allow = tools === null ? null : goStringList(tools.allow);\n let resources: ExonsResource[] = [];\n if (requirements !== null) {\n const raw = requirements.resources;\n if (raw !== null && raw !== undefined) {\n if (!isArray(raw)) throw new DecodeError('not a list');\n // A null entry is dropped, as in goStringList.\n resources = raw\n .filter((entry) => entry !== null)\n .map((entry) => {\n const r = goStruct(entry) ?? {};\n return { ref: goString(r.ref), kind: goString(r.kind), scope: goString(r.scope) };\n });\n }\n }\n return {\n provider: execution === null ? '' : goString(execution.provider),\n toolsAllowDeclared: allow !== null,\n toolsAllow: allow ?? [],\n resources,\n };\n } catch (e) {\n if (e instanceof DecodeError) return null;\n throw e;\n }\n}\n\n/** Read one `.exons` document's frontmatter the way the engine would. */\nexport function inspectExonsFrontmatter(source: string): ExonsFrontmatterReport {\n const fm = extractExonsFrontmatter(source);\n if (fm.parseError !== null) return { ...UNREAD, parseError: fm.parseError };\n // No spec: the engine's parse yields a nil spec.\n if (!fm.hasFrontmatter || fm.frontmatter === '') return { ...UNREAD, specRead: true };\n if (fm.frontmatter.includes(EXONS_OPEN_DELIM)) return { ...UNREAD };\n const fields = decodeSpecFields(fm.frontmatter);\n if (fields === null) return { ...UNREAD };\n return { parseError: null, specRead: true, hasSpec: true, ...fields };\n}\n\n/**\n * Refusals, in the reference's order: the document does not parse (here: only\n * an unclosed frontmatter or the retired config block); no frontmatter spec,\n * which the reference reports as a parse failure; no `execution.provider`; any\n * `requirements.resources` entry (AIgentFlow can honour no declared resource\n * today, so every one is refused rather than run without the narrowing it asks\n * for). Then the `orchestrator_tool_withheld` warning. The document's presence\n * is `orchestrator_exons_required`, judged in orchestratorCampaign.ts.\n */\nexport function validateOrchestratorExons(flow: Flow, issues: Issues): void {\n const orch: unknown = flow.orchestrator;\n if (!isRecord(orch)) return;\n const source = issues.stringOf(orch, 'exons', 'orchestrator');\n if (source === null || source === '') return;\n const field = 'orchestrator.exons';\n const report = inspectExonsFrontmatter(source);\n\n if (report.parseError !== null) {\n issues.error({\n field,\n code: CODE_PARSE_FAILED,\n message: `orchestrator: failed to parse exons spec: ${report.parseError}`,\n });\n return;\n }\n if (!report.specRead) return;\n if (!report.hasSpec) {\n issues.error({\n field,\n code: CODE_PARSE_FAILED,\n message: 'orchestrator: failed to parse exons spec: the document has no frontmatter spec',\n suggestion: 'Start the document with a --- frontmatter block that sets execution.provider',\n });\n return;\n }\n if (report.provider === '') {\n issues.error({\n field,\n code: CODE_NO_PROVIDER,\n message: 'orchestrator: exons spec must have execution.provider set',\n });\n }\n if (report.resources.length > 0) {\n const refs = report.resources.map((r) => `${JSON.stringify(r.ref)} (kind ${r.kind})`);\n issues.error({\n field,\n code: CODE_RESOURCES,\n message:\n \"the orchestrator's exons spec declares requirements.resources that AIgentFlow cannot \" +\n 'honour, so it is refused rather than run without the narrowing it asks for: ' +\n refs.join('; '),\n suggestion:\n 'Remove requirements.resources, and narrow the agent with tools.mcp_servers and tools.allow',\n });\n }\n warnOrchestratorToolWithheld(flow, orch, report, issues);\n}\n\n/**\n * An orchestrator tool is offered only if it passes BOTH `orchestrator.tools`\n * (empty = every tool) AND the definition's `tools.allow` (absent = no\n * narrowing). Two lists that each read as complete can disagree, and the\n * disagreement is silent at run time. Reported: a tool named in\n * `orchestrator.tools` that `tools.allow` omits; with `orchestrator.tools`\n * empty, a `tools.allow` without `aif_ask_human` (human intervention off), and\n * one that names no campaign tool when the flow declares a campaign.\n *\n * A WARNING, never an error: an unattended orchestrator is a legitimate design.\n */\nfunction warnOrchestratorToolWithheld(\n flow: Flow,\n orch: Record<string, unknown>,\n report: ExonsFrontmatterReport,\n issues: Issues,\n): void {\n if (!report.toolsAllowDeclared) return;\n const cfg = ORCHESTRATOR_TOOL_ALLOW;\n const exempt = new Set<string>(cfg.lifecycleTools);\n // Only a YAML boolean sets it; absent (or anything else) is the default, on.\n const signals =\n typeof orch.enable_signals === 'boolean' ? orch.enable_signals : cfg.enableSignalsDefault;\n if (signals) for (const t of cfg.signalTools) exempt.add(t);\n const allow = new Set(report.toolsAllow);\n const withheld = (name: string): boolean => !allow.has(name) && !exempt.has(name);\n const warn = (message: string): void =>\n issues.warn({ field: cfg.warningField, code: CODE_TOOL_WITHHELD, message });\n\n const named: string[] = [];\n if (isArray(orch.tools)) {\n orch.tools.forEach((raw: unknown, i: number) => {\n const name = issues.stringAt(raw, `orchestrator.tools[${i}]`);\n if (name !== null) named.push(name);\n });\n }\n if (named.length > 0) {\n for (const name of named) {\n if (!withheld(name)) continue;\n warn(\n `orchestrator tool '${name}' is named in orchestrator.tools but the orchestrator's exons ` +\n \"definition's tools.allow does not name it, so it is never offered: a tool must pass \" +\n `both lists. Add '${name}' to tools.allow, or remove it from orchestrator.tools.`,\n );\n }\n return;\n }\n if (withheld(cfg.askHumanTool)) {\n warn(\n `the orchestrator's exons definition has a tools.allow list that does not name ` +\n `${cfg.askHumanTool}, so this orchestrator can never ask a person a question: human ` +\n `intervention is off. Add ${cfg.askHumanTool} to tools.allow if a human should be ` +\n 'reachable, or ignore this if the orchestrator is meant to run unattended.',\n );\n }\n // A null `campaign:` is no campaign.\n if (isRecord(flow.campaign) && !cfg.campaignTools.some((name) => !withheld(name))) {\n warn(\n \"this flow declares a campaign, but the orchestrator's exons definition has a tools.allow \" +\n `list that names none of the campaign tools (${cfg.campaignTools.join(', ')}), so no ` +\n 'child mission can be spawned or tracked. Add the campaign tools the orchestrator needs ' +\n 'to tools.allow.',\n );\n }\n}\n","// `compliance_residency_unenforced` (WARNING): an EU-only `compliance.residency`\n// beside a literal model call that nothing pins to the EU.\n//\n// Port of the reference's `validateResidencyEnforcement` (AIgentFlow v2.821.0),\n// together with the Go port. `compliance.residency` is checked by the reference\n// against its model CATALOGUE (declared deployments, not the host a call\n// dials); that check needs the catalogue and is not ported (PARITY.md). This\n// rule needs none, so it is: it says which calls leave the flow's residency\n// declaration without any evidence behind it.\n//\n// A warning, never an error: the call may be correct (the key is EU-confined, a\n// run input supplies the region) and a static check cannot see that.\n//\n// The rule is in the spec (`complianceResidency`): the EU-only code set, the\n// region-lane providers (those whose adapter routes on `region`), the formats.\n// A provider with no region lane (scaleway, vaiembed, anthropic native, ...)\n// cannot be pinned by these keys and is never warned.\n\nimport type { Flow } from '../types.js';\nimport { COMPLIANCE_RESIDENCY as CFG, TEMPLATE_ACTION_OPEN } from '../spec/index.js';\nimport { goTrimSpace, inspectExonsFrontmatter } from './exons.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isArray, isRecord } from './util.js';\n\n/** An own property of a plain object (never one of Object.prototype's). */\nfunction own(m: unknown, key: string): unknown {\n if (!isRecord(m) || !Object.prototype.hasOwnProperty.call(m, key)) return undefined;\n return m[key];\n}\n\n/** Go's `fmt.Sprintf` for a format of `%s` / `%q` verbs; `%q` quotes, `%v` takes the text as given. */\nfunction sprintf(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%[sqv]/g, (verb) => {\n const arg = args[i++] ?? '';\n return verb === '%q' ? JSON.stringify(arg) : arg;\n });\n}\n\n/** The trimmed value, or '' when it is a template. */\nfunction literalOrEmpty(s: string): string {\n const t = goTrimSpace(s);\n return t.includes(TEMPLATE_ACTION_OPEN) ? '' : t;\n}\n\n/**\n * The declared residency codes when the declaration is EU-only (non-empty, every\n * code, trimmed and upper-cased, in the EU set), else null. `[\"EU\",\"US\"]` is not\n * EU-only: residency means \"at least one of these\".\n */\nfunction euOnlyResidency(flow: Flow, issues: Issues): string[] | null {\n const raw = own(own(flow, 'compliance'), 'residency');\n if (!isArray(raw)) return null;\n const codes: string[] = [];\n for (let i = 0; i < raw.length; i++) {\n if (raw[i] === null) continue; // yaml.v3 drops a null list element\n const code = issues.stringAt(raw[i], `compliance.residency[${i}]`);\n if (code === null) return null;\n codes.push(code);\n }\n if (codes.length === 0) return null;\n const eu = new Set(CFG.euResidencyCodes);\n return codes.every((c) => eu.has(goTrimSpace(c).toUpperCase())) ? codes : null;\n}\n\n/** The provider segment of `ai://<provider>/<operation>`: present only when a slash follows it. */\nfunction aiProvider(executor: string): string {\n const prefix = CFG.aiProtocol + CFG.protocolSeparator;\n if (!executor.startsWith(prefix)) return '';\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n const provider = slash > 0 ? rest.slice(0, slash) : '';\n return provider.includes(TEMPLATE_ACTION_OPEN) ? '' : provider;\n}\n\nfunction isRegionLane(provider: string): boolean {\n const literal = literalOrEmpty(provider);\n return literal !== '' && CFG.regionLaneProviders.includes(literal.toLowerCase());\n}\n\n/** The reference's `query[key].(string)`, non-empty after trimming. */\nfunction nonBlankString(m: unknown, key: string): boolean {\n const v = own(m, key);\n return typeof v === 'string' && goTrimSpace(v) !== '';\n}\n\n/** The reference's `getBoolParam`: a bool, or one of the strings true / 1 / yes. */\nfunction queryEnforcesRegion(query: unknown): boolean {\n const v = own(query, CFG.enforceRegionParam);\n if (typeof v === 'boolean') return v;\n return typeof v === 'string' && CFG.enforceRegionTrueStrings.includes(v);\n}\n\n/** executor_config.<provider>.base_url names the host (the author chose it). */\nfunction flowDirectsEndpoint(flow: Flow, provider: string, issues: Issues): boolean {\n const key = provider.toLowerCase();\n const inst = own(own(flow, 'executor_config'), key);\n if (!isRecord(inst)) return false;\n const baseUrl = issues.stringOf(inst, 'base_url', `executor_config.${key}`);\n return baseUrl !== null && goTrimSpace(baseUrl) !== '';\n}\n\nfunction callPinsEndpoint(flow: Flow, provider: string, query: unknown, issues: Issues): boolean {\n if (nonBlankString(query, CFG.regionParam)) return true;\n if (queryEnforcesRegion(query)) return true;\n if (nonBlankString(query, provider.toLowerCase() + CFG.baseUrlParamSuffix)) return true;\n return flowDirectsEndpoint(flow, provider, issues);\n}\n\nexport function validateResidencyEnforcement(flow: Flow, issues: Issues): void {\n const residency = euOnlyResidency(flow, issues);\n if (residency === null) return;\n const warn = (\n site: string,\n field: string,\n stepId: string | undefined,\n provider: string,\n ): void => {\n issues.warn({\n field,\n ...(stepId === undefined ? {} : { stepId }),\n code: CFG.code,\n message: sprintf(CFG.messageFormat, site, provider, `[${residency.join(' ')}]`),\n suggestion: CFG.suggestion,\n });\n };\n\n const steps = flow.steps;\n if (isRecord(steps)) {\n for (const stepId of Object.keys(steps).sort()) {\n const step = steps[stepId];\n if (!isRecord(step)) continue;\n const calls: { executor: string; query: unknown; subId: string | null }[] = [\n {\n executor: issues.stringOf(step, 'executor', `steps.${stepId}`) ?? '',\n query: own(step, 'query'),\n subId: null,\n },\n ];\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n calls.push({\n executor: issues.stringOf(sub.raw, 'executor', sub.basePath) ?? '',\n query: own(sub.raw, 'query'),\n subId: issues.stringOf(sub.raw, 'id', sub.basePath) ?? '',\n });\n }\n for (const call of calls) {\n const provider = aiProvider(call.executor);\n if (!isRegionLane(provider)) continue;\n if (callPinsEndpoint(flow, provider, call.query, issues)) continue;\n if (call.subId === null) {\n warn(\n sprintf(CFG.siteStepFormat, stepId),\n sprintf(CFG.stepFieldFormat, stepId),\n stepId,\n provider,\n );\n } else {\n warn(\n sprintf(CFG.siteLoopStepFormat, call.subId, stepId),\n sprintf(CFG.loopStepFieldFormat, stepId, call.subId),\n stepId,\n provider,\n );\n }\n }\n }\n }\n\n warnOrchestrator(flow, issues, warn);\n}\n\n/**\n * The orchestrator's provider is `execution.provider` of its exons frontmatter.\n * A document this validator cannot read the way the engine would (a tag in the\n * frontmatter, undecodable YAML) is skipped: no provider is known.\n */\nfunction warnOrchestrator(\n flow: Flow,\n issues: Issues,\n warn: (site: string, field: string, stepId: string | undefined, provider: string) => void,\n): void {\n const orch: unknown = flow.orchestrator;\n if (!isRecord(orch)) return;\n const source = issues.stringOf(orch, 'exons', 'orchestrator');\n if (source === null || source === '') return;\n const report = inspectExonsFrontmatter(source);\n if (report.parseError !== null || !report.specRead || !report.hasSpec) return;\n const provider = literalOrEmpty(report.provider);\n if (!isRegionLane(provider)) return;\n const region = issues.stringOf(orch, 'region', 'orchestrator');\n if (region !== null && goTrimSpace(region) !== '') return;\n if (orch.enforce_region === true) return;\n if (flowDirectsEndpoint(flow, provider, issues)) return;\n warn(CFG.siteOrchestrator, CFG.orchestratorField, undefined, provider);\n}\n","// The `examples:` block: concrete cases (an input, what a good result looks\n// like, why the case matters) recorded inside the flow document.\n//\n// Port of the reference's single examples walker. The engine never reads this\n// block; the validator is its only reader here, so every rule is a save-time\n// judgement of the DOCUMENT. The walker is PURE and OFFLINE: it never fetches a\n// reference and never resolves a host.\n//\n// Findings carry their own severity (the spec's `examples.codes` states it once\n// per code and a test holds the two together). Messages are the reference's own\n// wording, with the path carried in `field`.\n//\n// What differs from the reference is listed in PARITY.md (\"The examples block\"):\n// the inline `input` is judged by a NARROWED check (unknown field, required,\n// value kind, enum membership — no length/min/max/pattern/date-format), a\n// `matches` pattern is judged by length only (RE2 and JS RegExp disagree about\n// what compiles), and `example_ref_blocked_host` is not ported.\n\nimport type { Flow } from '../types.js';\nimport { EXAMPLES } from '../spec/index.js';\nimport { goParseURLParts, goQueryKeys, goToLower, goTrimSpace } from './goUrl.js';\nimport { Issues, isRecord } from './util.js';\n\ntype Rec = Record<string, unknown>;\ntype Severity = 'error' | 'warning';\n\ninterface Finding {\n code: string;\n severity: Severity;\n field: string;\n message: string;\n suggestion?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Vocabulary the spec does not carry as a list of its own.\n// ---------------------------------------------------------------------------\n\nconst KEY_EXAMPLES = 'examples';\nconst VISIBILITY_PUBLIC = 'public';\nconst STATUS_COMPLETED = 'completed';\nconst STATUS_FAILED = 'failed';\nconst STATUS_PAUSED_FOR_HUMAN = 'paused_for_human';\nconst ORIGIN_NONE = '';\nconst SIDE_EFFECTS_NONE = '';\nconst SCHEME_HTTPS = 'https';\nconst FILE_REF_KEYS: ReadonlySet<string> = new Set(['url', 'sha256', 'media_type', 'note']);\nconst FILE_REF_KEY = 'ref';\nconst TYPE_SECRET = 'secret';\nconst TYPE_FILE = 'file';\nconst TYPE_STRING = 'string';\nconst TYPE_MULTILINE = 'multiline';\nconst TYPE_NUMBER = 'number';\nconst TYPE_BOOL = 'bool';\nconst TYPE_ENUM = 'enum';\nconst TYPE_ARRAY_OF_STRINGS = 'array_of_strings';\nconst TYPE_DATE = 'date';\n/** How deep a value is followed (the reference's own bound on a self-referential alias). */\nconst MAX_RECURSION_DEPTH = 32;\n/** The one status a checkpoint may not name and an expectation may omit. */\nconst TEXTUAL_MEDIA_BASES: ReadonlySet<string> = new Set([\n 'application/json',\n 'application/xml',\n 'application/yaml',\n 'application/x-yaml',\n 'application/markdown',\n]);\n\nconst SUGGESTION_ID =\n 'Pick a short stable name such as standard_invoice; it is the key results are filed under, so it never changes once saved';\nconst SUGGESTION_CHECKPOINT = 'Did you rename the step? Update the checkpoint to the new name';\nconst SUGGESTION_SECRET_VALUE = 'Remove the value; you are asked for it when you run the check';\nconst SUGGESTION_EXPECTED =\n 'Add at least a rubric: one or two sentences on what a good result looks like';\n\n// ---------------------------------------------------------------------------\n// Go formatting helpers (the reference's messages are Go `Sprintf` output).\n// ---------------------------------------------------------------------------\n\nconst utf8Encoder = new TextEncoder();\n\nfunction byteLen(s: string): number {\n return utf8Encoder.encode(s).length;\n}\n\n/** Go's `utf8.RuneCountInString`. */\nfunction runeCount(s: string): number {\n let n = 0;\n for (const _ of s) n++;\n return n;\n}\n\n/** Go's `%q` for a string. */\nfunction q(s: string): string {\n let out = '\"';\n for (const ch of s) {\n const c = ch.codePointAt(0) as number;\n if (ch === '\"') out += '\\\\\"';\n else if (ch === '\\\\') out += '\\\\\\\\';\n else if (c === 0x07) out += '\\\\a';\n else if (c === 0x08) out += '\\\\b';\n else if (c === 0x0c) out += '\\\\f';\n else if (c === 0x0a) out += '\\\\n';\n else if (c === 0x0d) out += '\\\\r';\n else if (c === 0x09) out += '\\\\t';\n else if (c === 0x0b) out += '\\\\v';\n else if (c < 0x20 || c === 0x7f) out += `\\\\x${c.toString(16).padStart(2, '0')}`;\n else if (c >= 0x80 && /[\\p{C}\\p{Z}]/u.test(ch)) {\n out +=\n c > 0xffff\n ? `\\\\U${c.toString(16).padStart(8, '0')}`\n : `\\\\u${c.toString(16).padStart(4, '0')}`;\n } else out += ch;\n }\n return `${out}\"`;\n}\n\n/** Go `%v` for a float64: the shortest representation, in exponent form below 1e-4 and from 1e6 up. */\nfunction num(n: number): string {\n if (Number.isNaN(n)) return 'NaN';\n if (n === Infinity) return '+Inf';\n if (n === -Infinity) return '-Inf';\n if (n === 0) return Object.is(n, -0) ? '-0' : '0';\n const [mantissa = '', exponent = '0'] = n.toExponential().split('e');\n const exp = Number(exponent);\n if (exp < -4 || exp >= 6) {\n const sign = exp < 0 ? '-' : '+';\n return `${mantissa}e${sign}${String(Math.abs(exp)).padStart(2, '0')}`;\n }\n return String(n);\n}\n\nfunction has(o: Rec, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(o, key) && o[key] !== null && o[key] !== undefined;\n}\n\nfunction own(o: Rec, key: string): unknown {\n return Object.prototype.hasOwnProperty.call(o, key) ? o[key] : undefined;\n}\n\nfunction setOwn(o: Rec, key: string, value: unknown): void {\n Object.defineProperty(o, key, {\n value,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n}\n\nfunction sortedKeys(o: Rec): string[] {\n return Object.keys(o).sort();\n}\n\n/** A Go `*float64` read: a YAML number, or absent. */\nfunction numberOf(v: unknown): number | undefined {\n return typeof v === 'number' ? v : undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Values: normalisation and the RFC 7386 merge patch.\n// ---------------------------------------------------------------------------\n\n/**\n * Turn what a loader may hand over into something a live run would receive: a\n * date object (a loader that resolves timestamps) becomes the string a JSON\n * body carries, and depth is bounded so a self-referential alias terminates.\n * The `yaml` package this validator parses with leaves a date a string, so for\n * parsed text this is the identity.\n */\nfunction normalize(v: unknown, depth: number): unknown {\n if (depth > MAX_RECURSION_DEPTH) return null;\n if (v instanceof Date) {\n if (Number.isNaN(v.getTime())) return null;\n const iso = v.toISOString();\n if (/T00:00:00\\.000Z$/.test(iso)) return iso.slice(0, 10);\n return iso.replace(/\\.000Z$/, 'Z');\n }\n if (Array.isArray(v)) return v.map((x) => normalize(x, depth + 1));\n if (isRecord(v)) {\n const out: Rec = {};\n for (const k of Object.keys(v)) setOwn(out, k, normalize(v[k], depth + 1));\n return out;\n }\n return v;\n}\n\nfunction deepCopy(v: unknown, depth: number): unknown {\n if (depth > MAX_RECURSION_DEPTH) return v;\n if (Array.isArray(v)) return v.map((x) => deepCopy(x, depth + 1));\n if (isRecord(v)) {\n const out: Rec = {};\n for (const k of Object.keys(v)) setOwn(out, k, deepCopy(v[k], depth + 1));\n return out;\n }\n return v;\n}\n\nfunction mergePatch(target: Rec, patch: Rec, depth: number): void {\n if (depth > MAX_RECURSION_DEPTH) return;\n for (const k of Object.keys(patch)) {\n const pv = patch[k];\n if (pv === null || pv === undefined) {\n delete target[k];\n continue;\n }\n if (isRecord(pv)) {\n const current = own(target, k);\n const existing: Rec = isRecord(current) ? (deepCopy(current, 0) as Rec) : {};\n mergePatch(existing, pv, depth + 1);\n setOwn(target, k, existing);\n continue;\n }\n setOwn(target, k, deepCopy(pv, 0));\n }\n}\n\n/**\n * RFC 7386 JSON Merge Patch: a mapping merges recursively, null deletes the\n * key, anything else replaces. The base is never mutated and the result shares\n * no object with either argument.\n */\nexport function applyExamplePatch(base: Rec, patch: Rec): Rec {\n const out = deepCopy(base, 0) as Rec;\n mergePatch(out, patch, 0);\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// The file reference\n// ---------------------------------------------------------------------------\n\ninterface FileRef {\n url: string;\n sha256: string;\n mediaType: string;\n note: string;\n}\n\n/** The mapping shape a file-typed input takes, or null when it is anything else. */\nfunction asFileRef(v: unknown): FileRef | null {\n if (!isRecord(v)) return null;\n const keys = Object.keys(v);\n if (keys.length === 0) return null;\n for (const k of keys) if (!FILE_REF_KEYS.has(k)) return null;\n const str = (k: string): string => {\n const x = own(v, k);\n return typeof x === 'string' ? x : '';\n };\n return {\n url: str('url'),\n sha256: str('sha256'),\n mediaType: str('media_type'),\n note: str('note'),\n };\n}\n\nfunction isTextualMediaType(mediaType: string): boolean {\n const base = goToLower(goTrimSpace((mediaType.split(';')[0] ?? '').toString()));\n if (base.startsWith('text/')) return true;\n if (base.endsWith('+json') || base.endsWith('+xml')) return true;\n return TEXTUAL_MEDIA_BASES.has(base);\n}\n\n// ---------------------------------------------------------------------------\n// The walker\n// ---------------------------------------------------------------------------\n\ntype ExpectKind = 'final' | 'checkpoint';\n\nclass Walker {\n findings: Finding[] = [];\n\n constructor(\n private readonly flow: Flow,\n private readonly issues: Issues,\n ) {}\n\n // -- emit -------------------------------------------------------------\n\n private add(\n severity: Severity,\n code: string,\n field: string,\n message: string,\n suggestion?: string,\n ): void {\n this.findings.push({\n code,\n severity,\n field,\n message,\n ...(suggestion !== undefined ? { suggestion } : {}),\n });\n }\n\n private err(code: string, field: string, message: string, suggestion?: string): void {\n this.add('error', code, field, message, suggestion);\n }\n\n private warn(code: string, field: string, message: string): void {\n this.add('warning', code, field, message);\n }\n\n /** A Go `string` field read by its source text; absent is \"\". */\n private s(o: Rec, key: string, parentPath: string): string {\n return this.issues.stringOf(o, key, parentPath) ?? '';\n }\n\n // -- the set ----------------------------------------------------------\n\n run(examples: unknown[]): void {\n this.validateSet(examples);\n const seen = new Map<string, number>();\n examples.forEach((ex, i) => {\n if (isRecord(ex)) this.validateExample(i, ex, seen);\n });\n }\n\n private validateSet(examples: unknown[]): void {\n const n = examples.length;\n const L = EXAMPLES.limits;\n if (n > L.maxPerFlow) {\n this.err(\n 'examples_too_many',\n KEY_EXAMPLES,\n `flow declares ${n} examples; the limit is ${L.maxPerFlow}`,\n );\n }\n const size = blockBytes(examples);\n if (size !== null && size > L.maxBlockBytes) {\n this.err(\n 'examples_block_too_large',\n KEY_EXAMPLES,\n `the examples block is ${size} bytes; the limit is ${L.maxBlockBytes}. Move large inputs or target outputs to a file reference (https URL).`,\n );\n }\n const allHeld = examples.every((e) => isRecord(e) && own(e, 'hold_out') === true);\n if (allHeld) {\n this.warn(\n 'examples_all_held_out',\n KEY_EXAMPLES,\n 'every example is held out, so nothing is left to tune on',\n );\n }\n if (this.isPublic()) {\n this.warn(\n 'examples_published_with_public_flow',\n KEY_EXAMPLES,\n 'this flow is public, so everyone who can see it can read its examples, including their expected results. Only publish examples you are happy to show.',\n );\n }\n }\n\n private isPublic(): boolean {\n return this.s(this.flow as Rec, 'visibility', '') === VISIBILITY_PUBLIC;\n }\n\n // -- one example ------------------------------------------------------\n\n private validateExample(i: number, ex: Rec, seen: Map<string, number>): void {\n const L = EXAMPLES.limits;\n const path = `examples[${i}]`;\n const id = this.s(ex, 'id', path);\n const label = id === '' ? `#${i + 1}` : id;\n\n // id\n if (id === '') {\n this.err('example_id_missing', `${path}.id`, `example #${i + 1} has no id`, SUGGESTION_ID);\n } else if (!EXAMPLES.idPattern.test(id)) {\n this.err(\n 'example_id_invalid',\n `${path}.id`,\n `example id ${q(id)} is not valid: use lower-case letters, digits and underscores, starting with a letter (2 to 48 characters)`,\n SUGGESTION_ID,\n );\n } else {\n const first = seen.get(id);\n if (first !== undefined) {\n this.err(\n 'example_id_duplicate',\n `${path}.id`,\n `example id ${q(id)} is used by examples #${first + 1} and #${i + 1}`,\n );\n } else {\n seen.set(id, i);\n }\n }\n\n // title\n const title = this.s(ex, 'title', path);\n if (goTrimSpace(title) === '') {\n this.err(\n 'example_title_missing',\n `${path}.title`,\n `example ${q(label)} has no title; the title is what a person sees in the list of examples`,\n );\n } else {\n const n = runeCount(title);\n if (n > L.titleMaxRunes) {\n this.err(\n 'example_title_too_long',\n `${path}.title`,\n `example ${q(label)} title is ${n} characters; the limit is ${L.titleMaxRunes}`,\n );\n }\n }\n\n // guidance / notes\n const guidance = this.s(ex, 'guidance', path);\n if (goTrimSpace(guidance) === '') {\n this.warn(\n 'example_guidance_missing',\n `${path}.guidance`,\n `example ${q(label)} has no guidance. One sentence on why this case matters helps the judge and the next author.`,\n );\n } else {\n const n = runeCount(guidance);\n if (n > L.maxGuidanceRunes) {\n this.err(\n 'example_guidance_too_long',\n `${path}.guidance`,\n `example ${q(label)} guidance is ${n} characters; the limit is ${L.maxGuidanceRunes}`,\n );\n }\n }\n const notesN = runeCount(this.s(ex, 'notes', path));\n if (notesN > L.maxNotesRunes) {\n this.err(\n 'example_notes_too_long',\n `${path}.notes`,\n `example ${q(label)} notes are ${notesN} characters; the limit is ${L.maxNotesRunes}`,\n );\n }\n\n this.validateTags(path, label, own(ex, 'tags'));\n\n // weight, min_score, side_effects\n this.validateWeight(`${path}.weight`, label, numberOf(own(ex, 'weight')));\n const minScore = numberOf(own(ex, 'min_score'));\n if (minScore !== undefined && !scoreInRange(minScore)) {\n this.err(\n 'example_min_score_range',\n `${path}.min_score`,\n `example ${q(label)} has min_score ${num(minScore)}; use a number from 0 to 1 (0.7 is 7.3 out of 10)`,\n );\n }\n const sideEffects = this.s(ex, 'side_effects', path);\n if (sideEffects !== SIDE_EFFECTS_NONE && !EXAMPLES.sideEffects.has(sideEffects)) {\n this.err(\n 'example_side_effects_invalid',\n `${path}.side_effects`,\n `example ${q(label)} has side_effects ${q(sideEffects)}; use refuse or allow`,\n );\n }\n\n // hold_out on a public flow\n const holdOut = own(ex, 'hold_out') === true;\n if (holdOut && this.isPublic()) {\n this.err(\n 'example_holdout_in_public_flow',\n `${path}.hold_out`,\n `example ${q(label)} is held out but this flow is public: a held-out example must stay private, and a public flow's definition is readable by everyone. Make the flow private or remove hold_out.`,\n );\n }\n\n // input / input_ref\n const hasInput = has(ex, 'input');\n const hasInputRef = has(ex, 'input_ref');\n if (hasInput && hasInputRef) {\n this.err(\n 'example_input_conflict',\n path,\n `example ${q(label)} sets both input and input_ref; use exactly one`,\n );\n } else if (!hasInput && !hasInputRef) {\n this.err(\n 'example_input_missing',\n path,\n `example ${q(label)} has neither input nor input_ref; use input: {} for a flow that takes no input`,\n );\n }\n const rawInput = own(ex, 'input');\n const baseInput: Rec | null = isRecord(rawInput) ? rawInput : null;\n if (baseInput !== null) {\n this.checkInput(`${path}.input`, label, baseInput, 'example_input_invalid');\n }\n const rawInputRef = own(ex, 'input_ref');\n if (isRecord(rawInputRef)) {\n this.validateFileRef(`${path}.input_ref`, this.fileRefOf(rawInputRef, `${path}.input_ref`));\n }\n\n // expected\n let binaryOnly = false;\n const expected = own(ex, 'expected');\n if (!has(ex, 'expected')) {\n this.err(\n 'example_expected_missing',\n `${path}.expected`,\n `example ${q(label)} does not say what a good result is: add a rubric, fields, exact or reference`,\n SUGGESTION_EXPECTED,\n );\n } else if (isRecord(expected)) {\n this.validateExpectation(`${path}.expected`, label, expected, 'final', '');\n binaryOnly = this.expectationIsBinaryReferenceOnly(expected, `${path}.expected`);\n }\n if (binaryOnly) {\n this.warn(\n 'examples_unreadable_by_judge',\n `${path}.expected`,\n 'this example can be run but not scored',\n );\n }\n\n // checkpoints\n this.validateCheckpoints(path, label, own(ex, 'checkpoints'));\n\n // variants\n this.validateVariants(i, path, label, ex, hasInput, baseInput);\n\n // credential-shaped literals anywhere in the example\n this.scanSecretLike(i, path, ex);\n }\n\n private validateTags(path: string, label: string, tags: unknown): void {\n if (!Array.isArray(tags)) return;\n if (tags.length > EXAMPLES.limits.maxTags) {\n this.err(\n 'example_tag_invalid',\n `${path}.tags`,\n `example ${q(label)} has ${tags.length} tags; the limit is ${EXAMPLES.limits.maxTags}`,\n );\n }\n const seen = new Set<string>();\n tags.forEach((item: unknown, j: number) => {\n const field = `${path}.tags[${j}]`;\n const tag = item === null ? '' : (this.issues.stringAt(item, field) ?? null);\n if (tag === null) return;\n if (!EXAMPLES.tagPattern.test(tag)) {\n this.err('example_tag_invalid', field, `example ${q(label)} has an invalid tag ${q(tag)}`);\n } else if (seen.has(tag)) {\n this.err(\n 'example_tag_invalid',\n field,\n `example ${q(label)} lists the tag ${q(tag)} more than once`,\n );\n }\n seen.add(tag);\n });\n }\n\n private validateWeight(field: string, label: string, weight: number | undefined): void {\n if (weight === undefined) return;\n if (Number.isNaN(weight) || weight <= 0 || weight > EXAMPLES.limits.weightMax) {\n this.err(\n 'example_weight_range',\n field,\n `example ${q(label)} has weight ${num(weight)}; use a number above 0 and at most 10`,\n );\n }\n }\n\n // -- input ------------------------------------------------------------\n\n /**\n * Judge one inline input map (an example's `input`, or a variant's patched\n * input). NARROWED relative to the reference, which runs its full value\n * validator: here an unknown field, a missing required field, a value of the\n * wrong KIND and an enum value outside its list are judged; length, range,\n * pattern and date-format constraints are not (PARITY.md).\n */\n private checkInput(field: string, label: string, raw: Rec, code: string): void {\n const input = (normalize(raw, 0) as Rec | null) ?? {};\n const L = EXAMPLES.limits;\n const size = jsonBytes(input);\n if (size !== null && size > L.maxInlineInputBytes) {\n this.err(\n 'example_input_too_large',\n field,\n `example ${q(label)} input is ${size} bytes; the limit is ${L.maxInlineInputBytes}. Put the large part behind an https file reference.`,\n );\n return;\n }\n const schema = own(this.flow as Rec, 'input_schema');\n const query = own(this.flow as Rec, 'query');\n if (isRecord(schema)) {\n this.checkInputAgainstSchema(field, label, input, schema, code);\n } else if (isRecord(query) && Object.keys(query).length > 0) {\n const declared = sortedKeys(query);\n for (const k of sortedKeys(input)) {\n if (!Object.prototype.hasOwnProperty.call(query, k)) {\n this.err(\n code,\n `${field}.${k}`,\n `example ${q(label)}: ${q(k)} is not a declared input of this flow (declared: ${declared.join(', ')})`,\n );\n }\n }\n } else {\n this.warn(\n 'example_input_unvalidated',\n field,\n `example ${q(label)} cannot be checked: the flow declares no input_schema and no query parameters.`,\n );\n }\n }\n\n private checkInputAgainstSchema(\n field: string,\n label: string,\n input: Rec,\n schema: Rec,\n code: string,\n ): void {\n const fields = this.schemaFields(schema);\n const byName = new Map<string, SchemaField>();\n for (const f of fields) byName.set(f.name, f);\n\n // Build the run input: a file reference in a file-typed field becomes\n // {ref: <url>}; a secret-typed value is reported and removed (a secret is\n // never judged — the person running the evaluation supplies it).\n const runInput: Rec = {};\n for (const name of sortedKeys(input)) {\n const val = input[name];\n const f = byName.get(name);\n const present = val !== null && val !== undefined;\n if (f !== undefined && f.type === TYPE_SECRET) {\n if (present) {\n this.err(\n 'example_secret_value',\n `${field}.${name}`,\n `example ${q(label)} gives a value for ${q(name)}, which is a secret field. Examples are saved inside the flow and are never allowed to hold secrets; remove it. The person running the evaluation is asked for it at run time.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n continue;\n }\n if (f !== undefined && f.type === TYPE_FILE && present) {\n const ref = asFileRef(val);\n if (ref === null) {\n this.err(\n 'example_file_input_needs_ref',\n `${field}.${name}`,\n `example ${q(label)}: field ${q(name)} is a file; give it as {url: \"https://…\"}. A pasted upload id would stop working as soon as the session ends.`,\n );\n continue;\n }\n this.validateFileRef(`${field}.${name}`, ref);\n setOwn(runInput, name, { [FILE_REF_KEY]: ref.url });\n continue;\n }\n setOwn(runInput, name, val);\n }\n\n for (const failure of this.judgeRun(fields, byName, runInput)) {\n // A required secret nobody may supply here is not an error at save: it\n // makes the case needs-secret at run time.\n if (failure.required) {\n const f = byName.get(failure.field);\n if (f !== undefined && f.type === TYPE_SECRET) continue;\n }\n const at = failure.field !== '' ? `${field}.${failure.field}` : field;\n this.err(code, at, `example ${q(label)}: ${failure.message}`);\n }\n }\n\n private schemaFields(schema: Rec): SchemaField[] {\n const raw = own(schema, 'fields');\n if (!Array.isArray(raw)) return [];\n const out: SchemaField[] = [];\n raw.forEach((f: unknown, i: number) => {\n if (!isRecord(f)) return;\n const base = `input_schema.fields[${i}]`;\n const enumRaw = own(f, 'enum');\n const enumValues: string[] = [];\n if (Array.isArray(enumRaw)) {\n enumRaw.forEach((e: unknown, j: number) => {\n enumValues.push(e === null ? '' : (this.issues.stringAt(e, `${base}.enum[${j}]`) ?? ''));\n });\n }\n const vw = own(f, 'visible_when');\n out.push({\n name: this.s(f, 'name', base),\n type: this.s(f, 'type', base),\n required: own(f, 'required') === true,\n enumValues,\n visibleWhen: isRecord(vw)\n ? {\n field: this.s(vw, 'field', `${base}.visible_when`),\n equals: own(vw, 'equals'),\n in: Array.isArray(own(vw, 'in')) ? (own(vw, 'in') as unknown[]) : [],\n }\n : null,\n });\n });\n return out;\n }\n\n /** The narrowed run-time judgement: required, kind, enum, unknown field. */\n private judgeRun(\n fields: SchemaField[],\n byName: Map<string, SchemaField>,\n runInput: Rec,\n ): RunFailure[] {\n const failures: RunFailure[] = [];\n for (const f of fields) {\n if (!isVisible(f, runInput)) continue;\n const raw = own(runInput, f.name);\n if (raw === undefined || raw === null) {\n if (f.required) {\n failures.push({\n field: f.name,\n message: `input field ${q(f.name)} is required`,\n required: true,\n });\n }\n continue;\n }\n failures.push(...inputValueFailures(f, raw));\n }\n for (const k of sortedKeys(runInput)) {\n if (!byName.has(k)) {\n failures.push({\n field: k,\n message: `input field ${q(k)} is not declared in input_schema`,\n required: false,\n });\n }\n }\n return failures;\n }\n\n // -- file reference ---------------------------------------------------\n\n private fileRefOf(rec: Rec, path: string): FileRef {\n return {\n url: this.s(rec, 'url', path),\n sha256: this.s(rec, 'sha256', path),\n mediaType: this.s(rec, 'media_type', path),\n note: this.s(rec, 'note', path),\n };\n }\n\n private validateFileRef(field: string, ref: FileRef): void {\n const L = EXAMPLES.limits;\n const raw = ref.url;\n const invalid = 'the file reference needs a url of at most 2048 characters';\n if (raw === '' || byteLen(raw) > L.maxUrlBytes) {\n this.err('example_ref_invalid', field, invalid);\n return;\n }\n const u = goParseURLParts(raw);\n if (u === null) {\n this.err('example_ref_invalid', field, invalid);\n return;\n }\n const scheme = u.scheme.toLowerCase();\n if (EXAMPLES.reservedRefSchemes.has(scheme)) {\n this.err(\n 'example_ref_scheme_reserved',\n field,\n `${scheme}: references are not available yet. Use an https URL, or paste the text into the example.`,\n );\n return;\n }\n if (scheme !== SCHEME_HTTPS) {\n this.err(\n 'example_ref_scheme',\n field,\n `only https:// references are allowed (got ${q(scheme)})`,\n );\n return;\n }\n if (u.hasUser || u.fragment !== '' || raw.includes('#') || u.host === '') {\n this.err('example_ref_invalid', field, 'a reference must not carry a login or a fragment');\n return;\n }\n // The reference's blocked-host rule (a private or local address) is not\n // ported: it reuses the server's own address tables (PARITY.md).\n if (ref.sha256 !== '' && !EXAMPLES.sha256Pattern.test(ref.sha256)) {\n this.err(\n 'example_ref_sha256_invalid',\n field,\n 'sha256 must be 64 lowercase hexadecimal characters',\n );\n }\n if (ref.mediaType !== '' && !EXAMPLES.mediaTypePattern.test(ref.mediaType)) {\n this.err(\n 'example_ref_media_type_invalid',\n field,\n `media_type ${q(ref.mediaType)} must look like type/subtype`,\n );\n }\n const noteN = runeCount(ref.note);\n if (noteN > L.maxNoteRunes) {\n this.err(\n 'example_ref_invalid',\n field,\n `the note is ${noteN} characters; the limit is ${L.maxNoteRunes}`,\n );\n }\n if (ref.sha256 === '') {\n this.warn(\n 'example_ref_unpinned',\n field,\n 'this reference is not pinned. If the file at that address changes, your scores change with it. Add sha256 to freeze it.',\n );\n }\n for (const key of goQueryKeys(u.rawQuery)) {\n if (EXAMPLES.signedUrlQueryKeyPattern.test(key)) {\n this.warn(\n 'example_ref_signed_url',\n field,\n 'this address looks like a signed link. Anyone who can read the flow can use it until it expires, and it will stop working. Prefer a stable public address.',\n );\n break;\n }\n }\n }\n\n // -- expectation ------------------------------------------------------\n\n /** The names `fields` / `exact` may use, and whether such a list is declared at all. */\n private outputNamesFor(kind: ExpectKind, stepId: string): { names: string[]; declared: boolean } {\n if (kind === 'final') {\n const out = own(this.flow as Rec, 'output');\n const names: string[] = [];\n if (Array.isArray(out)) {\n out.forEach((item: unknown, i: number) => {\n names.push(item === null ? '' : (this.issues.stringAt(item, `output[${i}]`) ?? ''));\n });\n }\n return { names, declared: names.length > 0 };\n }\n const steps = own(this.flow as Rec, 'steps');\n const step = isRecord(steps) ? own(steps, stepId) : undefined;\n const schema = isRecord(step) ? own(step, 'output_schema') : undefined;\n const fields = isRecord(schema) ? own(schema, 'fields') : undefined;\n if (!Array.isArray(fields) || fields.length === 0) return { names: [], declared: false };\n const names: string[] = [];\n fields.forEach((f: unknown, i: number) => {\n if (isRecord(f)) names.push(this.s(f, 'name', `steps.${stepId}.output_schema.fields[${i}]`));\n });\n return { names, declared: true };\n }\n\n private validateExpectation(\n path: string,\n label: string,\n e: Rec,\n kind: ExpectKind,\n stepId: string,\n ): void {\n const L = EXAMPLES.limits;\n\n // status\n const status = this.s(e, 'status', path);\n if (status !== '' && !EXAMPLES.statuses.has(status)) {\n this.err(\n 'example_status_invalid',\n `${path}.status`,\n 'status must be completed, failed or paused_for_human',\n );\n }\n const noOutput = status === STATUS_FAILED || status === STATUS_PAUSED_FOR_HUMAN;\n const fieldsRec = own(e, 'fields');\n const exactRec = own(e, 'exact');\n const fieldKeys = isRecord(fieldsRec) ? sortedKeys(fieldsRec) : [];\n const exactKeys = isRecord(exactRec) ? sortedKeys(exactRec) : [];\n const hasFields = fieldKeys.length > 0;\n const hasExact = exactKeys.length > 0;\n if (hasFields && hasExact) {\n this.err(\n 'example_expected_conflict',\n path,\n 'use fields (some fields) or exact (the whole result), not both',\n );\n } else if (noOutput && (hasFields || hasExact)) {\n this.err(\n 'example_expected_conflict',\n path,\n `a case that ends in ${status} has no output to match; remove fields and exact, or expect status completed`,\n );\n }\n\n // min_score\n const minScore = numberOf(own(e, 'min_score'));\n if (minScore !== undefined && !scoreInRange(minScore)) {\n this.err(\n 'example_min_score_range',\n `${path}.min_score`,\n `min_score ${num(minScore)} is out of range; use a number from 0 to 1`,\n );\n }\n\n // rubric\n const rubric = this.s(e, 'rubric', path);\n if (rubric !== '') {\n if (goTrimSpace(rubric) === '') {\n this.err(\n 'example_rubric_empty',\n `${path}.rubric`,\n 'the rubric is empty; write what a good result looks like, or remove it',\n );\n } else {\n const n = runeCount(rubric);\n if (n > L.maxRubricRunes) {\n this.err(\n 'example_rubric_too_long',\n `${path}.rubric`,\n `the rubric is ${n} characters; the limit is ${L.maxRubricRunes}`,\n );\n }\n }\n }\n\n // reference\n const reference = own(e, 'reference');\n if (isRecord(reference)) this.validateReference(`${path}.reference`, reference);\n\n // fields / exact keys\n const { names, declared } = this.outputNamesFor(kind, stepId);\n const checkKey = (field: string, key: string): void => {\n if (!declared && kind === 'final') {\n this.warn(\n 'example_expected_field_unchecked',\n field,\n `this flow declares no output list, so ${q(key)} cannot be checked against it`,\n );\n } else if (!declared) {\n this.warn(\n 'example_expected_field_unchecked',\n field,\n `this step declares no output_schema, so ${q(key)} cannot be checked against it`,\n );\n } else if (!names.includes(key)) {\n this.err(\n 'example_expected_field_unknown',\n field,\n kind === 'checkpoint'\n ? `${q(key)} is not a field this step declares in its output_schema (declared: ${names.join(', ')})`\n : `${q(key)} is not an output of this flow (outputs: ${names.join(', ')})`,\n );\n }\n };\n for (const key of fieldKeys) {\n const fpath = `${path}.fields.${key}`;\n checkKey(fpath, key);\n const matcher = own(fieldsRec as Rec, key);\n if (isRecord(matcher)) this.validateFieldMatcher(fpath, matcher);\n }\n for (const key of exactKeys) checkKey(`${path}.exact.${key}`, key);\n\n // must_not / must_not_contain\n const mustNot = this.stringList(own(e, 'must_not'), `${path}.must_not`);\n const mustNotContain = this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`);\n const mustNotMsg = `must_not takes up to ${L.maxMustNot} statements of at most ${L.maxMustNotRunes} characters each, none empty`;\n if (mustNot.length > L.maxMustNot) {\n this.err('example_must_not_invalid', `${path}.must_not`, mustNotMsg);\n }\n mustNot.forEach((item, j) => {\n if (goTrimSpace(item) === '' || runeCount(item) > L.maxMustNotRunes) {\n this.err('example_must_not_invalid', `${path}.must_not[${j}]`, mustNotMsg);\n }\n });\n const mncMsg = `must_not_contain takes up to ${L.maxMustNotContain} literals of 1 to ${L.maxMustNotContainLength} characters each`;\n if (mustNotContain.length > L.maxMustNotContain) {\n this.err('example_must_not_contain_invalid', `${path}.must_not_contain`, mncMsg);\n }\n mustNotContain.forEach((item, j) => {\n const n = runeCount(item);\n if (n === 0 || n > L.maxMustNotContainLength) {\n this.err('example_must_not_contain_invalid', `${path}.must_not_contain[${j}]`, mncMsg);\n }\n });\n for (const key of fieldKeys) {\n const matcher = own(fieldsRec as Rec, key);\n if (!isRecord(matcher)) continue;\n const eq = own(matcher, 'equals');\n if (typeof eq !== 'string' || eq === '') continue;\n for (const banned of mustNotContain) {\n if (banned !== '' && equalFold(banned, eq)) {\n this.warn(\n 'example_expectation_contradiction',\n `${path}.fields.${key}`,\n `${q(banned)} is required by ${q(key)} and forbidden by must_not_contain`,\n );\n }\n }\n }\n\n // A checkpoint cannot name a status.\n if (kind === 'checkpoint' && status !== '') {\n this.err(\n 'example_checkpoint_status',\n `${path}.status`,\n `example ${q(label)}: a checkpoint cannot set status; status describes how the whole run ends`,\n );\n }\n\n // checks nothing\n if (\n rubric === '' &&\n !has(e, 'reference') &&\n !hasFields &&\n !hasExact &&\n mustNot.length === 0 &&\n mustNotContain.length === 0 &&\n (status === '' || status === STATUS_COMPLETED)\n ) {\n this.err(\n 'example_expected_empty',\n path,\n 'this expectation checks nothing; add a rubric, fields, exact, reference, must_not or must_not_contain',\n SUGGESTION_EXPECTED,\n );\n }\n }\n\n /** A Go `[]string` read: scalars by their text, null as \"\", anything else dropped. */\n private stringList(v: unknown, path: string): string[] {\n if (!Array.isArray(v)) return [];\n const out: string[] = [];\n v.forEach((item: unknown, j: number) => {\n if (item === null) out.push('');\n else {\n const t = this.issues.stringAt(item, `${path}[${j}]`);\n if (t !== null) out.push(t);\n }\n });\n return out;\n }\n\n private validateReference(path: string, r: Rec): void {\n const text = this.s(r, 'text', path);\n const hasText = text !== '';\n const hasRef = has(r, 'ref');\n if (hasText === hasRef) {\n this.err('example_reference_invalid', path, 'a reference needs exactly one of text or ref');\n return;\n }\n if (hasText) {\n const n = byteLen(text);\n if (n > EXAMPLES.limits.maxReferenceTextBytes) {\n this.err(\n 'example_reference_invalid',\n path,\n `the reference text is ${n} bytes; the limit is ${EXAMPLES.limits.maxReferenceTextBytes}. Put it behind an https file reference.`,\n );\n }\n return;\n }\n const refRec = own(r, 'ref');\n if (!isRecord(refRec)) return;\n const ref = this.fileRefOf(refRec, `${path}.ref`);\n this.validateFileRef(`${path}.ref`, ref);\n if (ref.mediaType !== '' && !isTextualMediaType(ref.mediaType)) {\n this.warn(\n 'example_reference_binary',\n path,\n 'this reference is not text, so it cannot be compared in this version; the example will be skipped, not failed.',\n );\n }\n }\n\n private expectationIsBinaryReferenceOnly(e: Rec, path: string): boolean {\n const reference = own(e, 'reference');\n const refRec = isRecord(reference) ? own(reference, 'ref') : undefined;\n if (!isRecord(refRec)) return false;\n const mediaType = this.s(refRec, 'media_type', `${path}.reference.ref`);\n if (mediaType === '' || isTextualMediaType(mediaType)) return false;\n const status = this.s(e, 'status', path);\n const fields = own(e, 'fields');\n const exact = own(e, 'exact');\n return (\n this.s(e, 'rubric', path) === '' &&\n !(isRecord(fields) && Object.keys(fields).length > 0) &&\n !(isRecord(exact) && Object.keys(exact).length > 0) &&\n this.stringList(own(e, 'must_not'), `${path}.must_not`).length === 0 &&\n this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`).length === 0 &&\n (status === '' || status === STATUS_COMPLETED)\n );\n }\n\n private validateFieldMatcher(path: string, m: Rec): void {\n const L = EXAMPLES.limits;\n const matches = this.s(m, 'matches', path);\n const oneOf = own(m, 'one_of');\n const approx = numberOf(own(m, 'approx'));\n const tolerance = numberOf(own(m, 'tolerance'));\n let operators = 0;\n if (has(m, 'equals')) operators++;\n if (this.s(m, 'contains', path) !== '') operators++;\n if (this.s(m, 'not_contains', path) !== '') operators++;\n if (matches !== '') operators++;\n if (Array.isArray(oneOf) && oneOf.length > 0) operators++;\n if (approx !== undefined) operators++;\n if (typeof own(m, 'present') === 'boolean') operators++;\n if (operators !== 1) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n 'write exactly one of equals, contains, not_contains, matches, one_of, approx, present',\n );\n return;\n }\n // Only the length is judged: whether a pattern COMPILES is a question for\n // the reference's regular-expression engine, which this port is not.\n if (matches !== '' && byteLen(matches) > L.maxPatternLength) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n `the pattern in matches must be a valid regular expression of at most ${L.maxPatternLength} characters`,\n );\n }\n // approx needs its tolerance, and tolerance belongs to approx alone.\n if (\n (approx !== undefined) !== (tolerance !== undefined) ||\n (tolerance !== undefined && (Number.isNaN(tolerance) || tolerance < 0))\n ) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n 'approx needs a tolerance (a number, zero or more) beside it, and tolerance is only for approx',\n );\n }\n }\n\n // -- checkpoints ------------------------------------------------------\n\n private validateCheckpoints(path: string, label: string, cps: unknown): void {\n if (!isRecord(cps) || Object.keys(cps).length === 0) return;\n const stepsRaw = own(this.flow as Rec, 'steps');\n const steps: Rec = isRecord(stepsRaw) ? stepsRaw : {};\n const stepIds = sortedKeys(steps);\n for (const id of sortedKeys(cps)) {\n const cpath = `${path}.checkpoints.${id}`;\n const step = own(steps, id);\n if (!isRecord(step)) {\n this.err(\n 'example_checkpoint_step_unknown',\n cpath,\n `example ${q(label)}: checkpoint ${q(id)} is not a step of this flow (steps: ${stepIds.join(', ')})`,\n SUGGESTION_CHECKPOINT,\n );\n continue;\n }\n const next = own(step, 'next');\n if (has(step, 'for_each') || has(step, 'loop') || (isRecord(next) && has(next, 'parallel'))) {\n this.err(\n 'example_checkpoint_step_composite',\n cpath,\n `example ${q(label)}: step ${q(id)} repeats or branches, so there is no single result to check; put the checkpoint on a plain step or check the final output`,\n );\n continue;\n }\n const cp = own(cps, id);\n if (cp === null || cp === undefined) {\n this.validateExpectation(cpath, label, {}, 'checkpoint', id);\n } else if (isRecord(cp)) {\n this.validateExpectation(cpath, label, cp, 'checkpoint', id);\n }\n }\n }\n\n // -- variants ---------------------------------------------------------\n\n private validateVariants(\n i: number,\n path: string,\n label: string,\n ex: Rec,\n hasInput: boolean,\n baseInput: Rec | null,\n ): void {\n const L = EXAMPLES.limits;\n const variants = own(ex, 'variants');\n if (!Array.isArray(variants) || variants.length === 0) return;\n if (variants.length > L.maxVariants) {\n this.err(\n 'example_variants_too_many',\n `${path}.variants`,\n `example ${q(label)} has ${variants.length} variants; the limit is ${L.maxVariants}`,\n );\n }\n const seen = new Set<string>();\n variants.forEach((v: unknown, j: number) => {\n if (!isRecord(v)) return;\n const vpath = `examples[${i}].variants[${j}]`;\n const vid = this.s(v, 'id', vpath);\n const vlabel = vid === '' ? `#${j + 1}` : vid;\n const both = `${label}/${vlabel}`;\n\n if (!EXAMPLES.idPattern.test(vid)) {\n this.err(\n 'example_variant_id_invalid',\n `${vpath}.id`,\n `variant id ${q(vid)} of example ${q(label)} is not valid: use lower-case letters, digits and underscores, starting with a letter (2 to 48 characters)`,\n SUGGESTION_ID,\n );\n } else if (seen.has(vid)) {\n this.err(\n 'example_variant_id_duplicate',\n `${vpath}.id`,\n `variant id ${q(vid)} is used twice in example ${q(label)}`,\n );\n }\n seen.add(vid);\n\n const origin = this.s(v, 'origin', vpath);\n if (origin === ORIGIN_NONE || !EXAMPLES.origins.has(origin)) {\n this.err(\n 'example_variant_origin_invalid',\n `${vpath}.origin`,\n `variant ${q(vlabel)} of example ${q(label)} has origin ${q(origin)}; use author (a person wrote or approved it) or synthetic (generated)`,\n );\n }\n const vtitleN = runeCount(this.s(v, 'title', vpath));\n if (vtitleN > L.titleMaxRunes) {\n this.err(\n 'example_title_too_long',\n `${vpath}.title`,\n `example ${q(both)} title is ${vtitleN} characters; the limit is ${L.titleMaxRunes}`,\n );\n }\n const vguidanceN = runeCount(this.s(v, 'guidance', vpath));\n if (vguidanceN > L.maxGuidanceRunes) {\n this.err(\n 'example_guidance_too_long',\n `${vpath}.guidance`,\n `example ${q(both)} guidance is ${vguidanceN} characters; the limit is ${L.maxGuidanceRunes}`,\n );\n }\n const provN = runeCount(this.s(v, 'provenance', vpath));\n if (provN > L.maxProvenanceRunes) {\n this.err(\n 'example_notes_too_long',\n `${vpath}.provenance`,\n `example ${q(both)} notes are ${provN} characters; the limit is ${L.maxProvenanceRunes}`,\n );\n }\n this.validateWeight(`${vpath}.weight`, both, numberOf(own(v, 'weight')));\n\n const patch = own(v, 'input_patch');\n const patchRec: Rec | null = isRecord(patch) ? patch : null;\n const hasPatch = patchRec !== null && Object.keys(patchRec).length > 0;\n const hasRef = has(v, 'input_ref');\n if (hasPatch && hasRef) {\n this.err(\n 'example_variant_input_conflict',\n vpath,\n `variant ${q(vlabel)} of example ${q(label)} sets both input_patch and input_ref; use one`,\n );\n } else if (!hasPatch && !hasRef && !has(v, 'expected')) {\n this.err(\n 'example_variant_empty',\n vpath,\n `variant ${q(vlabel)} of example ${q(label)} changes neither the input nor the expectation`,\n );\n }\n const refRec = own(v, 'input_ref');\n if (isRecord(refRec)) {\n this.validateFileRef(`${vpath}.input_ref`, this.fileRefOf(refRec, `${vpath}.input_ref`));\n }\n if (hasPatch && patchRec !== null) {\n if (!hasInput) {\n this.warn(\n 'example_variant_unchecked',\n `${vpath}.input_patch`,\n `variant ${q(vlabel)} of example ${q(label)} cannot be checked: its parent takes its input from input_ref.`,\n );\n } else if (baseInput !== null) {\n this.checkVariantPatch(vpath, label, vlabel, baseInput, patchRec);\n }\n }\n const expected = own(v, 'expected');\n if (isRecord(expected)) {\n this.validateExpectation(`${vpath}.expected`, both, expected, 'final', '');\n }\n });\n }\n\n /**\n * Judge the PATCHED input like a live run, and report a secret the patch\n * itself supplies. A null patch value deleting a secret is fine.\n */\n private checkVariantPatch(\n vpath: string,\n label: string,\n vlabel: string,\n base: Rec,\n patch: Rec,\n ): void {\n const schema = own(this.flow as Rec, 'input_schema');\n if (isRecord(schema)) {\n for (const f of this.schemaFields(schema)) {\n if (f.type !== TYPE_SECRET) continue;\n const val = own(patch, f.name);\n if (val !== undefined && val !== null) {\n this.err(\n 'example_secret_value',\n `${vpath}.input_patch.${f.name}`,\n `example ${q(`${label}/${vlabel}`)} gives a value for ${q(f.name)}, which is a secret field. Examples are saved inside the flow and are never allowed to hold secrets; remove it. The person running the evaluation is asked for it at run time.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n }\n }\n const patched = applyExamplePatch(base, patch);\n // A scratch walker, so the variant wording replaces the example wording and\n // the parent's own secret findings are not reported twice.\n const scratch = new Walker(this.flow, this.issues);\n scratch.checkInput(\n `${vpath}.input_patch`,\n `${label}/${vlabel}`,\n patched,\n 'example_variant_input_invalid',\n );\n for (const f of scratch.findings) {\n if (f.code === 'example_secret_value') continue;\n this.findings.push(f);\n }\n }\n\n // -- credential-shaped literals ----------------------------------------\n\n private scanSecretLike(i: number, path: string, ex: Rec): void {\n const emit = (field: string, s: string): void => {\n const name = secretMatch(s);\n if (name !== '') {\n this.err(\n 'example_secret_like_value',\n field,\n `${field} looks like a credential (${name}). Examples are saved in the flow definition and must never contain keys or tokens. Replace it with a made-up value.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n };\n emit(`${path}.title`, this.s(ex, 'title', path));\n emit(`${path}.guidance`, this.s(ex, 'guidance', path));\n emit(`${path}.notes`, this.s(ex, 'notes', path));\n const input = own(ex, 'input');\n if (isRecord(input)) scanLeaves(`${path}.input`, input, 0, emit);\n const expected = own(ex, 'expected');\n if (isRecord(expected)) this.scanExpectationLeaves(`${path}.expected`, expected, emit);\n const cps = own(ex, 'checkpoints');\n if (isRecord(cps)) {\n for (const id of sortedKeys(cps)) {\n const cp = own(cps, id);\n if (isRecord(cp)) this.scanExpectationLeaves(`${path}.checkpoints.${id}`, cp, emit);\n }\n }\n const variants = own(ex, 'variants');\n if (Array.isArray(variants)) {\n variants.forEach((v: unknown, j: number) => {\n if (!isRecord(v)) return;\n const vpath = `examples[${i}].variants[${j}]`;\n emit(`${vpath}.title`, this.s(v, 'title', vpath));\n emit(`${vpath}.guidance`, this.s(v, 'guidance', vpath));\n emit(`${vpath}.provenance`, this.s(v, 'provenance', vpath));\n scanLeaves(`${vpath}.input_patch`, own(v, 'input_patch'), 0, emit);\n const vexp = own(v, 'expected');\n if (isRecord(vexp)) this.scanExpectationLeaves(`${vpath}.expected`, vexp, emit);\n });\n }\n }\n\n private scanExpectationLeaves(\n path: string,\n e: Rec,\n emit: (field: string, s: string) => void,\n ): void {\n emit(`${path}.rubric`, this.s(e, 'rubric', path));\n const reference = own(e, 'reference');\n if (isRecord(reference)) {\n emit(`${path}.reference.text`, this.s(reference, 'text', `${path}.reference`));\n }\n this.stringList(own(e, 'must_not'), `${path}.must_not`).forEach((s, j) =>\n emit(`${path}.must_not[${j}]`, s),\n );\n this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`).forEach((s, j) =>\n emit(`${path}.must_not_contain[${j}]`, s),\n );\n const fields = own(e, 'fields');\n if (isRecord(fields)) {\n for (const key of sortedKeys(fields)) {\n const m = own(fields, key);\n if (!isRecord(m)) continue;\n const fpath = `${path}.fields.${key}`;\n scanLeaves(`${fpath}.equals`, own(m, 'equals'), 0, emit);\n emit(`${fpath}.contains`, this.s(m, 'contains', fpath));\n emit(`${fpath}.not_contains`, this.s(m, 'not_contains', fpath));\n const oneOf = own(m, 'one_of');\n if (Array.isArray(oneOf)) {\n oneOf.forEach((one: unknown, j: number) =>\n scanLeaves(`${fpath}.one_of[${j}]`, one, 0, emit),\n );\n }\n }\n }\n scanLeaves(`${path}.exact`, own(e, 'exact'), 0, emit);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Free helpers\n// ---------------------------------------------------------------------------\n\ninterface SchemaField {\n name: string;\n type: string;\n required: boolean;\n enumValues: string[];\n visibleWhen: { field: string; equals: unknown; in: unknown[] } | null;\n}\n\ninterface RunFailure {\n field: string;\n message: string;\n /** The failure is \"required field missing\" (a required secret is then not an error). */\n required: boolean;\n}\n\nfunction scoreInRange(v: number): boolean {\n return !Number.isNaN(v) && v >= EXAMPLES.limits.minScoreMin && v <= EXAMPLES.limits.minScoreMax;\n}\n\n/** Go's `strings.EqualFold`, by simple case folding of each code point. */\nfunction equalFold(a: string, b: string): boolean {\n const ca = [...a];\n const cb = [...b];\n if (ca.length !== cb.length) return false;\n return ca.every((c, i) => {\n const d = cb[i] as string;\n return c === d || c.toLowerCase() === d.toLowerCase() || c.toUpperCase() === d.toUpperCase();\n });\n}\n\n/** The name of the first credential shape `s` resembles, or \"\". */\nfunction secretMatch(s: string): string {\n for (const p of EXAMPLES.secretPatterns) {\n if (p.re.test(s)) return p.name;\n }\n return '';\n}\n\nfunction scanLeaves(\n path: string,\n v: unknown,\n depth: number,\n emit: (field: string, s: string) => void,\n): void {\n if (depth > MAX_RECURSION_DEPTH) return;\n if (isRecord(v)) {\n for (const k of sortedKeys(v)) scanLeaves(`${path}.${k}`, v[k], depth + 1, emit);\n return;\n }\n if (typeof v === 'string') emit(path, v);\n else if (Array.isArray(v)) {\n v.forEach((item: unknown, i: number) => scanLeaves(`${path}[${i}]`, item, depth + 1, emit));\n }\n}\n\n/** The byte length of a value's JSON, or null where it cannot be encoded. */\nfunction jsonBytes(v: unknown): number | null {\n try {\n const text = JSON.stringify(v);\n return text === undefined ? null : byteLen(text);\n } catch {\n return null;\n }\n}\n\n/**\n * The size of the whole block as JSON, measured the way the reference measures\n * its typed structs: empty values are omitted. Measured over the raw document\n * with empties dropped, so it is never larger than the reference's count.\n */\nfunction blockBytes(examples: unknown[]): number | null {\n try {\n const text = JSON.stringify(normalize(examples, 0), function (this: unknown, _k, v: unknown) {\n if (Array.isArray(this)) return v;\n if (v === null || v === '' || v === false) return undefined;\n if (Array.isArray(v) && v.length === 0) return undefined;\n return v;\n });\n return text === undefined ? null : byteLen(text);\n } catch {\n return null;\n }\n}\n\nfunction isVisible(f: SchemaField, input: Rec): boolean {\n const vw = f.visibleWhen;\n if (vw === null) return true;\n if (!Object.prototype.hasOwnProperty.call(input, vw.field)) return false;\n const dep = input[vw.field];\n if (vw.equals !== undefined && vw.equals !== null) return valuesEqual(dep, vw.equals);\n return vw.in.some((candidate) => valuesEqual(dep, candidate));\n}\n\n/** Cross-kind matches are not equal: `true` is never `\"true\"`. */\nfunction valuesEqual(a: unknown, b: unknown): boolean {\n const aNil = a === null || a === undefined;\n const bNil = b === null || b === undefined;\n if (aNil || bNil) return aNil && bNil;\n if (typeof a === 'number') return typeof b === 'number' && a === b;\n if (typeof a === 'boolean') return typeof b === 'boolean' && a === b;\n if (typeof a === 'string') return typeof b === 'string' && a === b;\n return false;\n}\n\nfunction mismatch(f: SchemaField, expected: string): RunFailure {\n return {\n field: f.name,\n message: `input field ${q(f.name)} is not a valid ${expected}`,\n required: false,\n };\n}\n\n/** The narrowed kind / enum judgement of one present value. */\nfunction inputValueFailures(f: SchemaField, raw: unknown): RunFailure[] {\n switch (f.type) {\n case TYPE_STRING:\n case TYPE_MULTILINE:\n case TYPE_SECRET:\n return typeof raw === 'string' ? [] : [mismatch(f, TYPE_STRING)];\n case TYPE_NUMBER:\n // Any YAML number: the reference also takes NaN and the infinities here.\n return typeof raw === 'number' ? [] : [mismatch(f, TYPE_NUMBER)];\n case TYPE_BOOL:\n return typeof raw === 'boolean' ? [] : [mismatch(f, TYPE_BOOL)];\n case TYPE_ENUM:\n if (typeof raw !== 'string') return [mismatch(f, TYPE_ENUM)];\n if (f.enumValues.includes(raw)) return [];\n return [\n {\n field: f.name,\n message: `input field ${q(f.name)} value ${q(raw)} is not one of [${f.enumValues.join(',')}]`,\n required: false,\n },\n ];\n case TYPE_ARRAY_OF_STRINGS: {\n if (!Array.isArray(raw)) return [mismatch(f, TYPE_ARRAY_OF_STRINGS)];\n const out: RunFailure[] = [];\n raw.forEach((item: unknown, i: number) => {\n if (typeof item !== 'string') {\n out.push({\n field: f.name,\n message: `input field ${q(f.name)} index ${i} is not a string`,\n required: false,\n });\n }\n });\n return out;\n }\n case TYPE_DATE:\n // Kind only: the YYYY-MM-DD shape and the calendar are not judged here.\n return typeof raw === 'string' ? [] : [mismatch(f, TYPE_DATE)];\n case TYPE_FILE: {\n if (typeof raw === 'string') return raw === '' ? [mismatch(f, TYPE_FILE)] : [];\n if (isRecord(raw)) {\n const ref = own(raw, FILE_REF_KEY);\n return typeof ref === 'string' && ref !== '' ? [] : [mismatch(f, TYPE_FILE)];\n }\n return [mismatch(f, TYPE_FILE)];\n }\n default:\n return [];\n }\n}\n\n// ---------------------------------------------------------------------------\n// Entry\n// ---------------------------------------------------------------------------\n\n/**\n * Judge the flow's `examples:` block. An absent or empty block is no findings:\n * every flow that predates the grammar is unchanged.\n */\nexport function validateExamples(flow: Flow, issues: Issues): void {\n const examples = (flow as Rec)[KEY_EXAMPLES];\n if (!Array.isArray(examples) || examples.length === 0) return;\n const walker = new Walker(flow, issues);\n walker.run(examples);\n for (const f of walker.findings) {\n const issue = {\n field: f.field,\n message: f.message,\n code: f.code,\n ...(f.suggestion !== undefined ? { suggestion: f.suggestion } : {}),\n };\n if (f.severity === 'error') issues.error(issue);\n else issues.warn(issue);\n }\n}\n\n/** Every severity the walker emits, by code — held to the spec's table by a test. */\nexport function exampleCodeSeverities(): Readonly<Record<string, Severity>> {\n return EXAMPLES.codes;\n}\n","// Public API for the AIgentFlow flow validator.\n//\n// Static, offline validation of flow YAML. Reproduces the *static* verdicts of\n// the AIgentFlow Go reference validator (Validator.ValidateFlowWithDetails +\n// FlowParser.ValidateFlow). Runtime concerns — credentials, the compliance\n// catalog, and template field resolution — are out of scope. See PARITY.md.\n\nimport type { Flow, ValidateOptions, ValidationIssue, ValidationResult } from './types.js';\nimport { parseFlow, type ParseOutput } from './parse.js';\nimport { Issues } from './validators/util.js';\nimport { validateBasicStructure } from './validators/basicStructure.js';\nimport { validateExecutors } from './validators/executors.js';\nimport { validateQuerySchema } from './validators/querySchema.js';\nimport { validateResponseExpectations } from './validators/responseExpectation.js';\nimport { validateErrorStrategies } from './validators/errorStrategy.js';\nimport { validateConnectivity } from './validators/connectivity.js';\nimport { validateNextLogic } from './validators/nextLogic.js';\nimport { validateExpressionFunctions } from './validators/expressionFunctions.js';\nimport { validateLoopForEachThrottle } from './validators/loopForEachThrottle.js';\nimport { validateOrchestratorCampaign } from './validators/orchestratorCampaign.js';\nimport { validateCredentialBindings } from './validators/credentialBindings.js';\nimport { validateInputSchema } from './validators/inputSchema.js';\nimport { validateReservedInputNames } from './validators/reservedInputs.js';\nimport { validateOutputSchemas } from './validators/outputSchema.js';\nimport { validateQualityGates } from './validators/qualityGate.js';\nimport { validateTemplates } from './validators/templates.js';\nimport { validateProcessingOperations } from './validators/processingOperations.js';\nimport { validateStepMaxDuration } from './validators/stepMaxDuration.js';\nimport { validateRetiredKeys } from './validators/retiredKeys.js';\nimport { validateFlowDataKeys } from './validators/flowDataKeys.js';\nimport { validateSaveDoorExtras } from './validators/saveDoor.js';\nimport { validateUnknownKeys } from './validators/unknownKeys.js';\nimport { validateExecutorConfigEnvScopes } from './validators/executorConfigEnv.js';\nimport { validateServerOwnedQueryKeys } from './validators/serverOwnedQueryKeys.js';\nimport { validateCredentialEndpointPairing } from './validators/credentialEndpoint.js';\nimport { validateOrchestratorExons } from './validators/exons.js';\nimport { validateResidencyEnforcement } from './validators/complianceResidency.js';\nimport { validateExamples } from './validators/examples.js';\nimport type { ScalarSources } from './validators/util.js';\n\nexport { SPEC_VERSION, INPUT_SCHEMA_VERSION } from './spec/index.js';\nexport { parseFlow } from './parse.js';\nexport type { ParseOutput } from './parse.js';\nexport type {\n Flow,\n ValidateOptions,\n ValidationIssue,\n ValidationResult,\n ValidationSummary,\n Severity,\n} from './types.js';\n\nfunction countStepsWithErrors(errors: ValidationIssue[]): number {\n const ids = new Set<string>();\n for (const e of errors) {\n if (e.stepId) ids.add(e.stepId);\n }\n return ids.size;\n}\n\n/**\n * Validate an already-parsed flow object. Use this when you have a plain\n * object (e.g. from your own YAML/JSON loader); use {@link validateFlow} to\n * parse YAML text and validate in one step.\n */\nexport function validateFlowObject(flow: unknown, opts: ValidateOptions = {}): ValidationResult {\n return validateParsed(flow, opts, undefined);\n}\n\n// `sources` carries the source spelling of number/boolean scalars, which only a\n// YAML text has; every rule reads a Go `string` field through\n// `issues.stringAt`, which consults it. Without it (validateFlowObject) a\n// number is judged by its JavaScript rendering — PARITY.md divergence #13.\nfunction validateParsed(\n flow: unknown,\n opts: ValidateOptions,\n sources: ScalarSources | undefined,\n): ValidationResult {\n const issues = new Issues(sources);\n\n if (flow === null || typeof flow !== 'object' || Array.isArray(flow)) {\n issues.error({\n field: '',\n message: 'Flow must be a mapping (object) at the top level',\n code: 'invalid_flow_root',\n });\n return {\n valid: false,\n errors: issues.errors,\n warnings: issues.warnings,\n summary: {\n totalSteps: 0,\n validSteps: 0,\n errorCount: issues.errors.length,\n warningCount: issues.warnings.length,\n templatesFound: 0,\n templatesValid: 0,\n },\n };\n }\n\n const f = flow as Flow;\n\n validateBasicStructure(f, issues);\n validateRetiredKeys(f, issues);\n validateExecutors(f, issues);\n validateQuerySchema(f, issues);\n validateResponseExpectations(f, issues);\n validateErrorStrategies(f, issues);\n validateConnectivity(f, issues);\n validateNextLogic(f, issues);\n validateExpressionFunctions(f, issues);\n validateLoopForEachThrottle(f, issues);\n validateOrchestratorCampaign(f, issues, opts);\n validateCredentialBindings(f, issues);\n validateInputSchema(f, issues);\n validateReservedInputNames(f, issues);\n validateOutputSchemas(f, issues);\n validateQualityGates(f, issues);\n validateProcessingOperations(f, issues);\n validateStepMaxDuration(f, issues);\n validateSaveDoorExtras(f, issues);\n validateExecutorConfigEnvScopes(f, issues);\n validateServerOwnedQueryKeys(f, issues);\n validateFlowDataKeys(f, issues);\n validateCredentialEndpointPairing(f, issues);\n validateExamples(f, issues);\n // The orchestrator's inline .exons frontmatter. A step's inline `query.exons`\n // needs an .exons ENGINE to judge (`exons_attributes`) and is not judged here\n // at all — PARITY.md, divergence #16.\n validateOrchestratorExons(f, issues);\n validateResidencyEnforcement(f, issues);\n // Last among the structural rules: it skips a location another rule has\n // already reported with more specific advice.\n validateUnknownKeys(f, issues);\n const templateStats = validateTemplates(f, issues, opts);\n\n const totalSteps =\n f.steps && typeof f.steps === 'object' && !Array.isArray(f.steps)\n ? Object.keys(f.steps).length\n : 0;\n const errorCount = issues.errors.length;\n\n return {\n valid: errorCount === 0,\n errors: issues.errors,\n warnings: issues.warnings,\n summary: {\n totalSteps,\n validSteps: Math.max(0, totalSteps - countStepsWithErrors(issues.errors)),\n errorCount,\n warningCount: issues.warnings.length,\n templatesFound: templateStats.found,\n templatesValid: Math.max(0, templateStats.found - templateStats.syntaxErrors),\n },\n };\n}\n\n/**\n * Parse flow YAML text and validate it. Parse errors (syntax, duplicate keys)\n * are returned as `error`-severity issues; on a parse failure the structural\n * validators are skipped because there is no usable document.\n */\nexport function validateFlow(yamlText: string, opts: ValidateOptions = {}): ValidationResult {\n const parsed: ParseOutput = parseFlow(yamlText);\n\n if (parsed.parseErrors.length > 0 || parsed.flow === undefined) {\n return {\n valid: false,\n errors: parsed.parseErrors,\n warnings: parsed.parseWarnings,\n summary: {\n totalSteps: 0,\n validSteps: 0,\n errorCount: parsed.parseErrors.length,\n warningCount: parsed.parseWarnings.length,\n templatesFound: 0,\n templatesValid: 0,\n },\n };\n }\n\n const result = validateParsed(parsed.flow, opts, parsed.scalarSources);\n // Surface any non-fatal YAML warnings alongside the validation warnings.\n if (parsed.parseWarnings.length > 0) {\n result.warnings.unshift(...parsed.parseWarnings);\n result.summary.warningCount = result.warnings.length;\n }\n return result;\n}\n"]}
1
+ {"version":3,"sources":["../src/parse.ts","../src/validators/util.ts","../src/validators/basicStructure.ts","../src/spec/aigentflow-spec.json","../src/spec/index.ts","../src/validators/exons.ts","../src/validators/executors.ts","../src/validators/querySchema.ts","../src/validators/responseExpectation.ts","../src/validators/errorStrategy.ts","../src/validators/connectivity.ts","../src/validators/nextLogic.ts","../src/validators/expressionFunctions.ts","../src/validators/loopForEachThrottle.ts","../src/validators/orchestratorCampaign.ts","../src/validators/credentialBindings.ts","../src/validators/inputSchema.ts","../src/validators/reservedInputs.ts","../src/validators/outputSchema.ts","../src/validators/qualityGate.ts","../src/template/gotmpl-syntax.ts","../src/template/gotmpl-default.ts","../src/validators/processingOperations.ts","../src/validators/templates.ts","../src/validators/stepMaxDuration.ts","../src/validators/retiredKeys.ts","../src/validators/flowDataKeys.ts","../src/validators/saveDoor.ts","../src/validators/unknownKeys.ts","../src/validators/executorConfigEnv.ts","../src/validators/serverOwnedQueryKeys.ts","../src/validators/goUrl.ts","../src/validators/credentialEndpoint.ts","../src/validators/complianceResidency.ts","../src/validators/examples.ts","../src/index.ts"],"names":["MAX_ALIAS_COUNT","isMap","isSeq","isScalar","q","TYPE_ARRAY","RESERVED_STEP_ID_CHAR","mismatch","k","quote","walkStrings","goQuote","TEMPLATE_ACTION_OPEN","CODE_UNKNOWN_YAML_KEY","CODE","formatField","GO_SPACE","goTrimSpace","KEY_EXECUTOR_CONFIG","KEY_QUERY","KEY_ID","own","TYPE_FILE","TYPE_NUMBER","TYPE_ENUM","TYPE_ARRAY_OF_STRINGS","utf8Encoder","names"],"mappings":";;;AASA,IAAM,eAAA,GAAkB,GAAA;AA2BxB,SAAS,iBAAiB,IAAA,EAA8B;AACtD,EAAA,IAAI,CAAC,QAAA,CAAS,IAAI,KAAK,IAAA,CAAK,KAAA,KAAU,MAAM,OAAO,IAAA;AACnD,EAAA,IAAI,OAAO,IAAA,CAAK,MAAA,KAAW,QAAA,SAAiB,IAAA,CAAK,MAAA;AACjD,EAAA,OAAO,OAAO,IAAA,CAAK,KAAA,KAAU,QAAA,GAAW,KAAK,KAAA,GAAQ,IAAA;AACvD;AAWA,SAAS,gBAAgB,IAAA,EAAqB;AAC5C,EAAA,IAAI,KAAA,CAAM,IAAI,CAAA,EAAG;AACf,IAAA,KAAA,MAAW,IAAA,IAAQ,KAAK,KAAA,EAAO;AAC7B,MAAA,MAAM,MAAM,IAAA,CAAK,GAAA;AACjB,MAAA,IACE,QAAA,CAAS,GAAG,CAAA,KACX,OAAO,IAAI,KAAA,KAAU,QAAA,IAAY,OAAO,GAAA,CAAI,KAAA,KAAU,SAAA,CAAA,IACvD,OAAO,GAAA,CAAI,WAAW,QAAA,EACtB;AACA,QAAA,GAAA,CAAI,QAAQ,GAAA,CAAI,MAAA;AAAA,MAClB;AACA,MAAA,eAAA,CAAgB,GAAG,CAAA;AACnB,MAAA,eAAA,CAAgB,KAAK,KAAK,CAAA;AAAA,IAC5B;AAAA,EACF,CAAA,MAAA,IAAW,KAAA,CAAM,IAAI,CAAA,EAAG;AACtB,IAAA,KAAA,MA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AAA,CAAS,OAAA,CAAQ,GAAG,MAAA,CAAO,aAAa,CAAA;AAC/C,IAAA,MAAA,CAAO,OAAA,CAAQ,YAAA,GAAe,MAAA,CAAO,QAAA,CAAS,MAAA;AAAA,EAChD;AACA,EAAA,OAAO,MAAA;AACT","file":"index.js","sourcesContent":["// YAML → object parsing with structured, positioned errors.\n//\n// Uses the `yaml` package (pure JS, browser-safe). Duplicate keys and syntax\n// errors are surfaced as ValidationIssues with line/column when available.\n// Alias expansion is capped to guard against \"billion laughs\" style payloads.\n\nimport { isMap, isScalar, isSeq, parseDocument, type YAMLError, type YAMLWarning } from 'yaml';\nimport type { Flow, ValidationIssue } from './types.js';\n\nconst MAX_ALIAS_COUNT = 100;\n\n/** Result of parsing flow YAML. */\nexport interface ParseOutput {\n /** The parsed flow object, present only when there are no parse errors. */\n flow?: Flow;\n /** Fatal YAML syntax / structure errors. Non-empty means `flow` is absent. */\n parseErrors: ValidationIssue[];\n /** Non-fatal YAML warnings (e.g. deprecated tags). */\n parseWarnings: ValidationIssue[];\n /**\n * The SOURCE spelling of every number and boolean scalar, keyed by field path\n * (`mock_scenarios.s.fetch.delay`). The reference decodes a scalar into a Go\n * `string` field as its source text, so `delay: 0.0` arrives there as \"0.0\"\n * (not a Go duration) while the parsed value here is the number 0. Present\n * whenever `flow` is.\n */\n scalarSources?: ReadonlyMap<string, string>;\n}\n\n/**\n * The text a Go `string` receives for a scalar node: its source spelling. The\n * `yaml` package keeps it on `Scalar.source` (the scalar's text after quote and\n * escape processing), while `Scalar.value` is the resolved number or boolean —\n * `1.0` → 1, `0x1F` → 31, `True` → true, `-0` → -0. null when the node is not a\n * scalar, or is a YAML null (a null is absent, not text).\n */\nfunction scalarSourceText(node: unknown): string | null {\n if (!isScalar(node) || node.value === null) return null;\n if (typeof node.source === 'string') return node.source;\n return typeof node.value === 'string' ? node.value : null;\n}\n\n/**\n * Give every number or boolean mapping KEY its source text, before the\n * document is converted. That is what the reference stores: its step table is\n * a `map[string]*StepDefinition`, and yaml.v3 fills a Go `string` from any\n * scalar by its text, so `1e3:` is the step \"1e3\", `0x1F:` is \"0x1F\", `True:`\n * is \"True\". Converting the resolved key instead gives \"1000\", \"31\", \"true\",\n * and a reference written `next: { default: 1e3 }` no longer matches its own\n * step. Null keys, merge keys (`<<`, a string) and complex keys are left alone.\n */\nfunction retagScalarKeys(node: unknown): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n const key = pair.key;\n if (\n isScalar(key) &&\n (typeof key.value === 'number' || typeof key.value === 'boolean') &&\n typeof key.source === 'string'\n ) {\n key.value = key.source;\n }\n retagScalarKeys(key);\n retagScalarKeys(pair.value);\n }\n } else if (isSeq(node)) {\n for (const item of node.items) retagScalarKeys(item);\n }\n}\n\n/**\n * Duplicate-key identity, as yaml.v3 decides it: two scalar keys collide when\n * their TEXT is equal, not their resolved value — `1:` and `1.0:` are two\n * steps there (\"1\" and \"1.0\"), and `\"1\":` and `1:` are one. The `yaml`\n * package's default compares resolved values, which would refuse the first.\n */\nfunction sameKeyText(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (!isScalar(a) || !isScalar(b)) return false;\n const ta = scalarSourceText(a);\n const tb = scalarSourceText(b);\n if (ta === null || tb === null) return a.value === b.value;\n return ta === tb;\n}\n\n/**\n * Record the source text of each plain number/boolean scalar under the field\n * path the validators use. Runs after {@link retagScalarKeys}, so a path\n * segment is a key's source text too. Aliases are not followed: a value\n * reached through one keeps its parsed rendering, which differs only for\n * spellings such as `0.0` (see PARITY.md).\n */\nfunction collectScalarSources(node: unknown, path: string, out: Map<string, string>): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n const key = isScalar(pair.key) ? String(pair.key.value) : null;\n if (key === null) continue;\n collectScalarSources(pair.value, path === '' ? key : `${path}.${key}`, out);\n }\n } else if (isSeq(node)) {\n node.items.forEach((item, i) => collectScalarSources(item, `${path}[${i}]`, out));\n } else if (isScalar(node)) {\n const v = node.value;\n if ((typeof v === 'number' || typeof v === 'boolean') && typeof node.source === 'string') {\n out.set(path, node.source);\n }\n }\n}\n\nfunction issueFromYamlError(\n err: YAMLError | YAMLWarning,\n severity: 'error' | 'warning',\n): ValidationIssue {\n const issue: ValidationIssue = {\n field: '',\n message: err.message,\n code: err.name === 'YAMLParseError' ? 'yaml_syntax_error' : 'yaml_warning',\n severity,\n };\n const pos = err.linePos?.[0];\n if (pos) {\n issue.line = pos.line;\n issue.column = pos.col;\n }\n // The `yaml` package uses specific codes (e.g. DUPLICATE_KEY); preserve them\n // for callers that key off `code`.\n if (err.code) {\n issue.code = err.code === 'DUPLICATE_KEY' ? 'duplicate_key' : issue.code;\n }\n return issue;\n}\n\n/**\n * Parse flow YAML into a {@link Flow} object plus structured parse diagnostics.\n * Never throws — malformed input is reported via `parseErrors`.\n */\nexport function parseFlow(yamlText: string): ParseOutput {\n const parseErrors: ValidationIssue[] = [];\n const parseWarnings: ValidationIssue[] = [];\n\n if (typeof yamlText !== 'string' || yamlText.trim() === '') {\n parseErrors.push({\n field: '',\n message: 'Flow YAML is empty',\n code: 'empty_document',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n let doc;\n try {\n // `merge: true`: the reference's yaml.v3 honours `<<: *anchor` merge keys,\n // and without it `<<` survives as a literal key, which the unknown-key rule\n // would refuse on a flow the reference saves.\n doc = parseDocument(yamlText, { prettyErrors: true, uniqueKeys: sameKeyText, merge: true });\n } catch (e) {\n parseErrors.push({\n field: '',\n message: `YAML parse error: ${e instanceof Error ? e.message : String(e)}`,\n code: 'yaml_syntax_error',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n for (const err of doc.errors) {\n parseErrors.push(issueFromYamlError(err, 'error'));\n }\n for (const warn of doc.warnings) {\n parseWarnings.push(issueFromYamlError(warn, 'warning'));\n }\n if (parseErrors.length > 0) {\n return { parseErrors, parseWarnings };\n }\n\n retagScalarKeys(doc.contents);\n let value: unknown;\n try {\n value = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n } catch (e) {\n parseErrors.push({\n field: '',\n message: `YAML resolution error: ${e instanceof Error ? e.message : String(e)}`,\n code: 'yaml_syntax_error',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n parseErrors.push({\n field: '',\n message: 'Flow must be a YAML mapping at the top level',\n code: 'invalid_flow_root',\n severity: 'error',\n });\n return { parseErrors, parseWarnings };\n }\n\n const scalarSources = new Map<string, string>();\n collectScalarSources(doc.contents, '', scalarSources);\n return { flow: value as Flow, parseErrors, parseWarnings, scalarSources };\n}\n","// Shared helpers for the validator modules: an issue collector and a handful\n// of defensive type guards. User YAML is arbitrary, so every validator treats\n// the parsed document as `unknown` and narrows explicitly.\n\nimport type { ValidationIssue } from '../types.js';\n\n/**\n * Accumulates errors and warnings during a validation pass, and carries the\n * pass's scalar source spellings so every rule reads a Go `string` field the\n * same way ({@link Issues.stringAt}).\n */\nexport class Issues {\n readonly errors: ValidationIssue[] = [];\n readonly warnings: ValidationIssue[] = [];\n\n /**\n * @param sources source spellings of number/boolean scalars by field path,\n * present when the document was parsed from YAML text (see parse.ts).\n */\n constructor(readonly sources?: ScalarSources) {}\n\n /**\n * THE reader for every value the reference decodes into a Go `string` field\n * — a step reference (`next.default: 2` is the step \"2\"), an enum\n * (`action: 1` is the invalid action \"1\", not an absent one), a name, a\n * duration. yaml.v3 fills such a field from ANY scalar by its source text, so\n * a number or boolean is returned as that text. null for an absent value, a\n * YAML null, a mapping or a list — the only things that are \"not a string\".\n *\n * Reading such a value with `isString` made a number either invisible (an\n * existence check skipped: looser than the reference) or absent (a present\n * step reported missing: stricter).\n */\n stringAt(v: unknown, path: string): string | null {\n if (v === null || v === undefined) return null;\n return scalarTextAt(v, path, this.sources);\n }\n\n /** {@link stringAt} for `m[key]`, where `parentPath` is `m`'s own field path. */\n stringOf(m: object, key: string, parentPath: string): string | null {\n const v = (m as Record<string, unknown>)[key];\n return this.stringAt(v, parentPath === '' ? key : `${parentPath}.${key}`);\n }\n\n /** A present, non-empty Go `string` field (`name: 123` is present). */\n nonEmptyStringOf(m: object, key: string, parentPath: string): boolean {\n const s = this.stringOf(m, key, parentPath);\n return s !== null && s !== '';\n }\n\n error(issue: Omit<ValidationIssue, 'severity'>): void {\n this.errors.push({ ...issue, severity: 'error' });\n }\n\n warn(issue: Omit<ValidationIssue, 'severity'>): void {\n this.warnings.push({ ...issue, severity: 'warning' });\n }\n}\n\nexport function isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === 'object' && v !== null && !Array.isArray(v);\n}\n\nexport function isString(v: unknown): v is string {\n return typeof v === 'string';\n}\n\nexport function isArray(v: unknown): v is unknown[] {\n return Array.isArray(v);\n}\n\n/** A finite number (excludes NaN / Infinity), matching YAML numeric scalars. */\nexport function isNumber(v: unknown): v is number {\n return typeof v === 'number' && Number.isFinite(v);\n}\n\nexport function isInteger(v: unknown): v is number {\n return isNumber(v) && Number.isInteger(v);\n}\n\n/** Sorted list of step keys, used for \"available steps\" context messages. */\nexport function stepNames(steps: Record<string, unknown>): string[] {\n return Object.keys(steps).sort();\n}\n\n/**\n * The text a Go `string` field receives for a YAML scalar, or null for a value\n * that is not a scalar. yaml.v3 decodes ANY scalar into a string field, so\n * `delay: 100` arrives as \"100\" and `tool_discovery: true` as \"true\"; a YAML\n * null decodes to \"\". The parsed document has lost the source spelling, so a\n * number is rendered the way JavaScript renders it — which differs from the\n * source only for spellings such as `0.0`, `00` or `0x0` (see PARITY.md).\n */\nexport function scalarText(v: unknown): string | null {\n if (v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n return null;\n}\n\n/** Source spellings of number/boolean scalars by field path (see parse.ts). */\nexport type ScalarSources = ReadonlyMap<string, string>;\n\n/**\n * {@link scalarText}, but a number or boolean is rendered by its SOURCE\n * spelling when the document was parsed from text — which is exactly what the\n * reference's `string` field receives. `delay: 0.0` is \"0.0\" here (no unit, so\n * not a Go duration), not \"0\". Without `sources` it falls back to the parsed\n * value's rendering.\n */\nexport function scalarTextAt(\n v: unknown,\n path: string,\n sources: ScalarSources | undefined,\n): string | null {\n if ((typeof v === 'number' || typeof v === 'boolean') && sources !== undefined) {\n const source = sources.get(path);\n if (source !== undefined) return source;\n }\n return scalarText(v);\n}\n\n/**\n * Parse a Go `time.ParseDuration` string. Returns the duration in nanoseconds\n * or null when the string is not a valid Go duration.\n *\n * A line-for-line port of Go's `time.ParseDuration` (`time/format.go`),\n * including its integer overflow rules, so the verdict is exact rather than\n * approximate at the int64 boundary: an optional sign, then one or more\n * `[0-9]*(\\.[0-9]*)?<unit>` groups with digits on at least one side of the\n * point, units \"ns\", \"us\"/\"µs\"/\"μs\", \"ms\", \"s\", \"m\", \"h\". A bare \"0\" (after\n * the sign) needs no unit. The unit is the longest run of characters that are\n * not a digit or \".\", so \"5m \" has the unknown unit \"m \".\n */\nconst GO_DURATION_UNITS: Record<string, bigint> = {\n ns: 1n,\n us: 1_000n,\n // U+00B5 MICRO SIGN and U+03BC GREEK SMALL LETTER MU are both accepted by Go.\n µs: 1_000n,\n μs: 1_000n,\n ms: 1_000_000n,\n s: 1_000_000_000n,\n m: 60_000_000_000n,\n h: 3_600_000_000_000n,\n};\n\n/** 1<<63: Go's time.Duration is an int64. */\nconst GO_INT64_LIMIT = 1n << 63n;\nconst GO_INT64_MAX = GO_INT64_LIMIT - 1n;\n\nfunction isDigit(c: string | undefined): boolean {\n return c !== undefined && c >= '0' && c <= '9';\n}\n\n/** Go's leadingInt: consume [0-9]*, or null on overflow past 1<<63. */\nfunction leadingInt(s: string): { x: bigint; rest: string } | null {\n let x = 0n;\n let i = 0;\n for (; i < s.length && isDigit(s[i]); i++) {\n if (x > GO_INT64_LIMIT / 10n) return null;\n x = x * 10n + BigInt(s.charCodeAt(i) - 48);\n if (x > GO_INT64_LIMIT) return null;\n }\n return { x, rest: s.slice(i) };\n}\n\n/** Go's leadingFraction: consume [0-9]*, silently dropping digits past overflow. */\nfunction leadingFraction(s: string): { x: bigint; scale: number; rest: string } {\n let x = 0n;\n let scale = 1;\n let overflow = false;\n let i = 0;\n for (; i < s.length && isDigit(s[i]); i++) {\n if (overflow) continue;\n if (x > GO_INT64_MAX / 10n) {\n overflow = true;\n continue;\n }\n const y = x * 10n + BigInt(s.charCodeAt(i) - 48);\n if (y > GO_INT64_LIMIT) {\n overflow = true;\n continue;\n }\n x = y;\n scale *= 10;\n }\n return { x, scale, rest: s.slice(i) };\n}\n\nexport function parseGoDuration(input: string): number | null {\n let s = input;\n let neg = false;\n if (s !== '' && (s[0] === '-' || s[0] === '+')) {\n neg = s[0] === '-';\n s = s.slice(1);\n }\n if (s === '0') return 0;\n if (s === '') return null;\n\n let d = 0n;\n while (s !== '') {\n // The next character must be [0-9.].\n if (!(s[0] === '.' || isDigit(s[0]))) return null;\n const before = s.length;\n const lead = leadingInt(s);\n if (lead === null) return null;\n let v = lead.x;\n s = lead.rest;\n const pre = before !== s.length;\n\n let f = 0n;\n let scale = 1;\n let post = false;\n if (s !== '' && s[0] === '.') {\n s = s.slice(1);\n const fracBefore = s.length;\n const frac = leadingFraction(s);\n f = frac.x;\n scale = frac.scale;\n s = frac.rest;\n post = fracBefore !== s.length;\n }\n if (!pre && !post) return null;\n\n let i = 0;\n while (i < s.length && !(s[i] === '.' || isDigit(s[i]))) i++;\n if (i === 0) return null; // missing unit\n const unit = GO_DURATION_UNITS[s.slice(0, i)];\n s = s.slice(i);\n if (unit === undefined) return null; // unknown unit\n\n if (v > GO_INT64_LIMIT / unit) return null;\n v *= unit;\n if (f > 0n) {\n // Go computes this term in float64 and truncates it; so does this.\n v += BigInt(Math.trunc(Number(f) * (Number(unit) / scale)));\n if (v > GO_INT64_LIMIT) return null;\n }\n d += v;\n if (d > GO_INT64_LIMIT) return null;\n }\n if (neg) return -Number(d);\n if (d > GO_INT64_MAX) return null;\n return Number(d);\n}\n\nexport function isValidGoDuration(input: string): boolean {\n return parseGoDuration(input) !== null;\n}\n","// Required top-level fields, step-map shape, per-step executor requirement,\n// and the two reserved step-ID rules (the `.` character, the id `orchestrator`).\n//\n// Mirrors `validateBasicStructure` (validation.go) and the structural head of\n// `FlowParser.ValidateFlow` (parser.go). Because YAML can produce any shape,\n// this module also emits `invalid_type` errors where the Go struct decoder\n// would have failed at unmarshal time.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, stepNames } from './util.js';\n\n// Reserved in step IDs: the engine uses \"parent.child\" as the composite ID for\n// loop sub-steps, so a literal \".\" in a top-level step ID is rejected.\nconst RESERVED_STEP_ID_CHAR = '.';\nconst RESERVED_STEP_ID_ORCHESTRATOR = 'orchestrator';\n\n// Upper bound of the optional `display_name`, counted in Unicode code points\n// (Go's utf8.RuneCountInString), never in UTF-16 units.\nconst DISPLAY_NAME_MAX_LEN = 80;\n\n// The YAML 1.1 boolean spellings yaml.v3 still accepts for a Go `bool` field when\n// they are written as a plain (unquoted) scalar. This port cannot tell a quoted\n// scalar from a plain one, so it accepts them either way (the looser direction).\nconst YAML11_BOOL_WORDS: ReadonlySet<string> = new Set(\n ['y', 'yes', 'on', 'n', 'no', 'off'].flatMap((w) => [\n w,\n w.toUpperCase(),\n w[0]!.toUpperCase() + w.slice(1),\n ]),\n);\n\n/** A Go `bool` field: a boolean, a YAML null (zero value) or a YAML 1.1 word. */\nfunction isBoolLike(v: unknown): boolean {\n if (v === null || typeof v === 'boolean') return true;\n return typeof v === 'string' && YAML11_BOOL_WORDS.has(v);\n}\n\nexport function validateBasicStructure(flow: Flow, issues: Issues): void {\n if (!issues.nonEmptyStringOf(flow, 'aigentflow_version', '')) {\n issues.error({\n field: 'aigentflow_version',\n message: 'AIgentFlow version is required',\n code: 'missing_required_field',\n suggestion: 'Add \\'aigentflow_version: \"2.0.0\"\\' to your flow',\n });\n }\n\n if (!issues.nonEmptyStringOf(flow, 'name', '')) {\n issues.error({\n field: 'name',\n message: 'Flow name is required',\n code: 'missing_required_field',\n suggestion: 'Add a descriptive name to your flow',\n });\n }\n\n // Optional human-friendly label. Absent or empty is fine; only length is judged.\n const displayName = issues.stringOf(flow, 'display_name', '');\n if (displayName !== null) {\n const n = [...displayName].length;\n if (n > DISPLAY_NAME_MAX_LEN) {\n issues.error({\n field: 'display_name',\n message: `display_name is ${n} characters; the limit is ${DISPLAY_NAME_MAX_LEN}`,\n code: 'display_name_too_long',\n suggestion: \"Shorten display_name; it is a label, put prose in 'description'\",\n });\n }\n }\n\n // Optional opt-in to fail a render that reads a missing key. A Go `bool`: the\n // engine's behaviour is out of scope here, only the value's kind is judged.\n if (flow.strict_templates !== undefined && !isBoolLike(flow.strict_templates)) {\n issues.error({\n field: 'strict_templates',\n message: 'strict_templates must be a boolean (true or false)',\n code: 'invalid_type',\n suggestion: \"Write 'strict_templates: true' or remove the key\",\n });\n }\n\n // A Go `string`: `start: 1` names the step \"1\".\n const start = issues.stringOf(flow, 'start', '');\n if (start === null || start === '') {\n issues.error({\n field: 'start',\n message: 'Start step is required',\n code: 'missing_required_field',\n suggestion: 'Specify which step should execute first',\n });\n }\n\n const steps = flow.steps;\n if (steps === undefined || steps === null) {\n issues.error({\n field: 'steps',\n message: 'At least one step is required',\n code: 'missing_required_field',\n suggestion: 'Define steps for your workflow',\n });\n return;\n }\n if (!isRecord(steps)) {\n issues.error({\n field: 'steps',\n message: 'steps must be a mapping of step ID to step definition',\n code: 'invalid_type',\n });\n return;\n }\n if (Object.keys(steps).length === 0) {\n issues.error({\n field: 'steps',\n message: 'At least one step is required',\n code: 'missing_required_field',\n suggestion: 'Define steps for your workflow',\n });\n return;\n }\n\n const names = stepNames(steps);\n\n // Start step must exist.\n if (start !== null && start !== '' && !(start in steps)) {\n issues.error({\n field: 'start',\n message: `Start step '${start}' not found in steps`,\n code: 'step_not_found',\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change start to one of: ${names.join(', ')}`,\n });\n }\n\n // Per-step structure.\n for (const [stepID, step] of Object.entries(steps)) {\n if (stepID.includes(RESERVED_STEP_ID_CHAR)) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step ID '${stepID}' must not contain '${RESERVED_STEP_ID_CHAR}' (reserved for loop sub-step IDs)`,\n code: 'reserved_step_id_char',\n stepId: stepID,\n });\n }\n\n // AIF v2.484.0 (DC-COND-1): `orchestrator` is the engine's own step id for\n // orchestrator-originated signals and a reserved `next:` marker. A worker\n // step with that id could have its soft completion signal read as the\n // mission-complete key. Case-sensitive, top-level steps only, as upstream.\n if (stepID === RESERVED_STEP_ID_ORCHESTRATOR) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step ID '${stepID}' is reserved (the orchestrator's signal namespace and a next: marker)`,\n code: 'reserved_step_id_orchestrator',\n stepId: stepID,\n suggestion: 'Rename the step',\n });\n }\n\n if (!isRecord(step)) {\n issues.error({\n field: `steps.${stepID}`,\n message: `Step '${stepID}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n\n // Loop steps define sub-steps instead of an executor.\n const hasLoop = step.loop !== undefined && step.loop !== null;\n // A number here is the reference's executor \"42\" — present, and refused by\n // the URL check (executors.ts) rather than as a type error. Only a mapping\n // or a list fails to decode into the Go `string`.\n const executor = step.executor;\n const executorText = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (!hasLoop) {\n if (executor === undefined || executor === null || executorText === '') {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'Executor is required for each step',\n code: 'missing_required_field',\n stepId: stepID,\n suggestion: \"Specify an executor URL (e.g., 'function://utils/log')\",\n });\n } else if (executorText === null) {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'Executor must be a string URL',\n code: 'invalid_type',\n stepId: stepID,\n });\n }\n }\n }\n}\n","{\n \"$comment\": \"Vendored enum surface mirrored from the AIgentFlow Go reference implementation. Regenerate / review on every flow-YAML schema change. See PARITY.md. Values here are public protocol/type names only.\",\n \"specVersion\": \"2.833.0\",\n \"inputSchemaVersion\": 1,\n \"executorSchemes\": [\n \"a2a\",\n \"ai\",\n \"aiv\",\n \"async\",\n \"atlas\",\n \"browser\",\n \"chart\",\n \"db\",\n \"deepr\",\n \"document\",\n \"e2b\",\n \"email\",\n \"eurostat\",\n \"eval\",\n \"flow\",\n \"function\",\n \"gdelt\",\n \"geocoding\",\n \"geovisualize\",\n \"getmd\",\n \"here\",\n \"homeassistant\",\n \"hosting\",\n \"http\",\n \"mcp\",\n \"messenger\",\n \"mock\",\n \"mqtt\",\n \"opencorporates\",\n \"openmeteo\",\n \"overpass\",\n \"qrcode\",\n \"reachymini\",\n \"script\",\n \"search\",\n \"shelly\",\n \"staticmap\",\n \"storage\",\n \"transform\",\n \"wait\",\n \"web\",\n \"worldbank\"\n ],\n \"dataTypes\": [\"string\", \"number\", \"integer\", \"boolean\", \"object\", \"array\", \"null\", \"binary\"],\n \"errorStrategyActions\": [\"retry\", \"fail\", \"goto\", \"continue\"],\n \"retryOnCategories\": [\n \"transient\",\n \"rate_limit\",\n \"auth\",\n \"validation\",\n \"resource\",\n \"fatal\",\n \"unknown\"\n ],\n \"nextMarkers\": [\"null\", \"orchestrator\"],\n \"reachabilityTerminalMarkers\": [\"null\", \"orchestrator\"],\n \"parallelResolutions\": [\"all-complete\", \"all-succeed\", \"first-succeed\", \"first-complete\"],\n \"forEachResolutions\": [\"all-complete\", \"all-succeed\"],\n \"loopMaxIterationsLimit\": 1000,\n \"credentialReferencePrefix\": \"stored/\",\n \"executorUrlPattern\": \"^([a-zA-Z0-9-]+)://([a-zA-Z0-9_-]+)/([a-zA-Z0-9_/-]+)$\",\n \"templateActionOpen\": \"{{\",\n \"evalJudgeUrl\": \"eval://judge/evaluate\",\n \"qualityGate\": {\n \"$comment\": \"DC-CP-8: the quality_gate: step block. on_fail 'human' exists in the Go enum but is validation-REJECTED (pending the human-task inbox), so it is NOT in onFailActions and is flagged as rejected here.\",\n \"onFailActions\": [\"fail\", \"goto\", \"retry\"],\n \"onFailRejected\": [\"human\"],\n \"thresholdMin\": 0,\n \"thresholdMax\": 1\n },\n \"inputSchema\": {\n \"types\": [\n \"string\",\n \"multiline\",\n \"number\",\n \"bool\",\n \"enum\",\n \"array_of_strings\",\n \"date\",\n \"file\",\n \"secret\"\n ],\n \"stringTypes\": [\"string\", \"multiline\", \"secret\"],\n \"parametricTypes\": [\"number\", \"enum\"],\n \"fieldNamePattern\": \"^[a-z][a-z0-9_]*$\",\n \"datePattern\": \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n \"maxPatternLength\": 512,\n \"maxConstraintValue\": 1048576,\n \"maxInputKeyCount\": 256,\n \"maxStringInputLength\": 1048576\n },\n \"orchestrator\": {\n \"modes\": [\"monitor\", \"owner\"],\n \"triggers\": [\n \"step_completed\",\n \"step_failed\",\n \"mission_started\",\n \"mission_completed\",\n \"dfm_suggestion\",\n \"timer\",\n \"request_turn\",\n \"mission_recovered\",\n \"campaign_child_completed\",\n \"campaign_child_failed\",\n \"human_response\",\n \"human_input\"\n ],\n \"tools\": [\n \"aif_step_cancel\",\n \"aif_step_start\",\n \"aif_step_inspect\",\n \"aif_conversation_manage\",\n \"aif_request_turn\",\n \"aif_checkpoint_create\",\n \"aif_mission_complete\",\n \"aif_mission_fail\",\n \"aif_ask_human\",\n \"aif_flow_list\",\n \"aif_mission_reflect\",\n \"aif_signal_complete\",\n \"aif_signal_need_human\",\n \"aif_signal_delegate\",\n \"aif_signal_need_tool\",\n \"aif_signal_modify_flow\",\n \"aif_campaign_spawn\",\n \"aif_campaign_status\",\n \"aif_campaign_results\",\n \"aif_campaign_cancel\",\n \"aif_memory_plan\",\n \"aif_memory_record\",\n \"aif_memory_recall\",\n \"aif_memory_reflect\",\n \"aif_tool_discover\",\n \"aif_tool_execute\",\n \"aif_trove_upload\",\n \"aif_trove_download\",\n \"aif_trove_list\",\n \"aif_trove_delete\",\n \"aif_e2b_sandbox_create\",\n \"aif_e2b_sandbox_execute\",\n \"aif_e2b_sandbox_files\",\n \"aif_e2b_desktop_screenshot\",\n \"aif_e2b_desktop_interact\"\n ]\n },\n \"expressionFunctions\": {\n \"namePrefix\": \"fn_\",\n \"catalog\": [\n \"fn_avg\",\n \"fn_camelCase\",\n \"fn_chunk\",\n \"fn_clamp\",\n \"fn_compact\",\n \"fn_kebabCase\",\n \"fn_max\",\n \"fn_min\",\n \"fn_padLeft\",\n \"fn_padRight\",\n \"fn_regexReplaceAll\",\n \"fn_reverse\",\n \"fn_round\",\n \"fn_sha256\",\n \"fn_slugify\",\n \"fn_snakeCase\",\n \"fn_sortStrings\",\n \"fn_sum\",\n \"fn_uniq\",\n \"fn_urldecode\"\n ]\n },\n \"processingOperations\": {\n \"$comment\": \"Pre/post-processing operation dispatch set and per-operation config keys. The key sets are PER OPERATION and must never be unioned: `asset_id` is read by binary.get/update/delete and is NOT read by binary.transform, which reads `source_asset_id`.\",\n \"guardKey\": \"if\",\n \"standardTypes\": [\n \"data.set\",\n \"conversation.append\",\n \"output.set\",\n \"binary.store\",\n \"binary.get\",\n \"binary.update\",\n \"binary.delete\",\n \"binary.transform\",\n \"parse\"\n ],\n \"loopSubStepTypes\": [\"loop.set\", \"loop.break\"],\n \"openKeyTypes\": [\"data.set\", \"output.set\", \"conversation.append\", \"loop.set\"],\n \"closedConfigKeys\": {\n \"parse\": [\"source\", \"format\", \"target\", \"on_error\"],\n \"binary.store\": [\"data\", \"metadata\", \"result_key\"],\n \"binary.get\": [\"asset_id\", \"include_data\", \"result_key\"],\n \"binary.update\": [\"asset_id\", \"data\", \"metadata\"],\n \"binary.delete\": [\"asset_id\"],\n \"binary.transform\": [\n \"source_asset_id\",\n \"transformer\",\n \"parameters\",\n \"metadata\",\n \"result_key\"\n ],\n \"loop.break\": [\"if\"]\n }\n },\n \"templateFunctions\": [\n \"and\",\n \"or\",\n \"not\",\n \"eq\",\n \"ne\",\n \"lt\",\n \"le\",\n \"gt\",\n \"ge\",\n \"len\",\n \"index\",\n \"slice\",\n \"call\",\n \"print\",\n \"printf\",\n \"println\",\n \"html\",\n \"js\",\n \"urlquery\",\n \"add\",\n \"sub\",\n \"mul\",\n \"div\",\n \"mod\",\n \"atoi\",\n \"int\",\n \"lower\",\n \"upper\",\n \"title\",\n \"trim\",\n \"substr\",\n \"replace\",\n \"split\",\n \"join\",\n \"hasPrefix\",\n \"hasSuffix\",\n \"contains\",\n \"htmlDocument\",\n \"toJson\",\n \"fromJson\",\n \"isKind\",\n \"typeOf\",\n \"toString\",\n \"indexOf\",\n \"keys\",\n \"values\",\n \"coalesce\",\n \"default\",\n \"now\",\n \"formatDate\",\n \"parseDate\",\n \"since\",\n \"until\",\n \"unix\",\n \"formatTime\",\n \"ternary\",\n \"fibonacci\",\n \"extractNumber\",\n \"base64encode\",\n \"base64decode\",\n \"formatNumber\",\n \"toInt\",\n \"toFloat\",\n \"float64\",\n \"addf\",\n \"subf\",\n \"mulf\",\n \"divf\",\n \"regexMatch\",\n \"regexFind\",\n \"truncate\",\n \"htmlEscape\",\n \"urlencode\",\n \"fn_avg\",\n \"fn_camelCase\",\n \"fn_chunk\",\n \"fn_clamp\",\n \"fn_compact\",\n \"fn_kebabCase\",\n \"fn_max\",\n \"fn_min\",\n \"fn_padLeft\",\n \"fn_padRight\",\n \"fn_regexReplaceAll\",\n \"fn_reverse\",\n \"fn_round\",\n \"fn_sha256\",\n \"fn_slugify\",\n \"fn_snakeCase\",\n \"fn_sortStrings\",\n \"fn_sum\",\n \"fn_uniq\",\n \"fn_urldecode\"\n ],\n \"orchestratorToolAllow\": {\n \"$comment\": \"An orchestrator tool is offered only if it passes BOTH orchestrator.tools (empty = every tool) AND the inline exons definition's tools.allow (absent = no narrowing). The lifecycle tools, and the signal tools when enable_signals is on (the default), are exempt from tools.allow. Reference: validateOrchestratorToolAllowWithholds (v2.760.0).\",\n \"warningField\": \"orchestrator.exons\",\n \"askHumanTool\": \"aif_ask_human\",\n \"enableSignalsDefault\": true,\n \"lifecycleTools\": [\"aif_mission_complete\", \"aif_mission_fail\", \"aif_request_turn\"],\n \"signalTools\": [\n \"aif_signal_complete\",\n \"aif_signal_need_human\",\n \"aif_signal_delegate\",\n \"aif_signal_need_tool\",\n \"aif_signal_modify_flow\"\n ],\n \"campaignTools\": [\n \"aif_campaign_cancel\",\n \"aif_campaign_results\",\n \"aif_campaign_spawn\",\n \"aif_campaign_status\"\n ]\n },\n \"exons\": {\n \"$comment\": \"The orchestrator's inline .exons document is still judged at the save door (orchestrator stays). A document opens with frontmatterDelimiter. Steps no longer carry inline .exons documents: the exons:// executor was removed (see removedAgentSurfaces).\",\n \"frontmatterDelimiter\": \"---\"\n },\n \"removedAgentSurfaces\": {\n \"$comment\": \"AIgentFlow no longer runs agents of its own. executor_removed (ERROR): a step or loop sub-step whose executor scheme (text before '://', whitespace-trimmed, lower-cased) is in removedSchemes, or a top-level key in flowKeys (field = the key). agentic_param_removed (ERROR): an ai:// step or loop sub-step whose query carries ANY key of aiParams, on presence alone (null and false included); ONE finding per step, the keys sorted and joined by ', '. Only the paramScheme scheme is checked for params. A templated executor (containing templateActionOpen) is not judged. A step on a removed scheme yields ONLY executor_removed: no unknown_executor_scheme, executor-URL shape or inline-exons finding. Fields: steps.<id> and steps.<id>.loop.steps[<index>]. Not refused: aiv://, atlas://, ai:// tools / tool_choice / autofix / content_parts / stream, flow-level tool_discovery / discoverable_tools, the orchestrator block's own keys. Messages fill %s (the step id as written in the finding, then the scheme or the key list).\",\n \"removedSchemes\": [\"exons\", \"agent\"],\n \"paramScheme\": \"ai\",\n \"aiParams\": [\n \"agentic\",\n \"deny_tools\",\n \"discoverable_tools\",\n \"enable_signals\",\n \"guardrails\",\n \"max_tool_calls\",\n \"max_tool_turns\",\n \"mcp_server_url\",\n \"parallel_tool_calls\",\n \"require_confirmation\",\n \"timeout_seconds\",\n \"tool_auth_token\",\n \"tool_discovery\"\n ],\n \"flowKeys\": [\"exons_uploads\"],\n \"executorRemovedCode\": \"executor_removed\",\n \"agenticParamRemovedCode\": \"agentic_param_removed\",\n \"schemeMessageFormat\": \"step %q uses %s://, which AIgentFlow no longer runs: its own agent chains were removed\",\n \"paramsMessageFormat\": \"step %q sets %s on ai://: AIgentFlow's own agent loop (agentic mode) was removed, so these parameters no longer exist\",\n \"flowKeyMessageFormat\": \"the flow-level key %q belonged to a removed agent surface and is no longer read\",\n \"suggestion\": \"Rebuild the step: a tool-using agent becomes atlas://agent/run (agent: \\\"@org/name\\\", prompt, capabilities); one tool becomes atlas://capability/<ref>; a plain prompt becomes ai://<provider>/chat or a prompt-only aiv://<org>/<name>. A flow that cannot be converted (started by a webhook, a schedule, a share link, a campaign or a flow:// sub-flow, none of which has a person for atlas to act for; or one that needs an inline .exons spec, an arbitrary MCP server URL or signals) has no replacement here: start it from a person, or use a routine in atlas\"\n },\n \"executorConfigEnvScopes\": {\n \"$comment\": \"executor_config may expand only the environment variables of the key it is written under. A value is a reference when it starts with referencePrefix and ends with referenceSuffix around a non-empty name. Checked fields: fields, plus every string value of extra (prefixed extraFieldPrefix in the message). A key absent from scopes has an EMPTY scope and refuses every reference. scopes is the reference's executorConfigEnvScope evaluated for every key with a non-empty scope. Reference: ValidateExecutorConfigEnvScopes (v2.597.0).\",\n \"referencePrefix\": \"${\",\n \"referenceSuffix\": \"}\",\n \"fields\": [\"api_key\", \"base_url\", \"organization\"],\n \"extraKey\": \"extra\",\n \"scopes\": {\n \"anthropic\": [\n \"AIGENTFLOW_ANTHROPIC_API_KEY\",\n \"AIGENTFLOW_ANTHROPIC_BASE_URL\"\n ],\n \"api\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ],\n \"assemblyai\": [\n \"AIGENTFLOW_ASSEMBLYAI_API_KEY\",\n \"AIGENTFLOW_ASSEMBLYAI_BASE_URL\"\n ],\n \"azure\": [\n \"AIGENTFLOW_AZURE_API_KEY\",\n \"AIGENTFLOW_AZURE_BASE_URL\"\n ],\n \"bedrock\": [\n \"AIGENTFLOW_BEDROCK_API_KEY\",\n \"AIGENTFLOW_BEDROCK_BASE_URL\"\n ],\n \"blackforestlabs\": [\n \"AIGENTFLOW_BFL_API_KEY\",\n \"AIGENTFLOW_BLACKFORESTLABS_API_KEY\",\n \"AIGENTFLOW_BLACKFORESTLABS_BASE_URL\"\n ],\n \"broker\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_PASSWORD\",\n \"AIGENTFLOW_MQTT_USERNAME\"\n ],\n \"cohere\": [\n \"AIGENTFLOW_COHERE_API_KEY\",\n \"AIGENTFLOW_COHERE_BASE_URL\"\n ],\n \"custom\": [\n \"AIGENTFLOW_CUSTOM_API_KEY\",\n \"AIGENTFLOW_CUSTOM_BASE_URL\"\n ],\n \"db\": [\n \"AIGENTFLOW_DB_ELASTICSEARCH_BASE_URL\",\n \"AIGENTFLOW_DB_MILVUS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MONGODB_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MYSQL_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_NEO4J_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_PINECONE_API_KEY\",\n \"AIGENTFLOW_DB_POSTGRES_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_QDRANT_BASE_URL\",\n \"AIGENTFLOW_DB_REDIS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_WEAVIATE_BASE_URL\"\n ],\n \"deepgram\": [\n \"AIGENTFLOW_DEEPGRAM_API_KEY\",\n \"AIGENTFLOW_DEEPGRAM_BASE_URL\"\n ],\n \"deepr\": [\n \"AIGENTFLOW_DEEPR_API_KEY\",\n \"AIGENTFLOW_DEEPR_BASE_URL\"\n ],\n \"deepseek\": [\n \"AIGENTFLOW_DEEPSEEK_API_KEY\",\n \"AIGENTFLOW_DEEPSEEK_BASE_URL\"\n ],\n \"device\": [\n \"AIGENTFLOW_SHELLY_AUTH_KEY\"\n ],\n \"elevenlabs\": [\n \"AIGENTFLOW_ELEVENLABS_API_KEY\",\n \"AIGENTFLOW_ELEVENLABS_BASE_URL\"\n ],\n \"geoapify\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ],\n \"google\": [\n \"AIGENTFLOW_GOOGLE_API_KEY\",\n \"AIGENTFLOW_GOOGLE_BASE_URL\",\n \"AIGENTFLOW_VERTEXAI_API_KEY\",\n \"AIGENTFLOW_VERTEXAI_CREDENTIALS_FILE\"\n ],\n \"homeassistant\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ],\n \"inception\": [\n \"AIGENTFLOW_INCEPTION_API_KEY\",\n \"AIGENTFLOW_INCEPTION_BASE_URL\"\n ],\n \"leonardoai\": [\n \"AIGENTFLOW_LEONARDOAI_API_KEY\",\n \"AIGENTFLOW_LEONARDOAI_BASE_URL\"\n ],\n \"minimax\": [\n \"AIGENTFLOW_MINIMAX_API_KEY\",\n \"AIGENTFLOW_MINIMAX_BASE_URL\"\n ],\n \"mistral\": [\n \"AIGENTFLOW_MISTRAL_API_KEY\",\n \"AIGENTFLOW_MISTRAL_BASE_URL\"\n ],\n \"moonshot\": [\n \"AIGENTFLOW_MOONSHOT_API_KEY\",\n \"AIGENTFLOW_MOONSHOT_BASE_URL\"\n ],\n \"mqtt\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_PASSWORD\",\n \"AIGENTFLOW_MQTT_USERNAME\"\n ],\n \"ollama\": [\n \"AIGENTFLOW_OLLAMA_API_KEY\",\n \"AIGENTFLOW_OLLAMA_BASE_URL\"\n ],\n \"openai\": [\n \"AIGENTFLOW_OPENAI_API_KEY\",\n \"AIGENTFLOW_OPENAI_BASE_URL\"\n ],\n \"perplexity\": [\n \"AIGENTFLOW_PERPLEXITY_API_KEY\",\n \"AIGENTFLOW_PERPLEXITY_BASE_URL\"\n ],\n \"qwen\": [\n \"AIGENTFLOW_QWEN_API_KEY\",\n \"AIGENTFLOW_QWEN_BASE_URL\"\n ],\n \"s3\": [\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ],\n \"speechmatics\": [\n \"AIGENTFLOW_SPEECHMATICS_API_KEY\",\n \"AIGENTFLOW_SPEECHMATICS_BASE_URL\"\n ],\n \"staticmap\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ],\n \"storage\": [\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ],\n \"vaiembed\": [\n \"AIGENTFLOW_VAIEMBED_API_KEY\",\n \"AIGENTFLOW_VAIEMBED_BASE_URL\"\n ],\n \"verda\": [\n \"AIGENTFLOW_VERDA_API_KEY\",\n \"AIGENTFLOW_VERDA_BASE_URL\"\n ],\n \"vllm\": [\n \"AIGENTFLOW_VLLM_API_KEY\",\n \"AIGENTFLOW_VLLM_BASE_URL\"\n ],\n \"xai\": [\n \"AIGENTFLOW_XAI_API_KEY\",\n \"AIGENTFLOW_XAI_BASE_URL\"\n ]\n }\n },\n \"serverOwnedQueryKeys\": {\n \"$comment\": \"Executor parameters only the server's credential resolver may set. A key in keys, matched exactly and case-sensitively, is refused (error) in the query of a top-level step (field stepFieldFormat) and of a loop sub-step (field loopStepFieldFormat, whose second placeholder is the sub-step's id as written). No other surface is scanned. A new server-owned key is a change to keys. Reference: validateNoServerOwnedStepQueryKeys, IsServerOwnedParamKey (CFX-05, after v2.790.0).\",\n \"keys\": [\n \"aiv_api_key\",\n \"aiv_base_url\",\n \"aiv_delegation\"\n ],\n \"stepFieldFormat\": \"steps.%s.query.%s\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.query.%s\"\n },\n \"functionOperations\": {\n \"$comment\": \"unknown_function_operation (ERROR): a step or loop sub-step whose executor is function://<authority>/<path> where authority+\\\"/\\\"+path is not in operations. Templated executors (containing templateActionOpen), unparsable URLs (invalid_executor_url owns them) and other schemes are skipped; the scheme match is exact and case-sensitive, as in the reference. The message is messageFormat with the stepId, the operation, then operations joined by ', '. Reference: validateFunctionOperationKnown (parser.go), functionSchemaOperations.\",\n \"code\": \"unknown_function_operation\",\n \"scheme\": \"function\",\n \"messageFormat\": \"step %s uses function://%s, which is not a built-in function. Available: %s\",\n \"suggestionFormat\": \"Use one of the built-in function operations: %s. For custom logic use a script://, http:// or ai:// executor instead.\",\n \"operations\": [\n \"binary-processor/validate-and-store\",\n \"data/create\",\n \"data/from-json\",\n \"data/to-json\",\n \"data/validate\",\n \"demo/adult-processor\",\n \"demo/calculator\",\n \"demo/data-processor\",\n \"demo/finalizer\",\n \"demo/senior-processor\",\n \"demo/youth-processor\",\n \"document/finalize\",\n \"document/prepare\",\n \"json/validate\",\n \"math/basic\",\n \"math/calculate\",\n \"math/sum\",\n \"results-compiler/aggregate\",\n \"system/info\",\n \"text/analysis\",\n \"text/count-characters\",\n \"text/count-lines\",\n \"text/count-occurrences\",\n \"text/count-words\",\n \"text/find-pattern\",\n \"text/generate\",\n \"text/replace-text\",\n \"text/search\",\n \"utils/datetime\",\n \"utils/format-date\",\n \"utils/log\",\n \"utils/parse-date\"\n ]\n },\n \"atlasExecutor\": {\n \"$comment\": \"atlas://<provider>/<resource>: calls into the Atlas platform. Providers are agent (the one resource is run) and capability (the resource is a capability reference). All findings are ERRORS, field = the step (loop sub-steps use the composite step id and the sub-step path). Templated executors, unparsable URLs and other schemes are skipped. A literal agent and literal capabilities keep a step from being steered by data: query.agent and every string anywhere in query.capabilities and query.model may not contain templateActionOpen, while prompt, inputs and capability args may. agent, prompt and prompt_template count as present only when they are non-empty strings after trimming whitespace. A message format takes the quoted step id first. A URL the shared executor-URL shape refuses (a dot or colon in a reference, say) is still judged here, split at the first slash after atlas://.\",\n \"scheme\": \"atlas\",\n \"providerAgent\": \"agent\",\n \"providerCapability\": \"capability\",\n \"agentResource\": \"run\",\n \"capabilityRefPattern\": \"^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$\",\n \"operationUnknown\": {\n \"code\": \"atlas_operation_unknown\",\n \"messageFormat\": \"step %s uses %s, which is not an Atlas operation. The providers are agent (resource run) and capability (resource: a capability reference).\",\n \"suggestion\": \"Use atlas://agent/run or atlas://capability/<capability-ref>.\"\n },\n \"agentMissing\": {\n \"code\": \"atlas_agent_missing\",\n \"messageFormat\": \"step %s runs an Atlas agent but query.agent is missing, empty or not a string.\",\n \"suggestion\": \"Set query.agent to the agent to run, written out as a literal such as @acme/reporter.\"\n },\n \"agentNotLiteral\": {\n \"code\": \"atlas_agent_not_literal\",\n \"messageFormat\": \"step %s computes query.agent from a template. The agent must be a fixed literal, never derived from input.\",\n \"suggestion\": \"Write the agent out as a literal such as @acme/reporter. Data may go into the prompt or the inputs instead.\"\n },\n \"capabilitiesNotLiteral\": {\n \"code\": \"atlas_capabilities_not_literal\",\n \"messageFormat\": \"step %s computes an entry of query.capabilities from a template. Capabilities must be fixed literals, never derived from input.\",\n \"suggestion\": \"Write each capability out as a literal. Data may go into the prompt or the inputs instead.\"\n },\n \"promptMissing\": {\n \"code\": \"atlas_prompt_missing\",\n \"messageFormat\": \"step %s runs an Atlas agent with neither query.prompt nor query.prompt_template.\",\n \"suggestion\": \"Set exactly one of query.prompt or query.prompt_template.\"\n },\n \"promptBoth\": {\n \"code\": \"atlas_prompt_both\",\n \"messageFormat\": \"step %s sets both query.prompt and query.prompt_template.\",\n \"suggestion\": \"Keep exactly one of query.prompt or query.prompt_template.\"\n },\n \"capabilityRefInvalid\": {\n \"code\": \"atlas_capability_ref_invalid\",\n \"messageFormat\": \"step %s uses atlas://capability/%s, which is not a valid capability reference.\",\n \"suggestion\": \"A capability reference starts with a letter or digit and continues with letters, digits, _ and - up to 128 characters in all.\"\n },\n \"modelNotLiteral\": {\n \"code\": \"atlas_model_not_literal\",\n \"messageFormat\": \"step %s computes a value of query.model from a template. The provider, model and reasoning_effort must be fixed literals, never derived from input.\",\n \"suggestion\": \"Write the model choice out as literals. Data may go into the prompt or the inputs instead.\"\n },\n \"paramRefused\": {\n \"code\": \"atlas_param_refused\",\n \"messageFormat\": \"step %s sets %s under query. Atlas decides these itself, so a step may not set them.\",\n \"suggestion\": \"Remove these keys from the query.\",\n \"agentKeys\": [\n \"api_key\",\n \"attribution\",\n \"base_url\",\n \"host\",\n \"idempotency_key\",\n \"org_id\",\n \"person\",\n \"untrusted_input\",\n \"untrusted_input_override\",\n \"url\",\n \"user_id\"\n ],\n \"capabilityKeys\": [\n \"attribution\",\n \"idempotency_key\",\n \"untrusted_input\",\n \"untrusted_input_override\"\n ]\n }\n },\n \"reservedInputNames\": {\n \"$comment\": \"reserved_input_name (ERROR): an input the flow declares under the top-level query: map, or as an input_schema field name, that starts with prefix. The platform keeps that namespace for values it writes itself (the acting person, the credential manifest, the untrusted-input marker); a value or default written under such a name is never delivered. Every name the platform reserves today starts with the prefix. Matching is exact and case-sensitive: one leading underscore is an ordinary name. Findings carry no step id. queryFieldFormat takes the input name; schemaFieldFormat takes the field name as written (a non-string name is skipped). Query names are reported sorted, then schema fields in file order.\",\n \"prefix\": \"__\",\n \"code\": \"reserved_input_name\",\n \"messageFormat\": \"the input %s starts with two underscores. That namespace belongs to the platform (the acting person, the credential manifest, the untrusted-input marker): a flow cannot declare an input there, and a value or default written under such a name is never delivered.\",\n \"suggestion\": \"Rename the input so it does not start with \\\"__\\\".\",\n \"queryFieldFormat\": \"query.%s\",\n \"schemaFieldFormat\": \"input_schema.fields.%s\"\n },\n \"flowDataReservedKeys\": {\n \"$comment\": \"flow_data_key_reserved (ERROR, no loop demotion): a key of the top-level data: map that names engine state. data: is seeded into the mission's .data namespace, where the engine keeps its own bookkeeping, so a flow declaring such a key would forge it. Matching is exact and case-sensitive. A key is reserved when it is one of exact (each with its reason), or starts with one of prefixes (checked in order, first wins; each with its reason). The finding's field is fieldFormat with the key; the message is messageFormat with the key (JSON-quoted, as Go's %q) then the reason; the suggestion is verbatim. Findings are sorted by key. Reference: FlowDataKeyReservation, validateFlowDataKeysAreNotReserved (aigentflow#247 review).\",\n \"code\": \"flow_data_key_reserved\",\n \"fieldFormat\": \"data.%s\",\n \"messageFormat\": \"data: key %s is reserved: %s. It would write into the engine's own state, so it is not seeded.\",\n \"suggestion\": \"Rename the key (no leading `_` or `.`, and not one of the engine namespaces memory., orchestrator., campaign., voiceagent.).\",\n \"exact\": {\n \"org_id\": \"the mission's organization, set by the engine for Thalamus/Engram calls\",\n \"memory\": \"the memory scope namespace\",\n \"orchestrator\": \"the orchestrator's state namespace\",\n \"campaign\": \"the campaign's state namespace\",\n \"voiceagent\": \"the voice agent's state namespace\",\n \"current_flow\": \"engine bookkeeping (the current flow definition)\",\n \"modified_flow\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_history\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_pending\": \"engine bookkeeping (dynamic flow modification)\",\n \"modification_requests\": \"engine bookkeeping (dynamic flow modification)\",\n \"bottleneck_state\": \"engine bookkeeping (bottleneck analysis)\"\n },\n \"prefixes\": [\n { \"prefix\": \"_\", \"reason\": \"keys starting with `_` are engine bookkeeping (current flow, loop and for_each context, taint lists such as `__untrusted_*`)\" },\n { \"prefix\": \".\", \"reason\": \"keys starting with `.` are engine step-response slots\" },\n { \"prefix\": \"memory.\", \"reason\": \"the `memory.` namespace belongs to the engine\" },\n { \"prefix\": \"orchestrator.\", \"reason\": \"the `orchestrator.` namespace belongs to the orchestrator\" },\n { \"prefix\": \"campaign.\", \"reason\": \"the `campaign.` namespace belongs to the campaign engine\" },\n { \"prefix\": \"voiceagent.\", \"reason\": \"the `voiceagent.` namespace belongs to the voice agent\" }\n ]\n },\n \"credentialEndpointPairing\": {\n \"$comment\": \"credential_endpoint_unpaired (WARNING, never an error): the one statically certain shape of AIgentFlow's run-time credential/endpoint pairing refusal. ai: an ai://<provider>/... step (top-level or loop sub-step) whose query holds a non-empty string <provider>+providerBaseUrlParamSuffix while neither its query (genericKeyParam or <provider>+providerKeyParamSuffix, non-empty strings) nor executor_config.<provider>.api_key (a literal, not an env reference) supplies a key; and executor_config.<provider>.base_url for a provider in executorConfigProviders when it is a literal, the block has no literal api_key, and it is not the case that at least one step uses the provider and every such step brings its own query key. keylessProviders are exempt from both. families: a step whose executor resolves (the key protocol+familyKeySeparator+driver, else protocol) to a row. implicitServerCredential rows are never judged. A row warns when its secret (the first non-empty string secretParam in the query, else per configKey in order: executor_config api_key when configApiKeyParam is a secretParam, else the first non-empty string secretParam under extra) is exactly an env reference to a serverEnv name on a row with expandsServerEnvReferences, and its endpoint (the first non-empty string endpointParam in the query, else per configKey: base_url when configBaseUrlParam is an endpointParam, else the first non-empty string endpointParam under extra) is a literal: no templateActionOpen, not an env reference, and not of the same origin as a defaultEndpoint (lower-cased scheme://host:port, defaultPorts filled). serverEnv is the reference's per-family server-variable set, evaluated. Field formats are the reference's. Reference: validateCredentialEndpointPairing (DC-FORGE-231) and validateFamilyCredentialEndpointPairing (DC-FORGE-233).\",\n \"stepFieldFormat\": \"steps.%s.query.%s\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.query.%s\",\n \"executorConfigBaseUrlFieldFormat\": \"executor_config.%s.base_url\",\n \"executorConfigKeyFieldFormat\": \"executor_config.%s.%s\",\n \"executorConfigExtraFieldFormat\": \"executor_config.%s.extra.%s\",\n \"executorConfigApiKeyField\": \"api_key\",\n \"executorConfigBaseUrlField\": \"base_url\",\n \"protocolSeparator\": \"://\",\n \"defaultPorts\": {\n \"http\": \"80\",\n \"https\": \"443\"\n },\n \"ai\": {\n \"protocol\": \"ai\",\n \"genericKeyParam\": \"api_key\",\n \"providerKeyParamSuffix\": \"_api_key\",\n \"providerBaseUrlParamSuffix\": \"_base_url\",\n \"keylessProviders\": [\n \"ollama\",\n \"vllm\"\n ],\n \"executorConfigProviders\": [\n \"anthropic\",\n \"assemblyai\",\n \"azure\",\n \"bedrock\",\n \"blackforestlabs\",\n \"cohere\",\n \"custom\",\n \"deepgram\",\n \"deepseek\",\n \"elevenlabs\",\n \"google\",\n \"inception\",\n \"leonardoai\",\n \"minimax\",\n \"mistral\",\n \"moonshot\",\n \"ollama\",\n \"openai\",\n \"perplexity\",\n \"qwen\",\n \"speechmatics\",\n \"vaiembed\",\n \"verda\",\n \"vllm\",\n \"xai\"\n ]\n },\n \"familyKeySeparator\": \"/\",\n \"families\": {\n \"db\": {\n \"protocol\": \"db\",\n \"configKeys\": [],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_DB_POSTGRES_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MYSQL_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MONGODB_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_REDIS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_NEO4J_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_MILVUS_CONNECTION_STRING\",\n \"AIGENTFLOW_DB_QDRANT_BASE_URL\",\n \"AIGENTFLOW_DB_WEAVIATE_BASE_URL\",\n \"AIGENTFLOW_DB_ELASTICSEARCH_BASE_URL\",\n \"AIGENTFLOW_DB_PINECONE_API_KEY\"\n ]\n },\n \"deepr\": {\n \"protocol\": \"deepr\",\n \"configKeys\": [\n \"deepr\"\n ],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"http://localhost:28081\"\n ],\n \"configApiKeyParam\": \"api_key\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_DEEPR_API_KEY\",\n \"AIGENTFLOW_DEEPR_BASE_URL\"\n ]\n },\n \"getmd\": {\n \"protocol\": \"getmd\",\n \"configKeys\": [\n \"getmd\"\n ],\n \"secretParams\": [],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_GETMD_BASE_URL\"\n ]\n },\n \"homeassistant\": {\n \"protocol\": \"homeassistant\",\n \"configKeys\": [\n \"api\"\n ],\n \"secretParams\": [\n \"token\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"http://homeassistant.local:8123\"\n ],\n \"configApiKeyParam\": \"token\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_HOMEASSISTANT_BASE_URL\",\n \"AIGENTFLOW_HOMEASSISTANT_TOKEN\"\n ]\n },\n \"hosting\": {\n \"protocol\": \"hosting\",\n \"configKeys\": [\n \"hosting_trove\"\n ],\n \"secretParams\": [\n \"trove_auth_token\"\n ],\n \"endpointParams\": [\n \"trove_base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIF_TROVE_BASE_URL\",\n \"AIF_TROVE_AUTH_TOKEN\"\n ]\n },\n \"mcp/http\": {\n \"protocol\": \"mcp\",\n \"configKeys\": [\n \"mcp\"\n ],\n \"secretParams\": [\n \"auth_token\"\n ],\n \"endpointParams\": [\n \"server_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"auth_token\",\n \"configBaseUrlParam\": \"server_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_MCP_DEFAULT_SERVER_URL\",\n \"AIGENTFLOW_MCP_AUTH_TOKEN\"\n ]\n },\n \"mqtt\": {\n \"protocol\": \"mqtt\",\n \"configKeys\": [\n \"broker\"\n ],\n \"secretParams\": [\n \"password\"\n ],\n \"endpointParams\": [\n \"broker_url\"\n ],\n \"defaultEndpoints\": [\n \"tcp://localhost:1883\"\n ],\n \"configApiKeyParam\": \"password\",\n \"configBaseUrlParam\": \"broker_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_MQTT_BROKER_URL\",\n \"AIGENTFLOW_MQTT_USERNAME\",\n \"AIGENTFLOW_MQTT_PASSWORD\"\n ]\n },\n \"opencorporates\": {\n \"protocol\": \"opencorporates\",\n \"configKeys\": [\n \"company\"\n ],\n \"secretParams\": [\n \"api_token\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"https://api.opencorporates.com/v0.4\"\n ],\n \"configApiKeyParam\": \"api_token\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_OPENCORPORATES_API_KEY\"\n ]\n },\n \"shelly\": {\n \"protocol\": \"shelly\",\n \"configKeys\": [\n \"device\"\n ],\n \"secretParams\": [\n \"auth_key\"\n ],\n \"endpointParams\": [\n \"device_ip\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"auth_key\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": false,\n \"serverEnv\": [\n \"AIGENTFLOW_SHELLY_AUTH_KEY\"\n ]\n },\n \"staticmap\": {\n \"protocol\": \"staticmap\",\n \"configKeys\": [\n \"geoapify\"\n ],\n \"secretParams\": [\n \"api_key\"\n ],\n \"endpointParams\": [\n \"base_url\"\n ],\n \"defaultEndpoints\": [\n \"https://maps.geoapify.com/v1\"\n ],\n \"configApiKeyParam\": \"api_key\",\n \"configBaseUrlParam\": \"base_url\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_GEOAPIFY_API_KEY\"\n ]\n },\n \"storage/s3\": {\n \"protocol\": \"storage\",\n \"configKeys\": [\n \"s3\"\n ],\n \"secretParams\": [\n \"secret_access_key\"\n ],\n \"endpointParams\": [\n \"endpoint\",\n \"public_endpoint\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"access_key_id\",\n \"configBaseUrlParam\": \"endpoint\",\n \"implicitServerCredential\": false,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\"\n ]\n },\n \"storage/trove\": {\n \"protocol\": \"storage\",\n \"configKeys\": [],\n \"secretParams\": [\n \"trove_auth_token\"\n ],\n \"endpointParams\": [\n \"trove_base_url\"\n ],\n \"defaultEndpoints\": [],\n \"configApiKeyParam\": \"\",\n \"configBaseUrlParam\": \"\",\n \"implicitServerCredential\": true,\n \"expandsServerEnvReferences\": true,\n \"serverEnv\": [\n \"AIGENTFLOW_STORAGE_S3_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_PUBLIC_ENDPOINT\",\n \"AIGENTFLOW_STORAGE_S3_ACCESS_KEY\",\n \"AIGENTFLOW_STORAGE_S3_SECRET_KEY\",\n \"AIGENTFLOW_STORAGE_S3_BUCKET\",\n \"AIGENTFLOW_STORAGE_S3_REGION\",\n \"AIGENTFLOW_TROVE_PUBLIC_S3_ENDPOINT\",\n \"AIGENTFLOW_TROVE_BASE_URL\",\n \"AIGENTFLOW_TROVE_AUTH_TOKEN\",\n \"AIGENTFLOW_TROVE_COFFER_ID\"\n ]\n }\n }\n },\n \"templateDefaultPiped\": {\n \"$comment\": \"template_default_piped (ERROR at the top level, WARNING inside a loop body, like template_syntax_error). The template function `default` takes the value FIRST; a pipeline that passes a value into it as a non-first command hands the piped value as the LAST argument, so the fallback is always the result. Flagged: any pipeline (in any action, including if / else if / range / with / template / block conditions, parenthesised sub-pipelines and variable declarations) in which a command whose first word is the bare identifier `default` is not the FIRST command. Never flagged: a field, a variable, a string literal, a comment, `default` as the first command. The message fills %s with the pipeline.\",\n \"code\": \"template_default_piped\",\n \"function\": \"default\",\n \"messageFormat\": \"`default` takes the value FIRST, and a pipe passes the piped value LAST: `%s` is `default <fallback> <value>`, so the fallback is always the result\",\n \"suggestion\": \"write the value first and the fallback second, as a call: `{{ default .x \\\"fallback\\\" }}`\"\n },\n \"complianceResidency\": {\n \"$comment\": \"compliance_residency_unenforced (WARNING, never an error; needs no catalogue). When compliance.residency is non-empty and every code (trimmed, upper-cased) is in euResidencyCodes, each top-level step and loop sub-step whose executor starts with aiProtocol+protocolSeparator, then the orchestrator (provider = its exons execution.provider), warns when its provider (literal, lower-cased; skipped when empty or containing templateActionOpen) is in regionLaneProviders and the call is not pinned. Pinned = query region (orchestrator.region) a non-empty string after trimming; OR enforce_region true (query: bool true or the strings in enforceRegionTrueStrings; orchestrator: bool true); OR the author named the endpoint: query <provider>+baseUrlParamSuffix a non-empty string after trimming, or executor_config.<provider>.base_url non-empty after trimming. The provider segment of ai://<provider>/<operation> exists only when a slash follows it. regionLaneProviders is the set of providers whose adapter routes on `region`; a provider outside it has no region lane and is never warned. Message, suggestion and site formats fill %s and %q (a Go-quoted string) in order; the message's last placeholder is the residency list as written, printed [A B]. Reference: validateResidencyEnforcement (validation.residency.go).\",\n \"code\": \"compliance_residency_unenforced\",\n \"euResidencyCodes\": [\"EU\", \"DE\", \"FR\", \"IE\", \"NL\", \"IT\", \"ES\"],\n \"regionLaneProviders\": [\n \"bedrock\",\n \"google\",\n \"azure\",\n \"openai\",\n \"assemblyai\",\n \"speechmatics\",\n \"deepgram\",\n \"mistral\"\n ],\n \"aiProtocol\": \"ai\",\n \"protocolSeparator\": \"://\",\n \"regionParam\": \"region\",\n \"enforceRegionParam\": \"enforce_region\",\n \"baseUrlParamSuffix\": \"_base_url\",\n \"enforceRegionTrueStrings\": [\"true\", \"1\", \"yes\"],\n \"stepFieldFormat\": \"steps.%s.executor\",\n \"loopStepFieldFormat\": \"steps.%s.loop.steps.%s.executor\",\n \"orchestratorField\": \"orchestrator.exons\",\n \"siteStepFormat\": \"step %q\",\n \"siteLoopStepFormat\": \"loop sub-step %q of step %q\",\n \"siteOrchestrator\": \"the orchestrator\",\n \"messageFormat\": \"%s calls provider %q, whose default endpoint commits to no jurisdiction, but sets neither region nor enforce_region, so nothing pins it to the declared residency %v. compliance.residency is a catalogue eligibility check, not endpoint evidence\",\n \"suggestion\": \"Add `region: eu` and `enforce_region: true` to the call (an orchestrator: the same two keys on the orchestrator block). Prove it afterwards: the step record's diagnostics.region is stamped from the host actually dialled.\"\n },\n \"examples\": {\n \"$comment\": \"The examples: block. Derived from the reference's constants, never hand-typed: limits, vocabularies, the credential-shaped-literal pattern set and each code's severity. example_ref_blocked_host is listed for completeness but is raised by the reference implementation only; the ports never raise it. See PARITY.md, 'The examples block'.\",\n \"limits\": {\n \"maxPerFlow\": 50,\n \"maxBlockBytes\": 262144,\n \"maxInlineInputBytes\": 32768,\n \"maxReferenceTextBytes\": 32768,\n \"maxVariants\": 10,\n \"maxTags\": 8,\n \"maxMustNot\": 12,\n \"maxMustNotContain\": 20,\n \"maxRubricRunes\": 4000,\n \"maxGuidanceRunes\": 2000,\n \"maxNotesRunes\": 2000,\n \"titleMaxRunes\": 80,\n \"maxMustNotRunes\": 300,\n \"maxMustNotContainLength\": 200,\n \"maxProvenanceRunes\": 200,\n \"maxNoteRunes\": 300,\n \"maxUrlBytes\": 2048,\n \"maxPatternLength\": 512,\n \"weightMax\": 10,\n \"minScoreMin\": 0,\n \"minScoreMax\": 1\n },\n \"idPattern\": \"^[a-z][a-z0-9_]{1,47}$\",\n \"tagPattern\": \"^[a-z][a-z0-9_-]{0,31}$\",\n \"sha256Pattern\": \"^[0-9a-f]{64}$\",\n \"mediaTypePattern\": \"^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$\",\n \"signedUrlQueryKeyPattern\": \"^(x-amz-signature|signature|sig|token|access_token|key|x-goog-signature|se|sp)$\",\n \"origins\": [\n \"author\",\n \"synthetic\"\n ],\n \"sideEffects\": [\n \"refuse\",\n \"allow\"\n ],\n \"statuses\": [\n \"completed\",\n \"failed\",\n \"paused_for_human\"\n ],\n \"reservedRefSchemes\": [\n \"artifact\",\n \"trove\",\n \"aiv\",\n \"s3\",\n \"gs\"\n ],\n \"secretPatterns\": [\n {\n \"name\": \"an API key\",\n \"expr\": \"\\\\bsk-[A-Za-z0-9_-]{20,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a platform API key\",\n \"expr\": \"\\\\bcrn_[A-Za-z0-9]{16,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"an AWS access key\",\n \"expr\": \"\\\\bAKIA[0-9A-Z]{16}\\\\b\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a private key\",\n \"expr\": \"-----BEGIN [A-Z ]*PRIVATE KEY-----\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a bearer token\",\n \"expr\": \"\\\\bbearer\\\\s+[A-Za-z0-9._~+/-]{20,}\",\n \"flags\": \"i\"\n },\n {\n \"name\": \"a Slack token\",\n \"expr\": \"\\\\bxox[abprs]-[A-Za-z0-9-]{10,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a GitHub token\",\n \"expr\": \"\\\\bgh[pousr]_[A-Za-z0-9]{30,}\",\n \"flags\": \"\"\n },\n {\n \"name\": \"a retired registry key\",\n \"expr\": \"\\\\baivk_[A-Za-z0-9]{20,}\",\n \"flags\": \"\"\n }\n ],\n \"codes\": {\n \"example_checkpoint_status\": \"error\",\n \"example_checkpoint_step_composite\": \"error\",\n \"example_checkpoint_step_unknown\": \"error\",\n \"example_expectation_contradiction\": \"warning\",\n \"example_expected_conflict\": \"error\",\n \"example_expected_empty\": \"error\",\n \"example_expected_field_unchecked\": \"warning\",\n \"example_expected_field_unknown\": \"error\",\n \"example_expected_missing\": \"error\",\n \"example_field_matcher_invalid\": \"error\",\n \"example_file_input_needs_ref\": \"error\",\n \"example_guidance_missing\": \"warning\",\n \"example_guidance_too_long\": \"error\",\n \"example_holdout_in_public_flow\": \"error\",\n \"example_id_duplicate\": \"error\",\n \"example_id_invalid\": \"error\",\n \"example_id_missing\": \"error\",\n \"example_input_conflict\": \"error\",\n \"example_input_invalid\": \"error\",\n \"example_input_missing\": \"error\",\n \"example_input_too_large\": \"error\",\n \"example_input_unvalidated\": \"warning\",\n \"example_min_score_range\": \"error\",\n \"example_must_not_contain_invalid\": \"error\",\n \"example_must_not_invalid\": \"error\",\n \"example_notes_too_long\": \"error\",\n \"example_ref_blocked_host\": \"error\",\n \"example_ref_invalid\": \"error\",\n \"example_ref_media_type_invalid\": \"error\",\n \"example_ref_scheme\": \"error\",\n \"example_ref_scheme_reserved\": \"error\",\n \"example_ref_sha256_invalid\": \"error\",\n \"example_ref_signed_url\": \"warning\",\n \"example_ref_unpinned\": \"warning\",\n \"example_reference_binary\": \"warning\",\n \"example_reference_invalid\": \"error\",\n \"example_rubric_empty\": \"error\",\n \"example_rubric_too_long\": \"error\",\n \"example_secret_like_value\": \"error\",\n \"example_secret_value\": \"error\",\n \"example_side_effects_invalid\": \"error\",\n \"example_status_invalid\": \"error\",\n \"example_tag_invalid\": \"error\",\n \"example_title_missing\": \"error\",\n \"example_title_too_long\": \"error\",\n \"example_variant_empty\": \"error\",\n \"example_variant_id_duplicate\": \"error\",\n \"example_variant_id_invalid\": \"error\",\n \"example_variant_input_conflict\": \"error\",\n \"example_variant_input_invalid\": \"error\",\n \"example_variant_origin_invalid\": \"error\",\n \"example_variant_unchecked\": \"warning\",\n \"example_variants_too_many\": \"error\",\n \"example_weight_range\": \"error\",\n \"examples_all_held_out\": \"warning\",\n \"examples_block_too_large\": \"error\",\n \"examples_published_with_public_flow\": \"warning\",\n \"examples_too_many\": \"error\",\n \"examples_unreadable_by_judge\": \"warning\"\n }\n },\n \"knownKeys\": {\n \"$comment\": \"Derived by reflection over the reference's Flow type, following yaml.v3's field rules (yaml tag, lowercased field name, inline structs merged). KnownFields(true) refuses any key a struct type does not declare. A shape is scalar | any | map<S> | list<S> | a type name below. any is never inspected (a Go interface, or a type with its own unmarshaller). How it is derived and checked, and how to regenerate it: PARITY.md, 'Unknown keys and value kinds'.\",\n \"root\": \"Flow\",\n \"types\": {\n \"BillingConfig\": {\n \"max_credits\": \"scalar\"\n },\n \"CampaignChildFlowDef\": {\n \"alias\": \"scalar\",\n \"flow_id\": \"scalar\",\n \"flow_name\": \"scalar\"\n },\n \"CampaignConfig\": {\n \"child_flows\": \"list<CampaignChildFlowDef>\",\n \"max_concurrent\": \"scalar\",\n \"max_credits_per_child\": \"scalar\",\n \"max_depth\": \"scalar\",\n \"max_total_children\": \"scalar\",\n \"on_children_complete\": \"scalar\",\n \"shared_memory\": \"scalar\"\n },\n \"Checkpoint\": {\n \"exact\": \"map<any>\",\n \"fields\": \"map<FieldMatcher>\",\n \"min_score\": \"scalar\",\n \"must_not\": \"list<scalar>\",\n \"must_not_contain\": \"list<scalar>\",\n \"optional\": \"scalar\",\n \"reference\": \"ExampleReference\",\n \"rubric\": \"scalar\",\n \"status\": \"scalar\"\n },\n \"CheckpointConfig\": {\n \"enabled\": \"scalar\",\n \"interval_steps\": \"scalar\",\n \"max_per_mission\": \"scalar\",\n \"on_completion\": \"scalar\",\n \"pre_dfm\": \"scalar\"\n },\n \"ConditionDefinition\": {\n \"goto\": \"scalar\",\n \"if\": \"scalar\"\n },\n \"ErrorStrategyDefinition\": {\n \"action\": \"scalar\",\n \"backoff_multiplier\": \"scalar\",\n \"exponential_backoff\": \"scalar\",\n \"goto_step\": \"scalar\",\n \"jitter\": \"scalar\",\n \"max_delay\": \"scalar\",\n \"max_retries\": \"scalar\",\n \"retry_delay\": \"scalar\",\n \"retry_on\": \"list<scalar>\"\n },\n \"ExampleDefinition\": {\n \"checkpoints\": \"map<Checkpoint>\",\n \"expected\": \"Expectation\",\n \"guidance\": \"scalar\",\n \"hold_out\": \"scalar\",\n \"id\": \"scalar\",\n \"input\": \"map<any>\",\n \"input_ref\": \"FileRef\",\n \"min_score\": \"scalar\",\n \"notes\": \"scalar\",\n \"side_effects\": \"scalar\",\n \"tags\": \"list<scalar>\",\n \"title\": \"scalar\",\n \"variants\": \"list<ExampleVariant>\",\n \"weight\": \"scalar\"\n },\n \"ExampleReference\": {\n \"ref\": \"FileRef\",\n \"text\": \"scalar\"\n },\n \"ExampleVariant\": {\n \"expected\": \"Expectation\",\n \"guidance\": \"scalar\",\n \"id\": \"scalar\",\n \"input_patch\": \"map<any>\",\n \"input_ref\": \"FileRef\",\n \"origin\": \"scalar\",\n \"provenance\": \"scalar\",\n \"title\": \"scalar\",\n \"weight\": \"scalar\"\n },\n \"ExecutorDefaultsDefinition\": {\n \"frequency_penalty\": \"scalar\",\n \"max_tokens\": \"scalar\",\n \"presence_penalty\": \"scalar\",\n \"temperature\": \"scalar\",\n \"top_p\": \"scalar\"\n },\n \"ExecutorInstanceDefinition\": {\n \"api_key\": \"scalar\",\n \"base_url\": \"scalar\",\n \"defaults\": \"ExecutorDefaultsDefinition\",\n \"enable_streaming\": \"scalar\",\n \"extra\": \"map<any>\",\n \"organization\": \"scalar\",\n \"service_channel\": \"scalar\",\n \"timeout_seconds\": \"scalar\",\n \"tool_credentials\": \"map<scalar>\"\n },\n \"ExonsUploadsFlowConfig\": {\n \"allowed_models\": \"list<scalar>\",\n \"allowed_providers\": \"list<scalar>\"\n },\n \"Expectation\": {\n \"exact\": \"map<any>\",\n \"fields\": \"map<FieldMatcher>\",\n \"min_score\": \"scalar\",\n \"must_not\": \"list<scalar>\",\n \"must_not_contain\": \"list<scalar>\",\n \"reference\": \"ExampleReference\",\n \"rubric\": \"scalar\",\n \"status\": \"scalar\"\n },\n \"FailoverBreakerConfig\": {\n \"failure_threshold\": \"scalar\",\n \"open_duration\": \"scalar\",\n \"success_threshold\": \"scalar\"\n },\n \"FailoverConfig\": {\n \"chain\": \"list<scalar>\",\n \"circuit_breaker\": \"FailoverBreakerConfig\",\n \"health_gate\": \"scalar\"\n },\n \"FieldExpectationDefinition\": {\n \"description\": \"scalar\",\n \"fallback\": \"any\",\n \"items\": \"PropertyDefinition\",\n \"required\": \"any\",\n \"type\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"FieldMatcher\": {\n \"approx\": \"scalar\",\n \"contains\": \"scalar\",\n \"equals\": \"any\",\n \"matches\": \"scalar\",\n \"not_contains\": \"scalar\",\n \"one_of\": \"list<any>\",\n \"present\": \"scalar\",\n \"tolerance\": \"scalar\"\n },\n \"FileRef\": {\n \"media_type\": \"scalar\",\n \"note\": \"scalar\",\n \"sha256\": \"scalar\",\n \"url\": \"scalar\"\n },\n \"Flow\": {\n \"aigentflow_version\": \"scalar\",\n \"billing\": \"BillingConfig\",\n \"campaign\": \"CampaignConfig\",\n \"checkpoint\": \"CheckpointConfig\",\n \"classification\": \"FlowClassification\",\n \"compliance\": \"FlowCompliance\",\n \"currency\": \"scalar\",\n \"data\": \"map<any>\",\n \"description\": \"scalar\",\n \"discoverable_tools\": \"list<scalar>\",\n \"display_name\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"examples\": \"list<ExampleDefinition>\",\n \"executor_config\": \"map<ExecutorInstanceDefinition>\",\n \"exons_uploads\": \"ExonsUploadsFlowConfig\",\n \"expression_functions\": \"list<map<scalar>>\",\n \"handle\": \"scalar\",\n \"input_schema\": \"InputSchema\",\n \"is_template\": \"scalar\",\n \"max_duration\": \"scalar\",\n \"mock_scenarios\": \"map<map<MockStepDefinition>>\",\n \"name\": \"scalar\",\n \"orchestrator\": \"OrchestratorDefinition\",\n \"output\": \"list<scalar>\",\n \"query\": \"map<QueryDefinition>\",\n \"rate_limit\": \"FlowRateLimitConfig\",\n \"start\": \"scalar\",\n \"steps\": \"map<StepDefinition>\",\n \"strict_templates\": \"scalar\",\n \"tags\": \"list<scalar>\",\n \"template\": \"FlowTemplateMetadata\",\n \"tool_discovery\": \"scalar\",\n \"version\": \"scalar\",\n \"visibility\": \"scalar\"\n },\n \"FlowClassification\": {\n \"ai_act_annex_iii\": \"scalar\",\n \"ai_act_annex_iii_acknowledgment\": \"scalar\",\n \"ai_act_annex_iii_area\": \"scalar\",\n \"ai_act_annex_iii_basis\": \"scalar\",\n \"art22_basis\": \"scalar\",\n \"betriebsrat_agreement_ref\": \"scalar\",\n \"processes_employee_data\": \"scalar\",\n \"processes_personal_data\": \"scalar\"\n },\n \"FlowCompliance\": {\n \"allowed_use_cases\": \"list<scalar>\",\n \"certifications\": \"list<scalar>\",\n \"disallow_training_on_inputs\": \"scalar\",\n \"max_retention\": \"scalar\",\n \"prohibited_use_cases\": \"list<scalar>\",\n \"residency\": \"list<scalar>\"\n },\n \"FlowRateLimitConfig\": {\n \"disabled\": \"scalar\",\n \"public_per_org_per_minute\": \"scalar\"\n },\n \"FlowTemplateMetadata\": {\n \"category\": \"scalar\",\n \"language\": \"scalar\",\n \"screenshot_url\": \"scalar\",\n \"summary\": \"scalar\"\n },\n \"ForEachDefinition\": {\n \"as\": \"scalar\",\n \"items\": \"scalar\",\n \"max_parallel\": \"scalar\",\n \"resolution\": \"scalar\",\n \"throttle\": \"ThrottleDefinition\"\n },\n \"InputSchema\": {\n \"fields\": \"list<InputSchemaField>\",\n \"version\": \"scalar\"\n },\n \"InputSchemaField\": {\n \"accept\": \"list<scalar>\",\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"label\": \"scalar\",\n \"max\": \"scalar\",\n \"max_items\": \"scalar\",\n \"max_length\": \"scalar\",\n \"max_size\": \"scalar\",\n \"min\": \"scalar\",\n \"min_items\": \"scalar\",\n \"min_length\": \"scalar\",\n \"name\": \"scalar\",\n \"pattern\": \"scalar\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"untrusted\": \"scalar\",\n \"visible_when\": \"VisibleWhenPredicate\"\n },\n \"LoopDefinition\": {\n \"max_iterations\": \"scalar\",\n \"steps\": \"list<LoopStepDefinition>\",\n \"vars\": \"map<scalar>\",\n \"while\": \"scalar\"\n },\n \"LoopStepDefinition\": {\n \"allow_untrusted\": \"list<scalar>\",\n \"condition\": \"scalar\",\n \"credential\": \"scalar\",\n \"credentials\": \"map<StepCredentialBinding>\",\n \"description\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"executor\": \"scalar\",\n \"id\": \"scalar\",\n \"next\": \"NextLogicDefinition\",\n \"output_schema\": \"InputSchema\",\n \"post_processing\": \"list<any>\",\n \"pre_processing\": \"list<any>\",\n \"query\": \"map<any>\",\n \"response_evaluation\": \"scalar\",\n \"trusted_output\": \"scalar\"\n },\n \"MockBinaryAsset\": {\n \"filename\": \"scalar\",\n \"id\": \"scalar\",\n \"metadata\": \"map<scalar>\",\n \"mime_type\": \"scalar\",\n \"size\": \"scalar\",\n \"step_id\": \"scalar\"\n },\n \"MockStepDefinition\": {\n \"api_action\": \"scalar\",\n \"binary_assets\": \"map<MockBinaryAsset>\",\n \"content\": \"any\",\n \"cost\": \"scalar\",\n \"delay\": \"scalar\",\n \"error\": \"scalar\"\n },\n \"NextLogicDefinition\": {\n \"conditions\": \"list<ConditionDefinition>\",\n \"default\": \"scalar\",\n \"parallel\": \"ParallelDefinition\"\n },\n \"OrchestratorDefinition\": {\n \"agentic\": \"scalar\",\n \"context_budget_tokens\": \"scalar\",\n \"context_strategy\": \"scalar\",\n \"conversation\": \"scalar\",\n \"deny_tools\": \"list<scalar>\",\n \"discoverable_tools\": \"list<scalar>\",\n \"enable_signals\": \"scalar\",\n \"enforce_region\": \"scalar\",\n \"engram_scope\": \"scalar\",\n \"exons\": \"scalar\",\n \"human_question_timeout\": \"scalar\",\n \"human_question_timeout_response\": \"scalar\",\n \"max_tool_calls\": \"scalar\",\n \"max_tool_turns\": \"scalar\",\n \"max_turns\": \"scalar\",\n \"mode\": \"scalar\",\n \"region\": \"scalar\",\n \"require_approval_for\": \"list<scalar>\",\n \"timeout_seconds\": \"scalar\",\n \"tool_discovery\": \"scalar\",\n \"tools\": \"list<scalar>\",\n \"triggers\": \"list<OrchestratorTriggerDef>\"\n },\n \"OrchestratorTriggerDef\": {\n \"condition\": \"scalar\",\n \"interval\": \"scalar\",\n \"type\": \"scalar\",\n \"watch\": \"scalar\"\n },\n \"ParallelDefinition\": {\n \"rendezvous\": \"scalar\",\n \"resolution\": \"scalar\",\n \"steps\": \"list<scalar>\"\n },\n \"PropertyDefinition\": {\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"format\": \"scalar\",\n \"items\": \"PropertyDefinition\",\n \"max_items\": \"scalar\",\n \"min_items\": \"scalar\",\n \"properties\": \"map<PropertyDefinition>\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"QualityGateDefinition\": {\n \"goto_step\": \"scalar\",\n \"max_retries\": \"scalar\",\n \"model\": \"scalar\",\n \"on_fail\": \"scalar\",\n \"provider\": \"scalar\",\n \"rubric\": \"scalar\",\n \"threshold\": \"scalar\"\n },\n \"QueryDefinition\": {\n \"default\": \"any\",\n \"description\": \"scalar\",\n \"enum\": \"list<scalar>\",\n \"items\": \"PropertyDefinition\",\n \"max_items\": \"scalar\",\n \"min_items\": \"scalar\",\n \"properties\": \"map<PropertyDefinition>\",\n \"required\": \"scalar\",\n \"type\": \"scalar\",\n \"untrusted\": \"scalar\",\n \"validation\": \"scalar\"\n },\n \"StepCredentialBinding\": {\n \"inject_as\": \"scalar\",\n \"source\": \"scalar\"\n },\n \"StepDefinition\": {\n \"allow_untrusted\": \"list<scalar>\",\n \"condition\": \"scalar\",\n \"credential\": \"scalar\",\n \"credentials\": \"map<StepCredentialBinding>\",\n \"description\": \"scalar\",\n \"error_strategy\": \"ErrorStrategyDefinition\",\n \"executor\": \"scalar\",\n \"failover\": \"FailoverConfig\",\n \"for_each\": \"ForEachDefinition\",\n \"loop\": \"LoopDefinition\",\n \"max_duration\": \"scalar\",\n \"next\": \"NextLogicDefinition\",\n \"output_schema\": \"InputSchema\",\n \"post_processing\": \"list<any>\",\n \"pre_processing\": \"list<any>\",\n \"quality_gate\": \"QualityGateDefinition\",\n \"query\": \"map<any>\",\n \"response_evaluation\": \"scalar\",\n \"response_expectation\": \"map<FieldExpectationDefinition>\",\n \"trusted_output\": \"scalar\"\n },\n \"ThrottleDefinition\": {\n \"batch_delay\": \"scalar\",\n \"batch_size\": \"scalar\",\n \"delay\": \"scalar\"\n },\n \"VisibleWhenPredicate\": {\n \"equals\": \"any\",\n \"field\": \"scalar\",\n \"in\": \"list<any>\"\n }\n }\n }\n}\n","// Typed accessor over the vendored enum spec. The JSON is the single source\n// of the protocol/type names; this module exposes it as frozen Sets/values for\n// fast, immutable lookups by the validators.\n\n// The JSON is bundled (inlined) by tsup/esbuild at build time, so there is no\n// runtime JSON module load to worry about across ESM/CJS targets.\nimport spec from './aigentflow-spec.json';\n\n/** The AIgentFlow version whose flow schema this validator tracks. */\nexport const SPEC_VERSION: string = spec.specVersion;\n\n/** Current supported `input_schema.version`. */\nexport const INPUT_SCHEMA_VERSION: number = spec.inputSchemaVersion;\n\n/** Known executor URI schemes. Unknown schemes are warned, not rejected. */\nexport const EXECUTOR_SCHEMES: ReadonlySet<string> = new Set(spec.executorSchemes);\n\n/** Valid data types for query params, array items, and response expectations. */\nexport const DATA_TYPES: ReadonlySet<string> = new Set(spec.dataTypes);\n\n/** Valid `error_strategy.action` values. */\nexport const ERROR_STRATEGY_ACTIONS: ReadonlySet<string> = new Set(spec.errorStrategyActions);\n\n/** Valid `error_strategy.retry_on` error categories. */\nexport const RETRY_ON_CATEGORIES: ReadonlySet<string> = new Set(spec.retryOnCategories);\n\n/**\n * `next` targets the reference's SAVE door accepts without a step of that name:\n * `null` and `orchestrator`. `end` is not one of them — `validateNextLogic`\n * (parser.go) looks `end` up as a step and refuses the flow when none exists.\n */\nexport const NEXT_MARKERS: ReadonlySet<string> = new Set(spec.nextMarkers);\n\n/**\n * Targets the reachability and cycle walks treat as \"control leaves the graph\".\n *\n * Since AIgentFlow v2.760.0 this holds the same values as {@link NEXT_MARKERS}:\n * no reference walk treats `end` as a terminal any more, so a real step named\n * `end` is reachable and a cycle through it is a cycle. Until then this set was\n * WIDER (it carried `end`), and a step named `end` that only `end` routed to was\n * reported `unreachable_step`. The two stay separate spec keys so a future\n * split is a one-value change.\n */\nexport const REACHABILITY_TERMINAL_MARKERS: ReadonlySet<string> = new Set(\n spec.reachabilityTerminalMarkers,\n);\n\n/** Valid `next.parallel.resolution` values. */\nexport const PARALLEL_RESOLUTIONS: ReadonlySet<string> = new Set(spec.parallelResolutions);\n\n/** Valid `for_each.resolution` values. */\nexport const FOR_EACH_RESOLUTIONS: ReadonlySet<string> = new Set(spec.forEachResolutions);\n\n/** Hard cap for `loop.max_iterations`. */\nexport const LOOP_MAX_ITERATIONS_LIMIT: number = spec.loopMaxIterationsLimit;\n\n/**\n * The ONE executor-URL shape, mirrored verbatim from `URL_PATTERN_REGEX` in\n * `aigentflow/aigentflow.domain.executorregistry.go`.\n *\n * AIgentFlow has exactly one executor-URL parser (`ParseExecutorURLString`), and\n * since v2.598.0 (DC-FORGE-30) its own static validation applies it at authoring\n * time — so `openai:///gpt-4` is refused at save instead of failing at dispatch.\n * Note how much stricter it is than a generic URI: the authority segment is\n * required and non-empty, and neither authority nor path may contain a dot.\n */\nexport const EXECUTOR_URL_PATTERN: RegExp = new RegExp(spec.executorUrlPattern);\n\n/** Opening delimiter of a Go-template action; a URL containing one is rendered before dispatch. */\nexport const TEMPLATE_ACTION_OPEN: string = spec.templateActionOpen;\n\n/** Credential binding source prefix (`stored/{provider}/{name}`). */\nexport const CREDENTIAL_REFERENCE_PREFIX: string = spec.credentialReferencePrefix;\n\n/** input_schema constants and limits. */\nexport const INPUT_SCHEMA = {\n types: new Set(spec.inputSchema.types) as ReadonlySet<string>,\n stringTypes: new Set(spec.inputSchema.stringTypes) as ReadonlySet<string>,\n parametricTypes: new Set(spec.inputSchema.parametricTypes) as ReadonlySet<string>,\n fieldNamePattern: new RegExp(spec.inputSchema.fieldNamePattern),\n datePattern: new RegExp(spec.inputSchema.datePattern),\n maxPatternLength: spec.inputSchema.maxPatternLength,\n maxConstraintValue: spec.inputSchema.maxConstraintValue,\n maxInputKeyCount: spec.inputSchema.maxInputKeyCount,\n maxStringInputLength: spec.inputSchema.maxStringInputLength,\n} as const;\n\n/** Valid orchestrator trigger types. */\nexport const ORCHESTRATOR_TRIGGERS: ReadonlySet<string> = new Set(spec.orchestrator.triggers);\n\n/** Recognised orchestrator tool names (vendored allow-list, may lag). */\nexport const ORCHESTRATOR_TOOLS: ReadonlySet<string> = new Set(spec.orchestrator.tools);\n\n/** Orchestrator termination-authority modes (DC-COND-1). Default = monitor. */\nexport const ORCHESTRATOR_MODES: ReadonlySet<string> = new Set(spec.orchestrator.modes);\n\n/** Recognised Go template function names (Go builtins + AIgentFlow registry). */\nexport const TEMPLATE_FUNCTIONS: ReadonlySet<string> = new Set(spec.templateFunctions);\n\n/** Canonical `eval://judge` URL invoked by the quality_gate machinery. */\nexport const EVAL_JUDGE_URL: string = spec.evalJudgeUrl;\n\n/** `quality_gate:` step-block constants and limits (DC-CP-8). */\nexport const QUALITY_GATE = {\n /** Accepted `on_fail` actions. */\n onFailActions: new Set(spec.qualityGate.onFailActions) as ReadonlySet<string>,\n /**\n * `on_fail` values that exist in the Go enum but are currently\n * validation-REJECTED (e.g. `human`, pending the human-task inbox).\n */\n onFailRejected: new Set(spec.qualityGate.onFailRejected) as ReadonlySet<string>,\n thresholdMin: spec.qualityGate.thresholdMin,\n thresholdMax: spec.qualityGate.thresholdMax,\n} as const;\n\n/**\n * The fixed `expression_functions:` catalog (DC-FORGE-72).\n *\n * The catalog is compiled into the AIgentFlow binary — nothing is loaded at run\n * time, ever — so it is an enumerable set, and a `function:` outside it is an\n * error rather than a lag-prone allow-list warning (contrast divergence #4).\n * Every entry carries {@link EXPRESSION_FUNCTION_NAME_PREFIX} so a catalog entry\n * can never shadow a standard template function such as `index` or `default`.\n */\nexport const EXPRESSION_FUNCTION_CATALOG: ReadonlySet<string> = new Set(\n spec.expressionFunctions.catalog,\n);\n\n/** Mandatory namespace prefix carried by every catalog entry. */\nexport const EXPRESSION_FUNCTION_NAME_PREFIX: string = spec.expressionFunctions.namePrefix;\n\n/**\n * Pre/post-processing operation dispatch set and per-operation config keys.\n *\n * Two things are modelled here and neither may be flattened into the other:\n *\n * - **Scope.** The standard handler (every top-level step's pre/post-processing)\n * dispatches {@link PROCESSING_OPERATIONS.standardTypes}. A loop sub-step's\n * post-processing handles `loop.set` / `loop.break` itself before delegating,\n * so those two are legal only there. Keeping them apart is the point: a name\n * in the wrong half is exactly the mistake a merged set cannot see.\n * - **Key sets are PER OPERATION, never a union.** `asset_id` is read by\n * `binary.get`/`binary.update`/`binary.delete` and is NOT read by\n * `binary.transform`, which reads `source_asset_id`. A union-based check would\n * pass the wrong-half key, which is the defect class this rule exists for.\n *\n * `openKeyTypes` are the operations whose config keys are chosen by the AUTHOR\n * (`data.set` writes every key into `.data`, `output.set` into `.output`,\n * `conversation.append` treats every key as a conversation id, `loop.set` as a\n * loop variable), so \"unknown key\" is not a notion that applies to them at all.\n *\n * Scope note: only TOP-LEVEL config keys are modelled. Sub-keys of `metadata:`\n * (the asset store's vocabulary) and `parameters:` (the transformer's) are not.\n */\nexport const PROCESSING_OPERATIONS = {\n /** The optional guard key, a sibling of the operation key rather than a config key. */\n guardKey: spec.processingOperations.guardKey,\n /** Operation types the standard (top-level step) handler dispatches. */\n standardTypes: new Set(spec.processingOperations.standardTypes) as ReadonlySet<string>,\n /** Operation types dispatchable ONLY in a loop sub-step's post_processing. */\n loopSubStepTypes: new Set(spec.processingOperations.loopSubStepTypes) as ReadonlySet<string>,\n /** Operations whose config keys are author-chosen; they have no unknown-key notion. */\n openKeyTypes: new Set(spec.processingOperations.openKeyTypes) as ReadonlySet<string>,\n /** Per-operation top-level config keys, for the operations with a CLOSED key set. */\n closedConfigKeys: spec.processingOperations.closedConfigKeys as Readonly<\n Record<string, readonly string[]>\n >,\n} as const;\n\n/**\n * The top-level config keys an operation reads, and whether that set is CLOSED.\n *\n * A `false` second element means there is no basis for a verdict about a key —\n * either the operation chooses its own key names, or the type is not\n * dispatchable at all. Callers must check the flag rather than the array length.\n */\nexport function processingOperationConfigKeys(operationType: string): [readonly string[], boolean] {\n if (PROCESSING_OPERATIONS.openKeyTypes.has(operationType)) return [[], false];\n const keys = PROCESSING_OPERATIONS.closedConfigKeys[operationType];\n return keys === undefined ? [[], false] : [keys, true];\n}\n\n/**\n * The key set the reference's strict save parser enforces at every level of a\n * flow document, derived from its own types (see the `$comment` in the JSON).\n * `types[T]` maps each key a struct type declares to the SHAPE of its value.\n */\nexport const KNOWN_KEYS = spec.knownKeys as {\n readonly root: string;\n readonly types: Readonly<Record<string, Readonly<Record<string, string>>>>;\n};\n\n/**\n * Which orchestrator tools the inline `.exons` definition's `tools.allow` may\n * withhold (AIgentFlow v2.760.0, `orchestrator_tool_withheld`). A tool is offered\n * only if it passes BOTH `orchestrator.tools` (empty = every tool) AND\n * `tools.allow` (absent = no narrowing). The lifecycle tools, and the signal\n * tools while `enable_signals` is on (the default), are exempt from\n * `tools.allow`.\n */\nexport const ORCHESTRATOR_TOOL_ALLOW = {\n warningField: spec.orchestratorToolAllow.warningField,\n askHumanTool: spec.orchestratorToolAllow.askHumanTool,\n enableSignalsDefault: spec.orchestratorToolAllow.enableSignalsDefault,\n lifecycleTools: spec.orchestratorToolAllow.lifecycleTools as readonly string[],\n signalTools: spec.orchestratorToolAllow.signalTools as readonly string[],\n campaignTools: spec.orchestratorToolAllow.campaignTools as readonly string[],\n} as const;\n\n/** How the orchestrator's inline `.exons` document is delimited. */\nexport const EXONS = {\n /** The YAML frontmatter delimiter line. */\n frontmatterDelimiter: spec.exons.frontmatterDelimiter,\n} as const;\n\n/**\n * The agent surfaces AIgentFlow removed (AIgentFlow v2.833.0): the `exons://`\n * and `agent://` executors, the flow-level `exons_uploads` key, and the\n * `ai://` parameters that configured its own agent loop. `executor_removed` and\n * `agentic_param_removed` are both errors, addressed to the step.\n */\nconst removed = spec.removedAgentSurfaces;\nexport const REMOVED_AGENT_SURFACES = {\n schemes: new Set<string>(removed.removedSchemes),\n paramScheme: removed.paramScheme,\n aiParams: new Set<string>(removed.aiParams),\n flowKeys: removed.flowKeys as readonly string[],\n executorRemovedCode: removed.executorRemovedCode,\n agenticParamRemovedCode: removed.agenticParamRemovedCode,\n schemeMessageFormat: removed.schemeMessageFormat,\n paramsMessageFormat: removed.paramsMessageFormat,\n flowKeyMessageFormat: removed.flowKeyMessageFormat,\n suggestion: removed.suggestion,\n} as const;\n\n/**\n * `executor_config` may expand only the environment variables of the key it is\n * written under (AIgentFlow v2.597.0, `executor_config_env_scope`). `scopes` is\n * the reference's own scope function evaluated for every key that has one; a\n * key absent from it has an EMPTY scope and refuses every reference.\n */\nexport const EXECUTOR_CONFIG_ENV_SCOPES = {\n referencePrefix: spec.executorConfigEnvScopes.referencePrefix,\n referenceSuffix: spec.executorConfigEnvScopes.referenceSuffix,\n fields: spec.executorConfigEnvScopes.fields as readonly string[],\n extraKey: spec.executorConfigEnvScopes.extraKey,\n scopes: spec.executorConfigEnvScopes.scopes as Readonly<Record<string, readonly string[]>>,\n} as const;\n\n/**\n * Executor parameters only the server's credential resolver may set (AIgentFlow\n * CFX-05, `server_owned_query_key`). A step's or loop sub-step's `query:` that\n * declares one is refused. `keys` is matched exactly and case-sensitively; the\n * two formats are the reference's field paths, `%s` filled in order.\n */\nexport const SERVER_OWNED_QUERY_KEYS = {\n keys: spec.serverOwnedQueryKeys.keys as readonly string[],\n stepFieldFormat: spec.serverOwnedQueryKeys.stepFieldFormat,\n loopStepFieldFormat: spec.serverOwnedQueryKeys.loopStepFieldFormat,\n} as const;\n\n/**\n * `flow_data_key_reserved`: top-level `data:` keys that name engine state. `exact`\n * maps a name to its reason; `prefixes` are checked in order, first match wins.\n * `messageFormat` takes the quoted key then the reason; `fieldFormat` the key.\n */\nexport const FLOW_DATA_RESERVED_KEYS = {\n code: spec.flowDataReservedKeys.code,\n fieldFormat: spec.flowDataReservedKeys.fieldFormat,\n messageFormat: spec.flowDataReservedKeys.messageFormat,\n suggestion: spec.flowDataReservedKeys.suggestion,\n exact: spec.flowDataReservedKeys.exact as Readonly<Record<string, string>>,\n prefixes: spec.flowDataReservedKeys.prefixes as readonly {\n readonly prefix: string;\n readonly reason: string;\n }[],\n} as const;\n\n/** One row of the reference's per-protocol credential/endpoint family table. */\nexport interface CredentialEndpointFamily {\n readonly protocol: string;\n readonly configKeys: readonly string[];\n readonly secretParams: readonly string[];\n readonly endpointParams: readonly string[];\n readonly defaultEndpoints: readonly string[];\n readonly configApiKeyParam: string;\n readonly configBaseUrlParam: string;\n readonly implicitServerCredential: boolean;\n readonly expandsServerEnvReferences: boolean;\n /** The family's server-variable set, evaluated from the reference's scope tables. */\n readonly serverEnv: readonly string[];\n}\n\n/**\n * The data of `credential_endpoint_unpaired` (AIgentFlow DC-FORGE-231 and\n * DC-FORGE-233): the ai:// provider rule's names and sets, the per-protocol\n * family table, the default ports, and the reference's field formats (`%s`\n * filled in order). A new family is a change to this data only.\n */\nexport const CREDENTIAL_ENDPOINT_PAIRING = {\n stepFieldFormat: spec.credentialEndpointPairing.stepFieldFormat,\n loopStepFieldFormat: spec.credentialEndpointPairing.loopStepFieldFormat,\n executorConfigBaseUrlFieldFormat: spec.credentialEndpointPairing.executorConfigBaseUrlFieldFormat,\n executorConfigKeyFieldFormat: spec.credentialEndpointPairing.executorConfigKeyFieldFormat,\n executorConfigExtraFieldFormat: spec.credentialEndpointPairing.executorConfigExtraFieldFormat,\n executorConfigApiKeyField: spec.credentialEndpointPairing.executorConfigApiKeyField,\n executorConfigBaseUrlField: spec.credentialEndpointPairing.executorConfigBaseUrlField,\n protocolSeparator: spec.credentialEndpointPairing.protocolSeparator,\n defaultPorts: spec.credentialEndpointPairing.defaultPorts as Readonly<Record<string, string>>,\n ai: {\n protocol: spec.credentialEndpointPairing.ai.protocol,\n genericKeyParam: spec.credentialEndpointPairing.ai.genericKeyParam,\n providerKeyParamSuffix: spec.credentialEndpointPairing.ai.providerKeyParamSuffix,\n providerBaseUrlParamSuffix: spec.credentialEndpointPairing.ai.providerBaseUrlParamSuffix,\n keylessProviders: spec.credentialEndpointPairing.ai.keylessProviders as readonly string[],\n executorConfigProviders: spec.credentialEndpointPairing.ai\n .executorConfigProviders as readonly string[],\n },\n familyKeySeparator: spec.credentialEndpointPairing.familyKeySeparator,\n families: spec.credentialEndpointPairing.families as Readonly<\n Record<string, CredentialEndpointFamily>\n >,\n} as const;\n\n/**\n * The data of `compliance_residency_unenforced` (AIgentFlow v2.821.0): the\n * EU-only residency codes, the region-lane providers, the parameter names and\n * the reference's site, field and message formats.\n */\nexport const COMPLIANCE_RESIDENCY = {\n code: spec.complianceResidency.code,\n euResidencyCodes: spec.complianceResidency.euResidencyCodes as readonly string[],\n regionLaneProviders: spec.complianceResidency.regionLaneProviders as readonly string[],\n aiProtocol: spec.complianceResidency.aiProtocol,\n protocolSeparator: spec.complianceResidency.protocolSeparator,\n regionParam: spec.complianceResidency.regionParam,\n enforceRegionParam: spec.complianceResidency.enforceRegionParam,\n baseUrlParamSuffix: spec.complianceResidency.baseUrlParamSuffix,\n enforceRegionTrueStrings: spec.complianceResidency.enforceRegionTrueStrings as readonly string[],\n stepFieldFormat: spec.complianceResidency.stepFieldFormat,\n loopStepFieldFormat: spec.complianceResidency.loopStepFieldFormat,\n orchestratorField: spec.complianceResidency.orchestratorField,\n siteStepFormat: spec.complianceResidency.siteStepFormat,\n siteLoopStepFormat: spec.complianceResidency.siteLoopStepFormat,\n siteOrchestrator: spec.complianceResidency.siteOrchestrator,\n messageFormat: spec.complianceResidency.messageFormat,\n suggestion: spec.complianceResidency.suggestion,\n} as const;\n\n/** One credential-shaped literal the `examples:` block refuses. */\nexport interface ExampleSecretPattern {\n readonly name: string;\n readonly expr: string;\n readonly flags: string;\n}\n\n/**\n * The data of the `examples:` rules: limits, closed vocabularies, the id / tag /\n * sha256 / media-type patterns, the reserved reference schemes, the\n * credential-shaped-literal set and each code's severity. Every number and\n * pattern the rules use is read from here, never typed into the module.\n */\nexport const EXAMPLES = {\n limits: spec.examples.limits,\n idPattern: new RegExp(spec.examples.idPattern),\n tagPattern: new RegExp(spec.examples.tagPattern),\n sha256Pattern: new RegExp(spec.examples.sha256Pattern),\n mediaTypePattern: new RegExp(spec.examples.mediaTypePattern),\n // The reference writes this pattern case-insensitively (`(?i)`); the spec\n // carries the bare expression, so the flag is applied here.\n signedUrlQueryKeyPattern: new RegExp(spec.examples.signedUrlQueryKeyPattern, 'i'),\n origins: new Set<string>(spec.examples.origins),\n sideEffects: new Set<string>(spec.examples.sideEffects),\n statuses: new Set<string>(spec.examples.statuses),\n reservedRefSchemes: new Set<string>(spec.examples.reservedRefSchemes),\n secretPatterns: (spec.examples.secretPatterns as readonly ExampleSecretPattern[]).map((p) => ({\n name: p.name,\n re: new RegExp(p.expr, p.flags),\n })),\n codes: spec.examples.codes as Readonly<Record<string, 'error' | 'warning'>>,\n} as const;\n\n/** The piped-`default` rule: code, function name, message and suggestion. */\nexport const TEMPLATE_DEFAULT_PIPED = {\n code: spec.templateDefaultPiped.code,\n function: spec.templateDefaultPiped.function,\n messageFormat: spec.templateDefaultPiped.messageFormat,\n suggestion: spec.templateDefaultPiped.suggestion,\n};\n\n/**\n * `unknown_function_operation`: the closed set of built-in `function://` operations\n * (authority + \"/\" + path, sorted). `messageFormat` takes the quoted step id, the\n * operation, then the comma-joined list; `suggestionFormat` takes the list.\n */\nexport const FUNCTION_OPERATIONS = {\n code: spec.functionOperations.code,\n scheme: spec.functionOperations.scheme,\n messageFormat: spec.functionOperations.messageFormat,\n suggestionFormat: spec.functionOperations.suggestionFormat,\n operations: new Set<string>(spec.functionOperations.operations),\n sorted: spec.functionOperations.operations as readonly string[],\n} as const;\n\n/**\n * `atlas://` rules. Every message format takes the quoted step id first; the\n * operation and capability-ref messages take one more value.\n */\nconst atlas = spec.atlasExecutor;\nexport const ATLAS_EXECUTOR = {\n scheme: atlas.scheme,\n providerAgent: atlas.providerAgent,\n providerCapability: atlas.providerCapability,\n agentResource: atlas.agentResource,\n capabilityRefPattern: new RegExp(atlas.capabilityRefPattern),\n operationUnknown: atlas.operationUnknown,\n agentMissing: atlas.agentMissing,\n agentNotLiteral: atlas.agentNotLiteral,\n capabilitiesNotLiteral: atlas.capabilitiesNotLiteral,\n promptMissing: atlas.promptMissing,\n promptBoth: atlas.promptBoth,\n capabilityRefInvalid: atlas.capabilityRefInvalid,\n modelNotLiteral: atlas.modelNotLiteral,\n paramRefused: {\n code: atlas.paramRefused.code,\n messageFormat: atlas.paramRefused.messageFormat,\n suggestion: atlas.paramRefused.suggestion,\n agentKeys: atlas.paramRefused.agentKeys as readonly string[],\n capabilityKeys: atlas.paramRefused.capabilityKeys as readonly string[],\n },\n} as const;\n\n/** `reserved_input_name`: an input declared in the platform's `__` namespace. */\nexport const RESERVED_INPUT_NAMES = {\n prefix: spec.reservedInputNames.prefix,\n code: spec.reservedInputNames.code,\n messageFormat: spec.reservedInputNames.messageFormat,\n suggestion: spec.reservedInputNames.suggestion,\n queryFieldFormat: spec.reservedInputNames.queryFieldFormat,\n schemaFieldFormat: spec.reservedInputNames.schemaFieldFormat,\n} as const;\n","// The orchestrator's inline `.exons` document, judged where the reference's\n// save door judges it: the exons half of `validateOrchestrator` (parser.go),\n// the `requirements.resources` refusal (AIgentFlow v2.767.0) and the\n// `orchestrator_tool_withheld` warning (v2.760.0).\n//\n// ⚠ This validator has NO `.exons` template engine and must not grow one: a\n// second implementation of that grammar would be a second opinion about it. It\n// reads the YAML FRONTMATTER only, the way the engine extracts and decodes it,\n// and refuses only where the engine is certain to refuse as well. What it cannot\n// see (PARITY.md, divergence #16): a document that fails to parse for any other\n// reason, including a spec the engine's own validation refuses; a tag that\n// cannot render (`exons_attributes`, on a step's `query.exons` and on the\n// orchestrator); and a frontmatter containing a tag, which the engine EXECUTES\n// before decoding, so it is not read at all. The direction is always looser,\n// never stricter.\n\nimport { isMap, isScalar, isSeq, parseAllDocuments } from 'yaml';\nimport type { Flow } from '../types.js';\nimport { EXONS, ORCHESTRATOR_TOOL_ALLOW } from '../spec/index.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\n\nconst CODE_PARSE_FAILED = 'orchestrator_exons_parse_failed';\nconst CODE_NO_PROVIDER = 'orchestrator_exons_no_provider';\nconst CODE_RESOURCES = 'exons_resources_unhonoured';\nconst CODE_TOOL_WITHHELD = 'orchestrator_tool_withheld';\n\n/** The engine's tag opener. A frontmatter containing it is executed before it is decoded. */\nconst EXONS_OPEN_DELIM = '{~';\n/** The retired JSON config-block opener; the engine refuses a document starting with it. */\nconst EXONS_LEGACY_CONFIG_OPEN = '{~exons.config~}';\nconst UTF8_BOM = '';\nconst MAX_ALIAS_COUNT = 100;\n\n/** One `requirements.resources` entry. */\nexport interface ExonsResource {\n ref: string;\n kind: string;\n scope: string;\n}\n\n/**\n * What the save-door rules know about one `.exons` document, from its\n * frontmatter alone. Mirrors the Go port's `ExonsReport` minus the fields only\n * an engine can fill.\n */\nexport interface ExonsFrontmatterReport {\n /**\n * Why the engine's parse is CERTAIN to refuse the document (an unclosed\n * frontmatter, the retired config block), or null.\n */\n parseError: string | null;\n /**\n * true when the fields below are known. false when the frontmatter cannot be\n * read the way the engine would (it contains a tag, or its YAML does not\n * decode into the fields the rules read); then no rule reads them.\n */\n specRead: boolean;\n /** The document declares a frontmatter spec. */\n hasSpec: boolean;\n /** `execution.provider`, '' when absent. */\n provider: string;\n /** An absent `tools.allow` (no narrowing) is not an empty one. */\n toolsAllowDeclared: boolean;\n toolsAllow: string[];\n resources: ExonsResource[];\n}\n\nconst UNREAD: ExonsFrontmatterReport = {\n parseError: null,\n specRead: false,\n hasSpec: false,\n provider: '',\n toolsAllowDeclared: false,\n toolsAllow: [],\n resources: [],\n};\n\n// Go's strings.TrimSpace (unicode.IsSpace), which differs from String.trim():\n// it trims U+0085 and does NOT trim U+FEFF.\nconst GO_SPACE =\n '\\\\t\\\\n\\\\v\\\\f\\\\r \\\\u0085\\\\u00a0\\\\u1680\\\\u2000-\\\\u200a\\\\u2028\\\\u2029\\\\u202f\\\\u205f\\\\u3000';\nconst GO_TRIM_SPACE = new RegExp(`^[${GO_SPACE}]+|[${GO_SPACE}]+$`, 'g');\n\nexport function goTrimSpace(s: string): string {\n return s.replace(GO_TRIM_SPACE, '');\n}\n\ninterface Frontmatter {\n frontmatter: string;\n hasFrontmatter: boolean;\n parseError: string | null;\n}\n\n/**\n * The engine's frontmatter extraction: after an optional UTF-8 BOM and leading\n * spaces or tabs (not newlines), the document must start with the delimiter\n * and a line break (LF or CRLF); the frontmatter ends at the next line that\n * starts with the delimiter followed by a line break (any CR counts) or the end\n * of the input, and is trimmed. A document without the opening delimiter has no\n * frontmatter; one whose frontmatter never closes, or that starts with the\n * retired config block, is refused.\n */\nexport function extractExonsFrontmatter(source: string): Frontmatter {\n const delim = EXONS.frontmatterDelimiter;\n let start = source.startsWith(UTF8_BOM) ? source.slice(UTF8_BOM.length) : source;\n start = start.replace(/^[ \\t]+/, '');\n if (start.startsWith(EXONS_LEGACY_CONFIG_OPEN)) {\n return {\n frontmatter: '',\n hasFrontmatter: false,\n parseError: 'legacy JSON config block detected; use YAML frontmatter',\n };\n }\n if (!start.startsWith(delim)) return { frontmatter: '', hasFrontmatter: false, parseError: null };\n let rest = start.slice(delim.length);\n if (rest.startsWith('\\n')) rest = rest.slice(1);\n else if (rest.startsWith('\\r\\n')) rest = rest.slice(2);\n else return { frontmatter: '', hasFrontmatter: false, parseError: null };\n\n let pos = 0;\n while (pos <= rest.length) {\n const line = rest.slice(pos);\n if (line.startsWith(delim)) {\n const after = line.slice(delim.length);\n if (after === '' || after[0] === '\\n' || after[0] === '\\r') {\n return {\n frontmatter: goTrimSpace(rest.slice(0, pos)),\n hasFrontmatter: true,\n parseError: null,\n };\n }\n }\n const nl = line.indexOf('\\n');\n if (nl < 0) break;\n pos += nl + 1;\n }\n return {\n frontmatter: '',\n hasFrontmatter: true,\n parseError: 'YAML frontmatter not properly closed',\n };\n}\n\n/**\n * Every number or boolean scalar becomes its SOURCE text, before conversion.\n * The fields the rules read are all Go `string`s (or lists of them), which\n * yaml.v3 fills from any scalar by its text; a scalar where a mapping or list\n * belongs is a decode error either way.\n */\nfunction retagScalars(node: unknown): void {\n if (isMap(node)) {\n for (const pair of node.items) {\n retagScalars(pair.key);\n retagScalars(pair.value);\n }\n } else if (isSeq(node)) {\n for (const item of node.items) retagScalars(item);\n } else if (\n isScalar(node) &&\n (typeof node.value === 'number' || typeof node.value === 'boolean') &&\n typeof node.source === 'string'\n ) {\n node.value = node.source;\n }\n}\n\n/** A declared field of the wrong shape: yaml.v3 fails the whole decode. */\nclass DecodeError extends Error {}\n\n/** yaml.v3 into a Go `string`: null is '', a scalar its text, anything else a decode error. */\nfunction goString(v: unknown): string {\n if (v === null || v === undefined) return '';\n if (isString(v)) return v;\n throw new DecodeError('not a string');\n}\n\n/**\n * yaml.v3 into a `[]string`: null is nil (absent). A null ELEMENT is dropped,\n * not decoded to '': yaml.v3 appends an element only when the decode set it,\n * and a null sets nothing in a string or a struct.\n */\nfunction goStringList(v: unknown): string[] | null {\n if (v === null || v === undefined) return null;\n if (!isArray(v)) throw new DecodeError('not a list');\n return v.filter((item) => item !== null).map(goString);\n}\n\n/** yaml.v3 into a struct pointer: null is nil. */\nfunction goStruct(v: unknown): Record<string, unknown> | null {\n if (v === null || v === undefined) return null;\n if (!isRecord(v)) throw new DecodeError('not a mapping');\n return v;\n}\n\n/**\n * The decode of the frontmatter into the fields the rules read, as the\n * engine's non-strict yaml.v3 decode does it: an undeclared key is ignored, a\n * declared one of the wrong shape fails the whole decode. null when it fails.\n */\nfunction decodeSpecFields(\n frontmatter: string,\n): Omit<ExonsFrontmatterReport, 'parseError' | 'specRead' | 'hasSpec'> | null {\n let value: unknown;\n try {\n // yaml.v3's Unmarshal decodes the first document only.\n const docs = parseAllDocuments(frontmatter, { merge: true });\n const doc = Array.isArray(docs) ? docs[0] : undefined;\n if (doc === undefined) {\n value = null;\n } else {\n if (doc.errors.length > 0) return null;\n retagScalars(doc.contents);\n value = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n }\n } catch {\n return null;\n }\n try {\n const root = goStruct(value) ?? {};\n const execution = goStruct(root.execution);\n const tools = goStruct(root.tools);\n const requirements = goStruct(root.requirements);\n const allow = tools === null ? null : goStringList(tools.allow);\n let resources: ExonsResource[] = [];\n if (requirements !== null) {\n const raw = requirements.resources;\n if (raw !== null && raw !== undefined) {\n if (!isArray(raw)) throw new DecodeError('not a list');\n // A null entry is dropped, as in goStringList.\n resources = raw\n .filter((entry) => entry !== null)\n .map((entry) => {\n const r = goStruct(entry) ?? {};\n return { ref: goString(r.ref), kind: goString(r.kind), scope: goString(r.scope) };\n });\n }\n }\n return {\n provider: execution === null ? '' : goString(execution.provider),\n toolsAllowDeclared: allow !== null,\n toolsAllow: allow ?? [],\n resources,\n };\n } catch (e) {\n if (e instanceof DecodeError) return null;\n throw e;\n }\n}\n\n/** Read one `.exons` document's frontmatter the way the engine would. */\nexport function inspectExonsFrontmatter(source: string): ExonsFrontmatterReport {\n const fm = extractExonsFrontmatter(source);\n if (fm.parseError !== null) return { ...UNREAD, parseError: fm.parseError };\n // No spec: the engine's parse yields a nil spec.\n if (!fm.hasFrontmatter || fm.frontmatter === '') return { ...UNREAD, specRead: true };\n if (fm.frontmatter.includes(EXONS_OPEN_DELIM)) return { ...UNREAD };\n const fields = decodeSpecFields(fm.frontmatter);\n if (fields === null) return { ...UNREAD };\n return { parseError: null, specRead: true, hasSpec: true, ...fields };\n}\n\n/**\n * Refusals, in the reference's order: the document does not parse (here: only\n * an unclosed frontmatter or the retired config block); no frontmatter spec,\n * which the reference reports as a parse failure; no `execution.provider`; any\n * `requirements.resources` entry (AIgentFlow can honour no declared resource\n * today, so every one is refused rather than run without the narrowing it asks\n * for). Then the `orchestrator_tool_withheld` warning. The document's presence\n * is `orchestrator_exons_required`, judged in orchestratorCampaign.ts.\n */\nexport function validateOrchestratorExons(flow: Flow, issues: Issues): void {\n const orch: unknown = flow.orchestrator;\n if (!isRecord(orch)) return;\n const source = issues.stringOf(orch, 'exons', 'orchestrator');\n if (source === null || source === '') return;\n const field = 'orchestrator.exons';\n const report = inspectExonsFrontmatter(source);\n\n if (report.parseError !== null) {\n issues.error({\n field,\n code: CODE_PARSE_FAILED,\n message: `orchestrator: failed to parse exons spec: ${report.parseError}`,\n });\n return;\n }\n if (!report.specRead) return;\n if (!report.hasSpec) {\n issues.error({\n field,\n code: CODE_PARSE_FAILED,\n message: 'orchestrator: failed to parse exons spec: the document has no frontmatter spec',\n suggestion: 'Start the document with a --- frontmatter block that sets execution.provider',\n });\n return;\n }\n if (report.provider === '') {\n issues.error({\n field,\n code: CODE_NO_PROVIDER,\n message: 'orchestrator: exons spec must have execution.provider set',\n });\n }\n if (report.resources.length > 0) {\n const refs = report.resources.map((r) => `${JSON.stringify(r.ref)} (kind ${r.kind})`);\n issues.error({\n field,\n code: CODE_RESOURCES,\n message:\n \"the orchestrator's exons spec declares requirements.resources that AIgentFlow cannot \" +\n 'honour, so it is refused rather than run without the narrowing it asks for: ' +\n refs.join('; '),\n suggestion:\n 'Remove requirements.resources, and narrow the agent with tools.mcp_servers and tools.allow',\n });\n }\n warnOrchestratorToolWithheld(flow, orch, report, issues);\n}\n\n/**\n * An orchestrator tool is offered only if it passes BOTH `orchestrator.tools`\n * (empty = every tool) AND the definition's `tools.allow` (absent = no\n * narrowing). Two lists that each read as complete can disagree, and the\n * disagreement is silent at run time. Reported: a tool named in\n * `orchestrator.tools` that `tools.allow` omits; with `orchestrator.tools`\n * empty, a `tools.allow` without `aif_ask_human` (human intervention off), and\n * one that names no campaign tool when the flow declares a campaign.\n *\n * A WARNING, never an error: an unattended orchestrator is a legitimate design.\n */\nfunction warnOrchestratorToolWithheld(\n flow: Flow,\n orch: Record<string, unknown>,\n report: ExonsFrontmatterReport,\n issues: Issues,\n): void {\n if (!report.toolsAllowDeclared) return;\n const cfg = ORCHESTRATOR_TOOL_ALLOW;\n const exempt = new Set<string>(cfg.lifecycleTools);\n // Only a YAML boolean sets it; absent (or anything else) is the default, on.\n const signals =\n typeof orch.enable_signals === 'boolean' ? orch.enable_signals : cfg.enableSignalsDefault;\n if (signals) for (const t of cfg.signalTools) exempt.add(t);\n const allow = new Set(report.toolsAllow);\n const withheld = (name: string): boolean => !allow.has(name) && !exempt.has(name);\n const warn = (message: string): void =>\n issues.warn({ field: cfg.warningField, code: CODE_TOOL_WITHHELD, message });\n\n const named: string[] = [];\n if (isArray(orch.tools)) {\n orch.tools.forEach((raw: unknown, i: number) => {\n const name = issues.stringAt(raw, `orchestrator.tools[${i}]`);\n if (name !== null) named.push(name);\n });\n }\n if (named.length > 0) {\n for (const name of named) {\n if (!withheld(name)) continue;\n warn(\n `orchestrator tool '${name}' is named in orchestrator.tools but the orchestrator's exons ` +\n \"definition's tools.allow does not name it, so it is never offered: a tool must pass \" +\n `both lists. Add '${name}' to tools.allow, or remove it from orchestrator.tools.`,\n );\n }\n return;\n }\n if (withheld(cfg.askHumanTool)) {\n warn(\n `the orchestrator's exons definition has a tools.allow list that does not name ` +\n `${cfg.askHumanTool}, so this orchestrator can never ask a person a question: human ` +\n `intervention is off. Add ${cfg.askHumanTool} to tools.allow if a human should be ` +\n 'reachable, or ignore this if the orchestrator is meant to run unattended.',\n );\n }\n // A null `campaign:` is no campaign.\n if (isRecord(flow.campaign) && !cfg.campaignTools.some((name) => !withheld(name))) {\n warn(\n \"this flow declares a campaign, but the orchestrator's exons definition has a tools.allow \" +\n `list that names none of the campaign tools (${cfg.campaignTools.join(', ')}), so no ` +\n 'child mission can be spawned or tracked. Add the campaign tools the orchestrator needs ' +\n 'to tools.allow.',\n );\n }\n}\n","// Executor URI checks.\n//\n// Until AIgentFlow v2.598.0 the Go static validator did not parse executor URLs\n// at all — the live registry decided at dispatch — so this validator carried a\n// deliberately loose \"is it `scheme://path`\" check. DC-FORGE-30 changed that:\n// `FlowParser.ValidateFlow` now applies the ONE parser (`ParseExecutorURLString`,\n// i.e. `URL_PATTERN_REGEX`) to every step executor, and DC-FORGE-38 extended it\n// to `loop.steps[i].executor`. A URL this file accepted and AIgentFlow refuses\n// at save is a false PASS — the worst direction for an offline validator — so\n// the shape check is now that same regex, mirrored verbatim.\n//\n// Classification is unchanged:\n// - unparsable URL → error (`invalid_executor_url`): AIgentFlow refuses it too;\n// - unknown scheme → warning (`unknown_executor_scheme`): the vendored list lags\n// the registry, and the Go side never rejects on scheme. See PARITY.md #1.\n//\n// TEMPLATED URLs ARE SKIPPED, exactly as the Go rule skips them. The engine\n// renders `step.executor` as a Go template before dispatch, so\n// `flow://stored/{{ .query.child_flow_id }}` is legitimate and cannot be checked\n// statically. Omitting this exception rejected eight working bundled flows when\n// the Go rule was first written.\n\nimport type { Flow, LoopSubStep, StepDefinition } from '../types.js';\nimport {\n ATLAS_EXECUTOR,\n EXECUTOR_SCHEMES,\n EXECUTOR_URL_PATTERN,\n FUNCTION_OPERATIONS,\n REMOVED_AGENT_SURFACES,\n TEMPLATE_ACTION_OPEN,\n} from '../spec/index.js';\nimport { goTrimSpace } from './exons.js';\nimport { Issues, isRecord } from './util.js';\n\nconst SCHEME_SEPARATOR = '://';\n\nconst UNKNOWN_SCHEME_BASE = (scheme: string): string =>\n `Unknown executor scheme '${scheme}'. It may be valid in a newer AIgentFlow release, or it could be a typo.`;\nconst DECIDE_SCHEME = 'decide';\nconst DECIDE_HINT =\n 'Decision models run through ai://{provider}/decide (for example ai://openai/decide), not through a scheme of their own.';\nconst MAX_SCHEME_EDIT_DISTANCE = 2;\n\n/** Levenshtein distance over UTF-16 code units (schemes are ASCII). */\nfunction editDistance(a: string, b: string): number {\n let prev = Array.from({ length: b.length + 1 }, (_, j) => j);\n for (let i = 1; i <= a.length; i++) {\n const cur = [i];\n for (let j = 1; j <= b.length; j++) {\n cur[j] = Math.min(\n prev[j]! + 1,\n cur[j - 1]! + 1,\n prev[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1),\n );\n }\n prev = cur;\n }\n return prev[b.length]!;\n}\n\n/**\n * The warning text: the base sentence, then for `decide` the pointer to\n * ai://<p>/decide, else a nearest known scheme within edit distance 2\n * (case-insensitive; the closest wins, ties to the alphabetically first).\n */\nfunction unknownSchemeMessage(scheme: string): string {\n const lower = scheme.toLowerCase();\n const base = UNKNOWN_SCHEME_BASE(scheme);\n if (lower === DECIDE_SCHEME) return `${base} ${DECIDE_HINT}`;\n let best: string | undefined;\n let bestDist = MAX_SCHEME_EDIT_DISTANCE + 1;\n for (const known of [...EXECUTOR_SCHEMES].sort()) {\n const d = editDistance(lower, known);\n if (d < bestDist) {\n best = known;\n bestDist = d;\n }\n }\n return best === undefined ? base : `${base} Did you mean '${best}'?`;\n}\n\nfunction checkExecutor(executor: string, field: string, stepID: string, issues: Issues): void {\n const sepIdx = executor.indexOf(SCHEME_SEPARATOR);\n const scheme = sepIdx > 0 ? executor.slice(0, sepIdx) : '';\n\n // A templated URL is rendered by the engine before dispatch, so its shape\n // cannot be judged here. The scheme is still checked when the scheme itself\n // carries no template, because that half is knowable.\n const templated = executor.includes(TEMPLATE_ACTION_OPEN);\n\n if (!templated && !EXECUTOR_URL_PATTERN.test(executor)) {\n issues.error({\n field,\n message: `Executor '${executor}' is not a usable executor URL`,\n code: 'invalid_executor_url',\n stepId: stepID,\n suggestion:\n \"Use the form 'scheme://authority/path' with a non-empty authority (e.g., 'ai://openai/chat'). \" +\n 'Authority and path accept letters, digits, underscore and hyphen only.',\n });\n return;\n }\n\n if (scheme === '' || scheme.includes(TEMPLATE_ACTION_OPEN)) return;\n\n if (!EXECUTOR_SCHEMES.has(scheme.toLowerCase())) {\n issues.warn({\n field,\n message: unknownSchemeMessage(scheme),\n code: 'unknown_executor_scheme',\n stepId: stepID,\n });\n return;\n }\n\n checkFunctionOperation(executor, field, stepID, templated, issues);\n}\n\n// The agent surfaces AIgentFlow removed. The scheme is the text before `://`\n// after trimming whitespace, lower-cased; a templated executor is not judged\n// (nothing can be said about what it renders to).\nfunction removedExecutorScheme(executor: string): string {\n if (executor.includes(TEMPLATE_ACTION_OPEN)) return '';\n const trimmed = goTrimSpace(executor);\n const at = trimmed.indexOf(SCHEME_SEPARATOR);\n return at < 0 ? '' : trimmed.slice(0, at).toLowerCase();\n}\n\n/**\n * Judges one step's executor against the removed surfaces and reports whether\n * the step is on a removed scheme. Such a step yields ONLY `executor_removed`,\n * so the caller skips the scheme-specific rules (URL shape, unknown scheme).\n * An `ai://` step whose query carries any removed parameter gets ONE finding\n * naming them all (presence alone counts: null and false included).\n */\nfunction checkRemovedSurfaces(\n executor: string,\n query: unknown,\n field: string,\n stepID: string,\n issues: Issues,\n): boolean {\n const cfg = REMOVED_AGENT_SURFACES;\n const quoted = JSON.stringify(stepID);\n const scheme = removedExecutorScheme(executor);\n if (cfg.schemes.has(scheme)) {\n issues.error({\n field,\n message: fillRemovedMessage(cfg.schemeMessageFormat, quoted, scheme),\n code: cfg.executorRemovedCode,\n stepId: stepID,\n suggestion: cfg.suggestion,\n });\n return true;\n }\n if (scheme !== cfg.paramScheme || !isRecord(query)) return false;\n const found = Object.keys(query)\n .filter((key) => cfg.aiParams.has(key))\n .sort();\n if (found.length > 0) {\n issues.error({\n field,\n message: fillRemovedMessage(cfg.paramsMessageFormat, quoted, found.join(', ')),\n code: cfg.agenticParamRemovedCode,\n stepId: stepID,\n suggestion: cfg.suggestion,\n });\n }\n return false;\n}\n\n/** Fills the spec's `%q` / `%s` placeholders in order. */\nfunction fillRemovedMessage(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%[qs]/g, () => args[i++] ?? '');\n}\n\n/** The flow-level keys that belonged to a removed surface (field = the key). */\nexport function validateRemovedFlowKeys(flow: Flow, issues: Issues): void {\n const cfg = REMOVED_AGENT_SURFACES;\n for (const key of cfg.flowKeys) {\n if (Object.prototype.hasOwnProperty.call(flow, key)) {\n issues.error({\n field: key,\n message: fillRemovedMessage(cfg.flowKeyMessageFormat, JSON.stringify(key)),\n code: cfg.executorRemovedCode,\n suggestion: cfg.suggestion,\n });\n }\n }\n}\n\n// `atlas://` rules. Runs only for an untemplated `atlas://` URL (the scheme match\n// is exact and case-sensitive). The URL says which Atlas operation the step\n// performs; the query is checked against what that operation needs. `stepField`\n// is the step itself, as the findings are about the step as a whole.\n//\n// The URL is split at the first slash after `atlas://` rather than through the\n// shared executor-URL shape, so a reference the shape refuses (a dot or colon in\n// a capability reference) is still judged by the atlas rules; the shape's own\n// `invalid_executor_url` finding is reported separately, as before.\nfunction checkAtlasStep(\n executor: string,\n query: unknown,\n stepField: string,\n stepID: string,\n issues: Issues,\n): void {\n if (executor.includes(TEMPLATE_ACTION_OPEN)) return;\n const prefix = `${ATLAS_EXECUTOR.scheme}://`;\n if (!executor.startsWith(prefix)) return;\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n const provider = slash < 0 ? rest : rest.slice(0, slash);\n const resource = slash < 0 ? '' : rest.slice(slash + 1);\n const quoted = JSON.stringify(stepID);\n const report = (\n rule: { code: string; messageFormat: string; suggestion: string },\n ...args: string[]\n ): void => {\n let message = rule.messageFormat.replace('%s', () => quoted);\n for (const a of args) message = message.replace('%s', () => a);\n issues.error({\n field: stepField,\n message,\n code: rule.code,\n stepId: stepID,\n suggestion: rule.suggestion,\n });\n };\n const q: Record<string, unknown> = isRecord(query) ? query : {};\n let refusedKeys: readonly string[] = ATLAS_EXECUTOR.paramRefused.capabilityKeys;\n\n if (provider === ATLAS_EXECUTOR.providerCapability) {\n if (!ATLAS_EXECUTOR.capabilityRefPattern.test(resource)) {\n report(ATLAS_EXECUTOR.capabilityRefInvalid, resource);\n }\n } else if (\n provider === ATLAS_EXECUTOR.providerAgent &&\n resource === ATLAS_EXECUTOR.agentResource\n ) {\n refusedKeys = ATLAS_EXECUTOR.paramRefused.agentKeys;\n const agent = q.agent;\n if (typeof agent !== 'string' || agent.trim() === '') {\n report(ATLAS_EXECUTOR.agentMissing);\n } else if (agent.includes(TEMPLATE_ACTION_OPEN)) {\n report(ATLAS_EXECUTOR.agentNotLiteral);\n }\n const hasPrompt = atlasTextPresent(q.prompt);\n const hasTemplate = atlasTextPresent(q.prompt_template);\n if (!hasPrompt && !hasTemplate) report(ATLAS_EXECUTOR.promptMissing);\n else if (hasPrompt && hasTemplate) report(ATLAS_EXECUTOR.promptBoth);\n if (anyTemplate(q.model)) report(ATLAS_EXECUTOR.modelNotLiteral);\n } else {\n report(ATLAS_EXECUTOR.operationUnknown, executor);\n return;\n }\n\n // A templated capability entry is refused wherever the list appears on an\n // atlas:// step, nested values included.\n if (anyTemplate(q.capabilities)) report(ATLAS_EXECUTOR.capabilitiesNotLiteral);\n\n // One finding per step, listing every key the platform owns that it carries.\n const refused = refusedKeys.filter((key) => Object.prototype.hasOwnProperty.call(q, key)).sort();\n if (refused.length > 0) report(ATLAS_EXECUTOR.paramRefused, refused.join(', '));\n}\n\n/** True when a string, or any string nested in a list or mapping, holds a template action. */\nfunction anyTemplate(v: unknown): boolean {\n if (typeof v === 'string') return v.includes(TEMPLATE_ACTION_OPEN);\n if (Array.isArray(v)) return v.some(anyTemplate);\n if (isRecord(v)) return Object.values(v).some(anyTemplate);\n return false;\n}\n\n/** A value that is set: not absent, null, or a string that is empty after trimming. */\nfunction atlasTextPresent(v: unknown): boolean {\n if (v === undefined || v === null) return false;\n return typeof v !== 'string' || v.trim() !== '';\n}\n\n// `unknown_function_operation`: port of `validateFunctionOperationKnown`. Runs\n// only for an untemplated, parsable `function://` URL; the scheme match is exact,\n// as the reference's parsed type comparison is.\nfunction checkFunctionOperation(\n executor: string,\n field: string,\n stepID: string,\n templated: boolean,\n issues: Issues,\n): void {\n if (templated) return;\n const m = EXECUTOR_URL_PATTERN.exec(executor);\n if (m === null || m[1] !== FUNCTION_OPERATIONS.scheme) return;\n const op = `${m[2]}/${m[3]}`;\n if (FUNCTION_OPERATIONS.operations.has(op)) return;\n const list = FUNCTION_OPERATIONS.sorted.join(', ');\n issues.error({\n field,\n message: FUNCTION_OPERATIONS.messageFormat\n .replace('%s', () => JSON.stringify(stepID))\n .replace('%s', () => op)\n .replace('%s', () => list),\n code: FUNCTION_OPERATIONS.code,\n stepId: stepID,\n suggestion: FUNCTION_OPERATIONS.suggestionFormat.replace('%s', () => list),\n });\n}\n\nexport function validateExecutors(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n // A Go `string`: `executor: 42` is the URL \"42\", refused as a URL.\n const executor = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (executor !== null && executor !== '') {\n if (!checkRemovedSurfaces(executor, step.query, `steps.${stepID}`, stepID, issues)) {\n checkExecutor(executor, `steps.${stepID}.executor`, stepID, issues);\n }\n checkAtlasStep(executor, step.query, `steps.${stepID}`, stepID, issues);\n }\n\n // Loop sub-steps each carry their own executor.\n const loop = step.loop;\n if (isRecord(loop) && Array.isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n const subPath = `steps.${stepID}.loop.steps[${i}]`;\n const subID = issues.stringOf(subStep, 'id', subPath) ?? String(i);\n const subExecutor = issues.stringOf(subStep, 'executor', subPath);\n if (subExecutor !== null && subExecutor !== '') {\n if (\n !checkRemovedSurfaces(subExecutor, subStep.query, subPath, `${stepID}.${subID}`, issues)\n ) {\n checkExecutor(\n subExecutor,\n `steps.${stepID}.loop.steps[${i}].executor`,\n `${stepID}.${subID}`,\n issues,\n );\n }\n checkAtlasStep(subExecutor, subStep.query, subPath, `${stepID}.${subID}`, issues);\n }\n });\n }\n }\n}\n","// Flow-level `query:` input-parameter schema validation.\n//\n// Mirrors `validateQueryParameters` / `validateProperties` / `validateArrayItems`\n// / `validateArrayConstraints` (parser.go). Note: matching the Go reference,\n// the *top-level* param type is only required to be non-empty — it is NOT\n// constrained to the known data-type set (an unknown top-level type is a\n// warning here). Array *item* types ARE constrained, as in Go.\n\nimport type { Flow, PropertyDefinition } from '../types.js';\nimport { DATA_TYPES } from '../spec/index.js';\nimport { Issues, isInteger, isRecord } from './util.js';\n\nconst TYPE_OBJECT = 'object';\nconst TYPE_ARRAY = 'array';\n\n// Every `type` is a Go `string`, so `type: 1` is the type \"1\" — unknown, not\n// missing. Source spellings are keyed by DOCUMENT path, which the finding paths\n// below do not follow (they omit the `properties` segment and write `[item]`),\n// so each function also takes `src`, the document path of the definition that\n// owns the `items:` / `properties:` it reads.\n\nfunction validateArrayItems(items: unknown, path: string, src: string, issues: Issues): void {\n if (items === undefined || items === null || !isRecord(items)) {\n issues.error({\n field: path,\n message: `Array '${path}' must define an 'items' schema`,\n code: 'array_items_missing',\n });\n return;\n }\n const def = items as PropertyDefinition;\n const srcItems = `${src}.items`;\n const type = issues.stringOf(def, 'type', srcItems);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.items.type`,\n message: `Array items for '${path}' must define a 'type'`,\n code: 'array_items_type_invalid',\n });\n return;\n }\n if (!DATA_TYPES.has(type)) {\n issues.error({\n field: `${path}.items.type`,\n message: `Array items for '${path}' have invalid type '${type}'`,\n code: 'array_items_type_invalid',\n suggestion: `Use one of: ${[...DATA_TYPES].join(', ')}`,\n });\n return;\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, `${path}[item]`, srcItems, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, `${path}[item]`, srcItems, issues);\n }\n}\n\nfunction validateProperties(\n properties: unknown,\n parentPath: string,\n src: string,\n issues: Issues,\n): void {\n if (properties === undefined || properties === null) return;\n if (!isRecord(properties)) {\n issues.error({\n field: `${parentPath}.properties`,\n message: `properties of '${parentPath}' must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n for (const [propName, rawDef] of Object.entries(properties)) {\n const path = `${parentPath}.${propName}`;\n if (!isRecord(rawDef)) {\n issues.error({\n field: path,\n message: `Property '${propName}' must be a mapping`,\n code: 'invalid_type',\n });\n continue;\n }\n const def = rawDef as PropertyDefinition;\n const srcDef = `${src}.properties.${propName}`;\n const type = issues.stringOf(def, 'type', srcDef);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.type`,\n message: `Property '${propName}' in '${parentPath}' is missing a 'type'`,\n code: 'property_type_missing',\n });\n continue;\n }\n if (!DATA_TYPES.has(type)) {\n issues.warn({\n field: `${path}.type`,\n message: `Property '${propName}' has unrecognised type '${type}'`,\n code: 'unknown_data_type',\n });\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, path, srcDef, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, path, srcDef, issues);\n }\n }\n}\n\nfunction validateArrayConstraints(def: PropertyDefinition, path: string, issues: Issues): void {\n const min = def.min_items;\n const max = def.max_items;\n if (min !== undefined) {\n if (!isInteger(min) || min < 0) {\n issues.error({\n field: `${path}.min_items`,\n message: `min_items for '${path}' must be a non-negative integer`,\n code: 'array_min_items_invalid',\n });\n }\n }\n if (isInteger(min) && isInteger(max) && max < min) {\n issues.error({\n field: `${path}.max_items`,\n message: `max_items (${max}) for '${path}' must be >= min_items (${min})`,\n code: 'array_max_items_invalid',\n });\n }\n}\n\nexport function validateQuerySchema(flow: Flow, issues: Issues): void {\n const query = flow.query;\n if (query === undefined || query === null) return;\n if (!isRecord(query)) {\n issues.error({\n field: 'query',\n message: 'query must be a mapping of parameter name to definition',\n code: 'invalid_type',\n });\n return;\n }\n\n for (const [paramName, rawDef] of Object.entries(query)) {\n const path = `query.${paramName}`;\n if (!isRecord(rawDef)) {\n issues.error({\n field: path,\n message: `Query parameter '${paramName}' must be a mapping`,\n code: 'invalid_type',\n });\n continue;\n }\n const def = rawDef as PropertyDefinition;\n const type = issues.stringOf(def, 'type', path);\n if (type === null || type === '') {\n issues.error({\n field: `${path}.type`,\n message: `Query parameter '${paramName}' is missing a 'type'`,\n code: 'query_param_type_missing',\n });\n continue;\n }\n if (!DATA_TYPES.has(type)) {\n issues.warn({\n field: `${path}.type`,\n message: `Query parameter '${paramName}' has unrecognised type '${type}'`,\n code: 'unknown_data_type',\n });\n }\n if (type === TYPE_OBJECT) {\n validateProperties(def.properties, path, path, issues);\n }\n if (type === TYPE_ARRAY) {\n validateArrayItems(def.items, path, path, issues);\n validateArrayConstraints(def, path, issues);\n }\n }\n}\n","// Per-step `response_expectation` field validation.\n//\n// Union of the detailed validator (`validateSemantics` → type must be a known\n// data type) and the parser (`ValidateFlow` → array fields require `items`;\n// `required` must be a boolean or a string template). See PARITY.md.\n//\n// Plus `response_expectation_unread` (validation.go\n// `validateResponseExpectationIsRead`, AIF DC-FORGE-145): an expectation that\n// no evaluation mode will ever read.\n\nimport type { Flow, ResponseExpectationField } from '../types.js';\nimport { DATA_TYPES } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst TYPE_ARRAY = 'array';\nconst ASYNC_EXECUTOR_PREFIX = 'async://';\nconst CODE_RESPONSE_EXPECTATION_UNREAD = 'response_expectation_unread';\n\n/**\n * Go's `%q` for the identifiers a step id can hold. `JSON.stringify` produces\n * the same double-quoted, backslash-escaped form for printable ASCII; the two\n * differ only on non-ASCII and control characters, which no step id carries.\n */\nfunction goQuote(s: string): string {\n return JSON.stringify(s);\n}\n\n/**\n * The engine reads `response_expectation` ONLY when `response_evaluation` is\n * set: with no evaluation mode it returns the raw response untouched, so the\n * expectation's `required`, `type` and `fallback` are never consulted. The\n * reference found 25 such steps across 10 of its own bundled flows — among\n * them a requirement meant to fail an answer that had not searched, which\n * would have passed silently.\n *\n * `async://` is exempt: its respond route validates the posted output against\n * the expectation on its own, without any evaluation mode.\n *\n * WARNING, not error, matching the reference: it is consulted at the RUN door\n * over flows that are already stored, and the declaration is INERT — the run\n * does not die. Loop sub-steps cannot declare an expectation, so there is no\n * second step table to walk.\n */\nfunction warnIfUnread(\n stepID: string,\n step: Record<string, unknown>,\n re: Record<string, unknown>,\n issues: Issues,\n): void {\n if (Object.keys(re).length === 0) return;\n const evaluation = issues.stringOf(step, 'response_evaluation', `steps.${stepID}`);\n if (evaluation !== null && evaluation !== '') return;\n const executor = issues.stringOf(step, 'executor', `steps.${stepID}`);\n if (executor !== null && executor.startsWith(ASYNC_EXECUTOR_PREFIX)) return;\n issues.warn({\n field: `steps.${stepID}.response_expectation`,\n message: `response_expectation on step ${goQuote(stepID)} is never checked: the engine reads it only when response_evaluation is set, and this step sets none, so required, type and fallback do nothing. Add response_evaluation: \"raw-text\" to check these fields against the executor's response unchanged, or remove response_expectation.`,\n code: CODE_RESPONSE_EXPECTATION_UNREAD,\n stepId: stepID,\n });\n}\n\nexport function validateResponseExpectations(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const re = rawStep.response_expectation;\n if (re === undefined || re === null) continue;\n if (!isRecord(re)) {\n issues.error({\n field: `steps.${stepID}.response_expectation`,\n message: 'response_expectation must be a mapping',\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n\n warnIfUnread(stepID, rawStep, re, issues);\n\n for (const [fieldName, rawField] of Object.entries(re)) {\n const base = `steps.${stepID}.response_expectation.${fieldName}`;\n if (!isRecord(rawField)) {\n issues.error({\n field: base,\n message: `response_expectation field '${fieldName}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n const field = rawField as ResponseExpectationField;\n\n // A Go `string`: `type: 1` is the invalid type \"1\".\n const type = issues.stringOf(field, 'type', base);\n if (type === null || !DATA_TYPES.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Invalid data type: ${type ?? String(field.type ?? '(none)')}`,\n code: 'invalid_data_type',\n stepId: stepID,\n suggestion: `Use one of: ${[...DATA_TYPES].join(', ')}`,\n });\n } else if (type === TYPE_ARRAY && (field.items === undefined || field.items === null)) {\n issues.error({\n field: `${base}.items`,\n message: `Array field '${fieldName}' in step '${stepID}' must define 'items'`,\n code: 'response_expectation_array_items_missing',\n stepId: stepID,\n });\n }\n\n if (field.required !== undefined) {\n const t = typeof field.required;\n if (t !== 'boolean' && t !== 'string') {\n issues.error({\n field: `${base}.required`,\n message: `response_expectation.${fieldName}.required must be a boolean or a string template`,\n code: 'invalid_field_value',\n stepId: stepID,\n });\n }\n }\n }\n }\n}\n","// Flow-level and per-step `error_strategy` validation.\n//\n// Mirrors `validateErrorStrategy` (parser.go): action enum, goto target\n// existence, max_delay duration, backoff_multiplier > 0, retry_on categories —\n// plus `unreachable_error_goto` (validation.go, AIF v2.651.0 / DC-FORGE-81) and\n// `loop_substep_error_goto_ignored` (validation.go, AIF v2.652.0 / DC-FORGE-82).\n\nimport type { ErrorStrategyDefinition, Flow } from '../types.js';\nimport { ERROR_STRATEGY_ACTIONS, RETRY_ON_CATEGORIES } from '../spec/index.js';\nimport { Issues, isNumber, isRecord, isValidGoDuration } from './util.js';\n\nconst ACTION_GOTO = 'goto';\n\nfunction validateOne(\n strategy: ErrorStrategyDefinition,\n steps: Record<string, unknown>,\n field: string,\n stepID: string | undefined,\n issues: Issues,\n): void {\n // Every field below is a Go `string`: `action: 1` is the invalid action \"1\",\n // `goto_step: 2` names the step \"2\".\n const action = issues.stringOf(strategy, 'action', field);\n if (action !== null && action !== '' && !ERROR_STRATEGY_ACTIONS.has(action)) {\n issues.error({\n field: `${field}.action`,\n message: `Invalid error_strategy action '${action}'`,\n code: 'invalid_error_strategy_action',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion: `Use one of: ${[...ERROR_STRATEGY_ACTIONS].join(', ')}`,\n });\n }\n\n const gotoStep = issues.stringOf(strategy, 'goto_step', field);\n if (action === ACTION_GOTO) {\n const goto = gotoStep;\n if (goto === null || goto === '') {\n issues.error({\n field: `${field}.goto_step`,\n message: \"error_strategy action 'goto' requires a 'goto_step'\",\n code: 'goto_step_missing',\n ...(stepID ? { stepId: stepID } : {}),\n });\n } else if (!(goto in steps)) {\n issues.error({\n field: `${field}.goto_step`,\n message: `Referenced step '${goto}' in error_strategy does not exist`,\n code: 'step_not_found',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n }\n\n // A `goto_step` the action can never take. The engine switches on `action`\n // and reads `goto_step` in the `goto` branch ONLY; `retry`, `fail` and an\n // absent action all fall through to failing the mission. The check above only\n // asks whether the target EXISTS, and only once the action already is `goto` —\n // so the one combination that silently does nothing went unasked about.\n //\n // Not hypothetical: both of AIF's bundled example flows declared\n // `action: \"retry\"` beside a `goto_step:` naming an error handler, so neither\n // handler was reachable at all.\n //\n // WARNING, not error, matching the reference: it is consulted at the RUN door\n // over flows that are already stored, and the declaration is INERT rather than\n // fatal — the run does not die, it takes a different path.\n if (action !== ACTION_GOTO && gotoStep !== null && gotoStep !== '') {\n const shown = action === null || action === '' ? '(absent, defaults to fail)' : action;\n issues.warn({\n field: `${field}.goto_step`,\n message: `goto_step '${gotoStep}' on ${stepID ? `step '${stepID}'` : 'the flow-level error_strategy'} can never be taken: the engine reads goto_step only when action is \"goto\", and this action is '${shown}'`,\n code: 'unreachable_error_goto',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion:\n 'Set action: \"goto\" (retries still apply through max_retries), or remove goto_step',\n });\n }\n\n // A Go `string` field, filled from ANY scalar by its source text: `max_delay:\n // 100` is \"100\" (no unit) and refused, as is `0.0`; `0` saves.\n const maxDelay = issues.stringOf(strategy, 'max_delay', field);\n if (maxDelay !== null && maxDelay !== '' && !isValidGoDuration(maxDelay)) {\n issues.error({\n field: `${field}.max_delay`,\n message: `Invalid max_delay duration '${maxDelay}'`,\n code: 'invalid_duration',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n\n const retryDelay = issues.stringOf(strategy, 'retry_delay', field);\n if (retryDelay !== null && retryDelay !== '' && !isValidGoDuration(retryDelay)) {\n issues.warn({\n field: `${field}.retry_delay`,\n message: `retry_delay '${retryDelay}' is not a valid Go duration`,\n code: 'invalid_duration',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n\n if (strategy.backoff_multiplier !== undefined) {\n if (!isNumber(strategy.backoff_multiplier) || strategy.backoff_multiplier <= 0) {\n issues.error({\n field: `${field}.backoff_multiplier`,\n message: `backoff_multiplier must be > 0, got ${strategy.backoff_multiplier}`,\n code: 'invalid_backoff_multiplier',\n ...(stepID ? { stepId: stepID } : {}),\n });\n }\n }\n\n if (Array.isArray(strategy.retry_on)) {\n strategy.retry_on.forEach((raw: unknown, i: number) => {\n const cat = issues.stringAt(raw, `${field}.retry_on[${i}]`);\n if (cat === null || !RETRY_ON_CATEGORIES.has(cat)) {\n issues.error({\n field: `${field}.retry_on[${i}]`,\n message: `Invalid retry_on category '${cat ?? String(raw)}'`,\n code: 'invalid_retry_on_category',\n ...(stepID ? { stepId: stepID } : {}),\n suggestion: `Use one of: ${[...RETRY_ON_CATEGORIES].join(', ')}`,\n });\n }\n });\n }\n}\n\nexport function validateErrorStrategies(flow: Flow, issues: Issues): void {\n const steps = isRecord(flow.steps) ? flow.steps : {};\n\n if (isRecord(flow.error_strategy)) {\n validateOne(\n flow.error_strategy as ErrorStrategyDefinition,\n steps,\n 'error_strategy',\n undefined,\n issues,\n );\n }\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n if (isRecord(step.error_strategy)) {\n validateOne(\n step.error_strategy as ErrorStrategyDefinition,\n steps,\n `steps.${stepID}.error_strategy`,\n stepID,\n issues,\n );\n }\n validateLoopBodyErrorGoto(step, stepID, issues);\n }\n}\n\n// A loop BODY is a second step table, and the walk above never entered it —\n// which is how the reference's own DC-FORGE-81 check missed this. Inside one,\n// `goto_step` is unreachable under EVERY action, so it is a different finding\n// from `unreachable_error_goto`: that one is fixed by writing `action: \"goto\"`,\n// and this one is not fixable in place at all.\n//\n// `executeLoopStep`'s failure switch has exactly two arms — `continue` (skip to\n// the next sub-step) and a default that aborts the whole loop step — so `goto`\n// lands in the default and the loop FAILS. The strategy the author chose to\n// avoid failing is the one that fails.\n//\n// Deliberately NOT routed through validateOne: the reference's parser does not\n// run its error_strategy checks over loop sub-steps at all, and an oracle that\n// refuses shapes its door accepts is wrong in the more damaging direction.\n// Only the new warning is emitted here.\nfunction validateLoopBodyErrorGoto(\n step: Record<string, unknown>,\n stepID: string,\n issues: Issues,\n): void {\n if (!isRecord(step.loop)) return;\n const subSteps = (step.loop as Record<string, unknown>).steps;\n if (!Array.isArray(subSteps)) return;\n\n subSteps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const strategy = sub.error_strategy;\n if (!isRecord(strategy)) return;\n const subPath = `steps.${stepID}.loop.steps[${i}]`;\n const goto = issues.stringOf(strategy, 'goto_step', `${subPath}.error_strategy`);\n if (goto === null || goto === '') return;\n\n const id = issues.stringOf(sub, 'id', subPath);\n const subID = id !== null && id !== '' ? id : `[${i}]`;\n issues.warn({\n field: `steps.${stepID}.loop.steps.${subID}.error_strategy.goto_step`,\n message: `goto_step '${goto}' on loop step '${stepID}'s sub-step '${subID}' error_strategy is never read: a loop body honours only action \"continue\" (skip to the next sub-step) and fail. Any other action, including \"goto\", aborts the whole loop step — which then routes through the LOOP step's own error_strategy.`,\n code: 'loop_substep_error_goto_ignored',\n stepId: stepID,\n suggestion: `Put the goto_step on the loop step '${stepID}' itself, or use action: \"continue\" here`,\n });\n });\n}\n","// Step connectivity: `next` reference existence (errors), unreachable steps\n// (warnings), and cycle detection (warning).\n//\n// Mirrors `validateStepConnectivity` + `checkForCycles` + `findReachableSteps`\n// (validation.go) and the save door's `validateNextLogic` (parser.go). See the\n// two marker sets below: `end` is a terminal marker for the walks only.\n//\n// ⚠ REACHABILITY AND CYCLES FOLLOW DIFFERENT EDGE SETS, and that is faithful,\n// not an oversight. AIgentFlow v2.598.0 (DC-FORGE-30) widened `findReachableSteps`\n// to the five edge kinds `collectNextTargets` yields — `next.default`,\n// `next.conditions[].goto`, `next.parallel.steps[]`, `next.parallel.rendezvous`\n// and the step-level `error_strategy.goto_step` — plus the FLOW-level\n// `error_strategy.goto_step` seeded into the queue. It did NOT touch\n// `checkForCycles`, which still walks `next.default` + `next.conditions[].goto`\n// only. Widening the cycle walk too would invent a divergence: a rendezvous or an\n// error redirect back to an earlier step is an ordinary shape and would start\n// emitting a spurious `potential_infinite_loop`.\n//\n// The narrow walk was a real defect on the authoring surface: AIgentFlow's Studio\n// renders `unreachable_step` with a jump-to-line, and it was telling authors that\n// three working steps of a bundled flow were dead code.\n\nimport type { Flow, NextCondition, NextLogicDefinition } from '../types.js';\nimport { NEXT_MARKERS, REACHABILITY_TERMINAL_MARKERS } from '../spec/index.js';\nimport { Issues, isRecord, stepNames } from './util.js';\n\n// TWO sets, because the reference gives two answers and both are verdicts.\n//\n// Existence (an ERROR) follows the save door, `validateNextLogic` (parser.go):\n// only `null` and `orchestrator` stand without a step of that name, so\n// `default: end` is refused when no step is called `end`.\n//\n// Reachability and cycles (WARNINGS) follow `findReachableSteps` /\n// `checkForCycles` (validation.go), which still skip `end` as \"control leaves\n// the graph\" — so a real step named `end` that only `end` routes to is reported\n// unreachable, by the reference too.\nfunction isSaveDoorMarker(target: string): boolean {\n return NEXT_MARKERS.has(target);\n}\n\nfunction isMarker(target: string): boolean {\n return REACHABILITY_TERMINAL_MARKERS.has(target);\n}\n\n/**\n * Edges the CYCLE detector follows — deliberately only two. See the header.\n * `nextPath` is the step's `steps.<id>.next`. Every reference is a Go `string`,\n * so `default: 2` is the step \"2\" (read through `issues.stringAt`).\n */\nfunction cycleTargets(next: NextLogicDefinition, nextPath: string, issues: Issues): string[] {\n const out: string[] = [];\n const target = issues.stringOf(next, 'default', nextPath);\n if (target !== null && target !== '' && !isMarker(target)) out.push(target);\n if (Array.isArray(next.conditions)) {\n (next.conditions as NextCondition[]).forEach((cond, i) => {\n if (!isRecord(cond)) return;\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '' && !isMarker(goto)) out.push(goto);\n });\n }\n return out;\n}\n\n/**\n * Edges REACHABILITY follows — all five kinds `collectNextTargets` yields\n * (aigentflow.flow.simulator.go). Under-reporting here is wrong in the silent\n * direction: it turns a missing edge into a confident accusation.\n */\nfunction reachTargets(step: Record<string, unknown>, stepID: string, issues: Issues): string[] {\n const out: string[] = [];\n const push = (target: string | null): void => {\n if (target !== null && target !== '' && !isMarker(target)) out.push(target);\n };\n\n if (isRecord(step.next)) {\n const next = step.next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n out.push(...cycleTargets(next, nextPath, issues));\n\n const parallel = (next as { parallel?: unknown }).parallel;\n if (isRecord(parallel)) {\n const parallelPath = `${nextPath}.parallel`;\n if (Array.isArray(parallel.steps)) {\n parallel.steps.forEach((id: unknown, i: number) =>\n push(issues.stringAt(id, `${parallelPath}.steps[${i}]`)),\n );\n }\n push(issues.stringOf(parallel, 'rendezvous', parallelPath));\n }\n }\n\n // The step-level error redirect is an edge like any other.\n const errorStrategy = step.error_strategy;\n if (isRecord(errorStrategy)) {\n push(issues.stringOf(errorStrategy, 'goto_step', `steps.${stepID}.error_strategy`));\n }\n\n return out;\n}\n\nexport function validateConnectivity(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const names = stepNames(steps);\n const available = new Set(names);\n\n // Reference existence.\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n const next = step.next;\n if (!isRecord(next)) continue;\n const n = next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n\n const target = issues.stringOf(n, 'default', nextPath);\n if (target !== null && target !== '' && !isSaveDoorMarker(target) && !available.has(target)) {\n issues.error({\n field: `steps.${stepID}.next.default`,\n message: `Referenced step '${target}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change to one of: ${names.join(', ')}`,\n });\n }\n\n if (Array.isArray(n.conditions)) {\n n.conditions.forEach((cond: unknown, i: number) => {\n if (!isRecord(cond)) return;\n\n // `goto_step` is the spelling used by error_strategy and quality_gate,\n // and it is WRONG here — a condition's target key is `goto`. AIgentFlow's\n // create/update/validate path parses with KnownFields(true) and refuses\n // the flow outright (\"contains unknown keys that would be silently\n // dropped\"), verified against the Go parser, so this is an error and not\n // a warning. Reported explicitly because the failure is otherwise silent:\n // the branch target simply vanishes.\n // Any value: the key itself is what the reference refuses.\n if ((cond as NextCondition).goto_step !== undefined) {\n issues.error({\n field: `steps.${stepID}.next.conditions[${i}].goto_step`,\n message: \"A condition's branch target key is 'goto', not 'goto_step'\",\n code: 'unknown_yaml_key',\n stepId: stepID,\n suggestion:\n \"Rename 'goto_step' to 'goto' (only error_strategy and quality_gate use 'goto_step')\",\n });\n }\n\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '' && !isSaveDoorMarker(goto) && !available.has(goto)) {\n issues.error({\n field: `steps.${stepID}.next.conditions[${i}].goto`,\n message: `Referenced step '${goto}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n context: `Available steps: ${names.join(', ')}`,\n suggestion: `Change to one of: ${names.join(', ')}`,\n });\n }\n });\n }\n }\n\n const start = issues.stringOf(flow, 'start', '') ?? '';\n if (start === '' || !available.has(start)) {\n // Without a valid start, reachability/cycle analysis is meaningless and\n // the missing-start error is already reported elsewhere.\n return;\n }\n\n // Reachability (BFS from start).\n const reachable = new Set<string>();\n const queue: string[] = [start];\n // The FLOW-level error strategy names a step that nothing else points at. It\n // belongs to the flow, not to a step, so no edge walk can reach it — AIgentFlow\n // seeds it into the queue, and missing it was the remainder found by a live\n // probe after the first pass of the fix.\n const flowErrorStrategy = flow.error_strategy;\n if (isRecord(flowErrorStrategy)) {\n const gotoStep = issues.stringOf(flowErrorStrategy, 'goto_step', 'error_strategy');\n if (gotoStep !== null && gotoStep !== '' && !isMarker(gotoStep)) queue.push(gotoStep);\n }\n while (queue.length > 0) {\n const current = queue.shift() as string;\n if (reachable.has(current)) continue;\n reachable.add(current);\n const step = steps[current];\n if (isRecord(step)) {\n for (const target of reachTargets(step, current, issues)) {\n if (!reachable.has(target)) queue.push(target);\n }\n }\n }\n for (const stepID of names) {\n if (!reachable.has(stepID)) {\n issues.warn({\n field: `steps.${stepID}`,\n message: `Step '${stepID}' is not reachable from start step`,\n code: 'unreachable_step',\n stepId: stepID,\n suggestion: 'Add a path to this step or remove it if not needed',\n });\n }\n }\n\n // Cycle detection: only a cycle with no way out is potentially infinite.\n if (cycleWithoutExit(steps, start, issues)) {\n issues.warn({\n field: 'steps',\n message: 'Potential infinite loop detected in step flow: a cycle of steps has no way out',\n code: 'potential_infinite_loop',\n suggestion:\n 'Give one step in the cycle a `next.conditions` branch that leaves it (or end the flow there)',\n });\n }\n}\n\n/**\n * Every target the cycle analysis follows from a step (`next.default` and\n * `next.conditions[].goto`), INCLUDING the terminal markers, which the exit\n * check needs to see (`cycleTargets` drops them).\n */\nfunction cycleEdges(step: unknown, stepID: string, issues: Issues): string[] {\n if (!isRecord(step) || !isRecord(step.next)) return [];\n const next = step.next as NextLogicDefinition;\n const nextPath = `steps.${stepID}.next`;\n const out: string[] = [];\n const def = issues.stringOf(next, 'default', nextPath);\n if (def !== null && def !== '') out.push(def);\n if (Array.isArray(next.conditions)) {\n (next.conditions as NextCondition[]).forEach((cond, i) => {\n if (!isRecord(cond)) return;\n const goto = issues.stringOf(cond, 'goto', `${nextPath}.conditions[${i}]`);\n if (goto !== null && goto !== '') out.push(goto);\n });\n }\n return out;\n}\n\n/**\n * Whether control can leave the strongly connected set from this step: the flow\n * can end here (no next, or no default so the flow ends when no condition\n * matches), it fans out (parallel edges are not followed, so a fan-out counts as\n * an exit rather than being guessed at), or a branch names a terminal marker or a\n * step outside the set.\n */\nfunction stepLeavesCycle(\n steps: Record<string, unknown>,\n stepID: string,\n inCycle: Set<string>,\n issues: Issues,\n): boolean {\n const step = steps[stepID];\n if (!isRecord(step) || !isRecord(step.next)) return true;\n const next = step.next as NextLogicDefinition;\n if (next.parallel !== undefined && next.parallel !== null) return true;\n const def = issues.stringOf(next, 'default', `steps.${stepID}.next`);\n if (def === null || def === '') return true;\n for (const target of cycleEdges(step, stepID, issues)) {\n if (isMarker(target) || !inCycle.has(target)) return true;\n }\n return false;\n}\n\n/**\n * Whether a cycle reachable from `start` has no exit: Tarjan's strongly\n * connected components over default + condition edges. It cannot prove an exit\n * condition ever fires; that is undecidable from the YAML.\n */\nfunction cycleWithoutExit(steps: Record<string, unknown>, start: string, issues: Issues): boolean {\n let index = 0;\n const indices = new Map<string, number>();\n const low = new Map<string, number>();\n const onStack = new Set<string>();\n const stack: string[] = [];\n let found = false;\n\n const strong = (id: string): void => {\n indices.set(id, index);\n low.set(id, index);\n index++;\n stack.push(id);\n onStack.add(id);\n\n for (const target of cycleEdges(steps[id], id, issues)) {\n if (isMarker(target) || !Object.prototype.hasOwnProperty.call(steps, target)) continue;\n if (!indices.has(target)) {\n strong(target);\n low.set(id, Math.min(low.get(id) as number, low.get(target) as number));\n } else if (onStack.has(target)) {\n low.set(id, Math.min(low.get(id) as number, indices.get(target) as number));\n }\n }\n\n if (low.get(id) !== indices.get(id)) return;\n const component: string[] = [];\n for (;;) {\n const top = stack.pop() as string;\n onStack.delete(top);\n component.push(top);\n if (top === id) break;\n }\n const inCycle = new Set(component);\n const cyclic = component.length > 1 || cycleEdges(steps[id], id, issues).includes(id);\n if (!cyclic) return;\n if (component.some((member) => stepLeavesCycle(steps, member, inCycle, issues))) return;\n found = true;\n };\n\n if (Object.prototype.hasOwnProperty.call(steps, start)) strong(start);\n return found;\n}\n","// `next.parallel` structure + the orchestrator-next rule.\n//\n// Default/condition reference checks live in connectivity.ts (they pair with\n// reachability). This module covers the parser-only additions:\n// `validateNextLogic` parallel block + `validateOrchestratorNext`.\n\nimport type { Flow, NextCondition, NextLogicDefinition, ParallelDefinition } from '../types.js';\nimport { Issues, isRecord } from './util.js';\n\nconst NEXT_NULL = 'null';\nconst NEXT_ORCHESTRATOR = 'orchestrator';\n\nexport function validateNextLogic(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const available = new Set(Object.keys(steps));\n const hasOrchestrator = isRecord(flow.orchestrator);\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n const next = step.next;\n if (!isRecord(next)) continue;\n const n = next as NextLogicDefinition;\n\n // Parallel block.\n if (isRecord(n.parallel)) {\n const par = n.parallel as ParallelDefinition;\n const base = `steps.${stepID}.next.parallel`;\n\n // Go `string` fields: `rendezvous: 9` names the step \"9\".\n const rendezvous = issues.stringOf(par, 'rendezvous', base);\n if (rendezvous === null || rendezvous === '') {\n issues.error({\n field: `${base}.rendezvous`,\n message: 'parallel block requires a rendezvous step',\n code: 'missing_required_field',\n stepId: stepID,\n });\n } else if (rendezvous !== NEXT_NULL && !available.has(rendezvous)) {\n issues.error({\n field: `${base}.rendezvous`,\n message: `Referenced rendezvous step '${rendezvous}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n });\n }\n\n if (!Array.isArray(par.steps) || par.steps.length === 0) {\n issues.error({\n field: `${base}.steps`,\n message: 'parallel block requires at least one step',\n code: 'missing_required_field',\n stepId: stepID,\n });\n } else {\n par.steps.forEach((ps: unknown, i: number) => {\n const member = issues.stringAt(ps, `${base}.steps[${i}]`);\n if (member === null || !available.has(member)) {\n issues.error({\n field: `${base}.steps[${i}]`,\n message: `Referenced parallel step '${member ?? String(ps)}' does not exist`,\n code: 'step_not_found',\n stepId: stepID,\n });\n }\n });\n }\n }\n\n // \"orchestrator\" as a next target requires an orchestrator block.\n if (!hasOrchestrator) {\n const usesOrch =\n n.default === NEXT_ORCHESTRATOR ||\n (Array.isArray(n.conditions) &&\n (n.conditions as NextCondition[]).some(\n (c) => isRecord(c) && c.goto === NEXT_ORCHESTRATOR,\n ));\n if (usesOrch) {\n issues.error({\n field: `steps.${stepID}.next`,\n message: `Step '${stepID}' routes to 'orchestrator' but the flow has no orchestrator block`,\n code: 'orchestrator_next_requires_orchestrator',\n stepId: stepID,\n });\n }\n }\n }\n}\n","// `expression_functions` validation.\n//\n// Three layers, all mirrored from the Go reference (parser.go):\n//\n// 1. `validateExpressionFunctions` — structural: each entry is a mapping with\n// exactly one key, which must be either `package` or `function`, with a\n// non-empty value. Unchanged since the block existed.\n// 2. `validateExpressionFunctionCatalog` — the catalog rules: `package:` is\n// refused outright, and a `function:` name outside the fixed catalog is\n// refused. The catalog is compiled into the AIgentFlow binary; nothing is\n// loaded at run time, ever, which is why `package:` can never work.\n// 3. `validateExpressionFunctionUsage` — a template action calling an `fn_`\n// name must name a real catalog entry AND be declared by this flow's\n// `expression_functions:` block.\n//\n// Layers 2 and 3 are refused at the SAVE door upstream; a flow stored before\n// the rules existed still RUNS. This validator answers \"would this save\", so\n// both are `error` severity — the same choice already made for the executor-URL\n// shape rule. See PARITY.md.\n\nimport type { Flow } from '../types.js';\nimport { EXPRESSION_FUNCTION_CATALOG, EXPRESSION_FUNCTION_NAME_PREFIX } from '../spec/index.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\n\nconst KEY_PACKAGE = 'package';\nconst KEY_FUNCTION = 'function';\n\n/** Sorted catalog names, for the \"Available:\" half of every refusal message. */\nconst CATALOG_LIST = [...EXPRESSION_FUNCTION_CATALOG].sort().join(', ');\n\n/**\n * One template action, `{{ … }}`. `[\\s\\S]` rather than `.` so a MULTI-LINE\n * action — which YAML block scalars produce — is matched whole, and non-greedy\n * so two actions on one line stay two actions.\n */\nconst TEMPLATE_ACTION_PATTERN = /\\{\\{[\\s\\S]*?\\}\\}/g;\n\n/**\n * A double-quoted or backquoted string inside a template action. Its contents\n * are DATA — a key name — never an identifier, so it is stripped before the call\n * scan runs: `{{ index .data \"fn_result\" }}` reads a data key, it calls nothing.\n */\nconst TEMPLATE_STRING_LITERAL_PATTERN = /\"[^\"]*\"|`[^`]*`/g;\n\n/**\n * A catalog-namespaced identifier being CALLED. Applied ONLY to the text between\n * `{{` and `}}`, so a step description that mentions `fn_slugify` in prose is not\n * read as a call — the same restriction the Go rule carries.\n *\n * ⚠️ THE LOOKBEHIND IS NOT DECORATION. A bare `\\bfn_\\w+` also matches the FIELD\n * reference `{{ .data.fn_total }}`, because `\\b` matches happily between the `.`\n * and the `f`. A flow with a state field, a step, or a data key whose name begins\n * with `fn_` would then be refused with a message about a function it never\n * called — a false refusal on a valid flow, which is worse than a missed\n * detection. A call is preceded by `{{`, `(`, `|` or whitespace: never by a dot\n * or a word character.\n *\n * The Go reference captures and discards the preceding character\n * (`(^|[^.\\w])(fn_…)`) because RE2 has no lookbehind. JS has one, and this\n * package targets Node >= 20, so the equivalent negative lookbehind is used\n * instead: it needs no capture group and cannot consume the delimiter between\n * two adjacent matches.\n */\nconst EXPRESSION_FUNCTION_CALL_PATTERN = new RegExp(\n `(?<![.\\\\w])${EXPRESSION_FUNCTION_NAME_PREFIX}[A-Za-z0-9_]+`,\n 'g',\n);\n\n/** Collect the catalog names this flow declares. */\nfunction declaredFunctions(list: unknown): Set<string> {\n const declared = new Set<string>();\n if (!isArray(list)) return declared;\n for (const entry of list) {\n if (!isRecord(entry)) continue;\n const name = entry[KEY_FUNCTION];\n if (isString(name) && name !== '') declared.add(name);\n }\n return declared;\n}\n\n/** Structural + catalog rules over the `expression_functions:` block itself. */\nfunction validateDeclarations(list: unknown, issues: Issues): void {\n if (list === undefined || list === null) return;\n if (!Array.isArray(list)) {\n issues.error({\n field: 'expression_functions',\n message: 'expression_functions must be a list',\n code: 'invalid_type',\n });\n return;\n }\n\n list.forEach((entry: unknown, i: number) => {\n const field = `expression_functions[${i}]`;\n if (!isRecord(entry)) {\n issues.error({\n field,\n message: 'Each expression_functions entry must be a mapping',\n code: 'invalid_expression_function',\n });\n return;\n }\n const keys = Object.keys(entry);\n if (keys.length !== 1) {\n issues.error({\n field,\n message: 'Each expression_functions entry must have exactly one key (package OR function)',\n code: 'invalid_expression_function',\n });\n return;\n }\n const hasPackage = KEY_PACKAGE in entry;\n const hasFunction = KEY_FUNCTION in entry;\n if (!hasPackage && !hasFunction) {\n issues.error({\n field,\n message: \"expression_functions entry must use key 'package' or 'function'\",\n code: 'invalid_expression_function',\n });\n return;\n }\n const key = hasPackage ? KEY_PACKAGE : KEY_FUNCTION;\n // A Go `string`: `function: 5` is the name \"5\", looked up (and unknown),\n // not an empty value.\n const value = issues.stringOf(entry, key, field);\n if (value === null || value === '') {\n issues.error({\n field: `${field}.${key}`,\n message: `expression_functions '${key}' must have a non-empty value`,\n code: 'invalid_expression_function',\n });\n return;\n }\n\n // `package:` is refused, not ignored. Nothing is loaded at run time, so a\n // flow could never have gotten functions this way — accepting the key in\n // silence is what kept the block inert for so long.\n if (hasPackage) {\n issues.error({\n field: `${field}.${KEY_PACKAGE}`,\n message:\n '`package:` is not supported: expression functions are compiled into AIgentFlow and ' +\n 'nothing is loaded at run time. Use `function:` naming a built-in catalog entry instead.',\n code: 'expression_function_package_unsupported',\n context: `Available: ${CATALOG_LIST}`,\n suggestion: 'Replace the entry with { function: \"fn_<name>\" } from the catalog.',\n });\n return;\n }\n\n if (!EXPRESSION_FUNCTION_CATALOG.has(value)) {\n issues.error({\n field: `${field}.${KEY_FUNCTION}`,\n message: `expression function '${value}' is not in the built-in catalog`,\n code: 'expression_function_unknown',\n context: `Available: ${CATALOG_LIST}`,\n });\n }\n });\n}\n\n/**\n * Walk every string leaf of the document, reporting its dotted path.\n *\n * The Go rule re-serialises the flow struct for the same reason this walks the\n * whole document: template strings live in a dozen unrelated places (step\n * queries, conditions, next-step expressions, output bindings, orchestrator\n * prompts, loop bounds) and a hand-kept field list goes stale the first time a\n * field is added.\n */\nfunction walkStrings(path: string, value: unknown, visit: (path: string, s: string) => void): void {\n if (isString(value)) {\n visit(path, value);\n return;\n }\n if (isArray(value)) {\n value.forEach((item, i) => walkStrings(`${path}[${i}]`, item, visit));\n return;\n }\n if (isRecord(value)) {\n for (const [key, v] of Object.entries(value)) {\n walkStrings(path === '' ? key : `${path}.${key}`, v, visit);\n }\n }\n}\n\n/**\n * Refuse a template that CALLS a catalog function this flow did not declare, or\n * an `fn_` name that is not in the catalog at all. This is what makes the\n * `expression_functions:` block load-bearing rather than decorative.\n */\nfunction validateUsage(flow: Flow, declared: Set<string>, issues: Issues): void {\n // One finding per distinct name: a flow that uses fn_slugify in thirty\n // templates has one problem, not thirty.\n const reported = new Set<string>();\n\n walkStrings('', flow as unknown, (path, text) => {\n if (!text.includes('{{')) return;\n for (const rawAction of text.match(TEMPLATE_ACTION_PATTERN) ?? []) {\n // Quoted spans go first: what they contain is a data key, not a call.\n const action = rawAction.replace(TEMPLATE_STRING_LITERAL_PATTERN, '');\n for (const called of action.match(EXPRESSION_FUNCTION_CALL_PATTERN) ?? []) {\n if (reported.has(called)) continue;\n if (!EXPRESSION_FUNCTION_CATALOG.has(called)) {\n reported.add(called);\n issues.error({\n field: path,\n message: `A template calls '${called}', which is not a built-in expression function`,\n code: 'expression_function_unknown_use',\n context: `Available: ${CATALOG_LIST}`,\n });\n continue;\n }\n if (!declared.has(called)) {\n reported.add(called);\n issues.error({\n field: path,\n message: `A template calls '${called}' but the flow does not declare it`,\n code: 'expression_function_undeclared_use',\n suggestion: `Add it: expression_functions: [{ function: \"${called}\" }]`,\n });\n }\n }\n }\n });\n}\n\nexport function validateExpressionFunctions(flow: Flow, issues: Issues): void {\n validateDeclarations(flow.expression_functions, issues);\n // The usage scan runs even when the block is absent: a flow that calls an\n // `fn_` function and declares nothing is precisely the case the rule exists\n // for.\n validateUsage(flow, declaredFunctions(flow.expression_functions), issues);\n}\n","// `loop`, `for_each`, and `throttle` structural validation.\n//\n// Mirrors `validateLoop`, `validateForEach`, and `validateThrottle`\n// (parser.go).\n\nimport type {\n ForEachDefinition,\n LoopDefinition,\n NextCondition,\n NextLogicDefinition,\n ThrottleDefinition,\n} from '../types.js';\nimport type { Flow } from '../types.js';\nimport { FOR_EACH_RESOLUTIONS, LOOP_MAX_ITERATIONS_LIMIT } from '../spec/index.js';\nimport { Issues, isInteger, isRecord, parseGoDuration } from './util.js';\n\n// Throttle ceilings (Go: FOR_EACH_MAX_THROTTLE_DELAY = 5m, FOR_EACH_MAX_BATCH_DELAY = 30m), in nanoseconds.\nconst MAX_THROTTLE_DELAY_NS = 5 * 60 * 1e9;\nconst MAX_BATCH_DELAY_NS = 30 * 60 * 1e9;\n\nconst RESERVED_STEP_ID_CHAR = '.';\n\n/**\n * The loop result's own summary fields (reference: `LoopResultSummaryFields`,\n * AIF v2.648.0 / DC-FORGE-78). The loop step's committed result carries these\n * AND one entry per sub-step under its id, so a sub-step named `vars` is\n * unreadable through `{{ .data.<loop>.vars }}` — the summary field wins.\n */\nconst LOOP_RESULT_SUMMARY_FIELDS: readonly string[] = [\n 'iterations',\n 'break',\n 'vars',\n 'duration_ms',\n];\n\n/**\n * The two top-level `next:` sentinels. Neither carries any meaning inside a\n * loop body: the reference's `resolveLoopSubStepNext` has no sentinel awareness\n * at all, so `null` cannot end a mission from there and `orchestrator` cannot\n * yield — both take the same \"no such sub-step\" miss path as a plain typo.\n *\n * `end` is deliberately NOT listed. The reference refuses only these two by\n * name and lets everything else fall through to the target-existence check, and\n * that is the honest answer here too: `end` names no sub-step of the loop, so it\n * is reported as a missing target rather than as a reserved marker. Divergence\n * #2 (\"`end` is always terminal\") is about TOP-LEVEL next targets and is not\n * extended into a loop body, where nothing reads it.\n */\nconst LOOP_SUBSTEP_NEXT_SENTINELS = new Set(['null', 'orchestrator']);\n\n/**\n * One loop sub-step's `next:` block, checked against the LOOP's own sub-step\n * table and nothing else (reference: `validateLoopSubStepNext`, parser.go,\n * AIF v2.672.0 / DC-FORGE-102, aigentflow#116).\n *\n * A loop body is a SECOND step table. `validateNextLogic` and the connectivity\n * pass walk `flow.steps` only, so before this rule existed a sub-step could\n * route to `pol` when the sub-step is called `poll` and nothing said a word:\n * the reference stored the flow and the loop driver WARNed at run time and\n * advanced sequentially — the branch the author wrote simply never happened, in\n * the one construct whose entire purpose is branching.\n *\n * Both jump directions are legal (the runtime index covers every sub-step, not\n * only the ones declared earlier), and an EMPTY target is the documented\n * \"advance sequentially\" and must stay legal — which is why this runs as a\n * second pass over the already-collected id set.\n */\nfunction validateLoopSubStepNext(\n sub: Record<string, unknown>,\n subStepIDs: Set<string>,\n base: string,\n index: number,\n stepID: string,\n issues: Issues,\n): void {\n const next = sub.next;\n if (next === undefined || next === null) return;\n const path = `${base}.steps[${index}].next`;\n const subStepID = issues.stringOf(sub, 'id', `${base}.steps[${index}]`) ?? `[${index}]`;\n if (!isRecord(next)) {\n issues.error({\n field: path,\n message: `loop sub-step '${subStepID}' next must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n return;\n }\n const n = next as NextLogicDefinition;\n\n // The loop driver reads conditions and default only, so a parallel block here\n // never fans out and its rendezvous never runs. The reference returns on this\n // one without looking at the targets; so do we.\n if (isRecord(n.parallel)) {\n issues.error({\n field: `${path}.parallel`,\n message: `loop sub-step '${subStepID}' declares next.parallel, which a loop body does not support (sub-steps run sequentially)`,\n code: 'loop_substep_next_parallel',\n stepId: stepID,\n suggestion:\n 'Use next.conditions/default to branch within the iteration, or a top-level step for parallel fan-out',\n });\n return;\n }\n\n const targets: { field: string; value: unknown }[] = [\n { field: `${path}.default`, value: n.default },\n ];\n if (Array.isArray(n.conditions)) {\n (n.conditions as NextCondition[]).forEach((condition, j) => {\n if (!isRecord(condition)) return;\n targets.push({ field: `${path}.conditions[${j}].goto`, value: condition.goto });\n });\n }\n\n for (const target of targets) {\n if (target.value === undefined || target.value === null) continue;\n // A Go `string`: `default: 4` names the sub-step \"4\". Only a mapping or a\n // list fails to decode.\n const value = issues.stringAt(target.value, target.field);\n if (value === null) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' next target must be a string`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n // Empty is the documented sequential advance.\n if (value === '') continue;\n if (LOOP_SUBSTEP_NEXT_SENTINELS.has(value)) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' routes next to the reserved marker '${value}', which has no meaning inside a loop body`,\n code: 'loop_substep_next_sentinel',\n stepId: stepID,\n suggestion:\n 'Name another sub-step of the same loop, or leave the target empty for sequential advance',\n });\n continue;\n }\n if (!subStepIDs.has(value)) {\n issues.error({\n field: target.field,\n message: `loop sub-step '${subStepID}' routes next to '${value}', which is not a sub-step of that loop`,\n code: 'loop_substep_next_target_not_found',\n stepId: stepID,\n suggestion:\n subStepIDs.size > 0\n ? `A sub-step's next: resolves only against loop.steps of the SAME loop. Available: ${[...subStepIDs].sort().join(', ')}`\n : \"A sub-step's next: resolves only against loop.steps of the SAME loop\",\n });\n }\n }\n}\n\nfunction validateThrottle(\n throttle: ThrottleDefinition,\n field: string,\n stepID: string,\n issues: Issues,\n): void {\n // Both delays are Go `string` fields, which yaml.v3 fills from ANY scalar by\n // its source text: `delay: 100` is \"100\" (no unit, refused), `delay: 0` is\n // \"0\" (saves) and `delay: 0.0` is \"0.0\" (refused). A number used to be\n // skipped here, which accepted all three.\n const delay = issues.stringOf(throttle, 'delay', field);\n if (delay !== null && delay !== '') {\n const ns = parseGoDuration(delay);\n if (ns === null) {\n issues.error({\n field: `${field}.delay`,\n message: `Invalid throttle delay '${delay}'`,\n code: 'invalid_duration',\n stepId: stepID,\n });\n } else if (ns > MAX_THROTTLE_DELAY_NS) {\n issues.error({\n field: `${field}.delay`,\n message: `throttle delay '${delay}' exceeds the 5m maximum`,\n code: 'throttle_delay_exceeds_max',\n stepId: stepID,\n });\n }\n }\n\n const batchSize = throttle.batch_size;\n const batchDelay = issues.stringOf(throttle, 'batch_delay', field);\n const hasBatchDelay = batchDelay !== null && batchDelay !== '';\n if (batchSize !== undefined && isInteger(batchSize) && batchSize < 0) {\n issues.error({\n field: `${field}.batch_size`,\n message: `throttle batch_size must be >= 0, got ${batchSize}`,\n code: 'throttle_invalid_batch_size',\n stepId: stepID,\n });\n } else if ((batchSize === undefined || batchSize === 0) && hasBatchDelay) {\n issues.error({\n field: `${field}.batch_delay`,\n message: 'throttle batch_delay requires a batch_size',\n code: 'throttle_batch_delay_without_size',\n stepId: stepID,\n });\n }\n\n if (hasBatchDelay) {\n const ns = parseGoDuration(batchDelay as string);\n if (ns === null) {\n issues.error({\n field: `${field}.batch_delay`,\n message: `Invalid throttle batch_delay '${batchDelay}'`,\n code: 'invalid_duration',\n stepId: stepID,\n });\n } else if (ns > MAX_BATCH_DELAY_NS) {\n issues.error({\n field: `${field}.batch_delay`,\n message: `throttle batch_delay '${batchDelay}' exceeds the 30m maximum`,\n code: 'throttle_batch_delay_exceeds_max',\n stepId: stepID,\n });\n }\n }\n}\n\nfunction validateForEach(step: Record<string, unknown>, stepID: string, issues: Issues): void {\n const fe = step.for_each as ForEachDefinition;\n const base = `steps.${stepID}.for_each`;\n\n // Go `string` fields: `items: 5` is present, `resolution: 1` is the invalid\n // resolution \"1\".\n if (!issues.nonEmptyStringOf(fe, 'items', base)) {\n issues.error({\n field: `${base}.items`,\n message: 'for_each requires a non-empty items expression',\n code: 'for_each_items_required',\n stepId: stepID,\n });\n }\n\n const next = step.next;\n if (isRecord(next) && isRecord(next.parallel)) {\n issues.error({\n field: base,\n message: 'A step cannot use both for_each and next.parallel',\n code: 'for_each_mutual_exclusion',\n stepId: stepID,\n });\n }\n\n if (fe.max_parallel !== undefined && isInteger(fe.max_parallel) && fe.max_parallel < 0) {\n issues.error({\n field: `${base}.max_parallel`,\n message: `for_each max_parallel must be >= 0, got ${fe.max_parallel}`,\n code: 'for_each_invalid_max_parallel',\n stepId: stepID,\n });\n }\n\n const resolution = issues.stringOf(fe, 'resolution', base);\n if (resolution !== null && resolution !== '' && !FOR_EACH_RESOLUTIONS.has(resolution)) {\n issues.error({\n field: `${base}.resolution`,\n message: `Invalid for_each resolution '${resolution}'`,\n code: 'for_each_invalid_resolution',\n stepId: stepID,\n suggestion: `Use one of: ${[...FOR_EACH_RESOLUTIONS].join(', ')}`,\n });\n }\n\n if (isRecord(fe.throttle)) {\n validateThrottle(fe.throttle as ThrottleDefinition, `${base}.throttle`, stepID, issues);\n }\n}\n\nfunction validateLoop(step: Record<string, unknown>, stepID: string, issues: Issues): void {\n const loop = step.loop as LoopDefinition;\n const base = `steps.${stepID}.loop`;\n\n if (!issues.nonEmptyStringOf(loop, 'while', base)) {\n issues.error({\n field: `${base}.while`,\n message: 'loop requires a non-empty while condition',\n code: 'loop_while_required',\n stepId: stepID,\n });\n }\n\n const maxIter = loop.max_iterations;\n if (maxIter === undefined || !isInteger(maxIter) || maxIter <= 0) {\n issues.error({\n field: `${base}.max_iterations`,\n message: 'loop requires max_iterations > 0',\n code: 'loop_max_iterations_required',\n stepId: stepID,\n });\n } else if (maxIter > LOOP_MAX_ITERATIONS_LIMIT) {\n issues.error({\n field: `${base}.max_iterations`,\n message: `loop max_iterations (${maxIter}) exceeds the limit of ${LOOP_MAX_ITERATIONS_LIMIT}`,\n code: 'loop_max_iterations_range',\n stepId: stepID,\n });\n }\n\n const subSteps = loop.steps;\n if (!Array.isArray(subSteps) || subSteps.length === 0) {\n issues.error({\n field: `${base}.steps`,\n message: 'loop requires at least one sub-step',\n code: 'loop_steps_required',\n stepId: stepID,\n });\n } else {\n const seen = new Set<string>();\n subSteps.forEach((sub: unknown, i: number) => {\n const subPath = `${base}.steps[${i}]`;\n if (!isRecord(sub)) {\n issues.error({\n field: subPath,\n message: 'loop sub-step must be a mapping',\n code: 'invalid_type',\n stepId: stepID,\n });\n return;\n }\n // A Go `string`: `id: 3` is the sub-step \"3\".\n const id = issues.stringOf(sub, 'id', subPath);\n if (id === null || id === '') {\n issues.error({\n field: `${subPath}.id`,\n message: `loop sub-step at index ${i} requires an 'id'`,\n code: 'loop_step_id_required',\n stepId: stepID,\n });\n } else {\n if (id.includes(RESERVED_STEP_ID_CHAR)) {\n issues.error({\n field: `${subPath}.id`,\n message: `loop sub-step id '${id}' must not contain '${RESERVED_STEP_ID_CHAR}'`,\n code: 'reserved_step_id_char',\n stepId: stepID,\n });\n }\n if (seen.has(id)) {\n issues.error({\n field: `${subPath}.id`,\n message: `Duplicate loop sub-step id '${id}'`,\n code: 'loop_step_id_duplicate',\n stepId: stepID,\n });\n }\n seen.add(id);\n // A WARNING in the reference, not an error: the sub-step still runs, and\n // its result stays reachable through the flat `index .data \"<loop>.<sub>\"`\n // key. The reference reports it on the `loop.steps` field and names the\n // parent step, so this does too.\n if (LOOP_RESULT_SUMMARY_FIELDS.includes(id)) {\n issues.warn({\n field: `${base}.steps`,\n message: `loop sub-step id '${id}' is also a field of the loop's own result, so {{ .data.${stepID}.${id} }} reads the loop's ${id} instead of this sub-step's output`,\n code: 'loop_sub_step_id_reserved',\n stepId: stepID,\n suggestion: `rename the sub-step; ids reserved by the loop result: ${[...LOOP_RESULT_SUMMARY_FIELDS].sort().join(', ')}`,\n });\n }\n }\n if (!issues.nonEmptyStringOf(sub, 'executor', subPath)) {\n issues.error({\n field: `${subPath}.executor`,\n message: `loop sub-step at index ${i} requires an 'executor'`,\n code: 'loop_step_executor_required',\n stepId: stepID,\n });\n }\n });\n\n // Second pass, deliberately: a FORWARD jump is legal, so the whole id set\n // has to exist before any target can be judged.\n subSteps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n validateLoopSubStepNext(sub, seen, base, i, stepID, issues);\n });\n }\n\n if (step.for_each !== undefined && step.for_each !== null) {\n issues.error({\n field: base,\n message: 'A step cannot use both loop and for_each',\n code: 'loop_mutual_exclusion_for_each',\n stepId: stepID,\n });\n }\n\n if (issues.nonEmptyStringOf(step, 'executor', `steps.${stepID}`)) {\n issues.error({\n field: `steps.${stepID}.executor`,\n message: 'A loop step must not define its own executor (it defines sub-steps)',\n code: 'loop_mutual_exclusion_executor',\n stepId: stepID,\n });\n }\n}\n\nexport function validateLoopForEachThrottle(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n if (step.for_each !== undefined && step.for_each !== null && isRecord(step.for_each)) {\n validateForEach(step, stepID, issues);\n }\n if (step.loop !== undefined && step.loop !== null && isRecord(step.loop)) {\n validateLoop(step, stepID, issues);\n }\n }\n}\n","// Orchestrator + campaign structural validation.\n//\n// Mirrors the portable parts of `validateOrchestrator` /\n// `validateAndNormalizeCampaign` (parser.go). The exons-spec body is parsed by\n// the go-exons engine in the reference and is NOT re-implemented here — its\n// presence is required, but its contents are out of scope for the static JS\n// validator. See PARITY.md.\n\nimport type {\n Flow,\n OrchestratorDefinition,\n OrchestratorTrigger,\n ValidateOptions,\n} from '../types.js';\nimport { ORCHESTRATOR_MODES, ORCHESTRATOR_TOOLS, ORCHESTRATOR_TRIGGERS } from '../spec/index.js';\nimport { Issues, isRecord, isValidGoDuration, parseGoDuration } from './util.js';\n\nconst TRIGGER_TIMER = 'timer';\nconst MODE_OWNER = 'owner';\nconst NEXT_MARKER_ORCHESTRATOR = 'orchestrator';\n\n// flowHasOrchestratorYieldEdge mirrors the Go helper: does any step route to the\n// orchestrator via next.default or a conditional goto? (DC-COND-1)\nfunction flowHasOrchestratorYieldEdge(flow: Flow): boolean {\n const steps = flow.steps;\n if (!isRecord(steps)) return false;\n for (const step of Object.values(steps)) {\n if (!isRecord(step) || !isRecord(step.next)) continue;\n const next = step.next as { default?: unknown; conditions?: unknown };\n if (next.default === NEXT_MARKER_ORCHESTRATOR) return true;\n if (Array.isArray(next.conditions)) {\n for (const cond of next.conditions) {\n if (isRecord(cond) && (cond as { goto?: unknown }).goto === NEXT_MARKER_ORCHESTRATOR) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/** 2^63: the first float yaml.v3 will not decode into an int64. */\nconst GO_INT64_FLOAT_LIMIT = 2 ** 63;\n\n// decodeGoInt returns the value yaml.v3 stores when it decodes a YAML number\n// into a Go int64 field, or null when the decode fails. A float is truncated\n// toward zero; NaN and anything at or above 2^63 fail; -Inf and very large\n// negative floats land at the bottom of the range (their exact value is\n// platform-defined in Go, but always negative, which is all a caller needs).\nfunction decodeGoInt(v: unknown): number | null {\n if (typeof v !== 'number' || Number.isNaN(v)) return null;\n if (v >= GO_INT64_FLOAT_LIMIT) return null;\n if (v === -Infinity) return -GO_INT64_FLOAT_LIMIT;\n return Math.trunc(v);\n}\n\n// validateCampaignChildFlows ports the first two checks of\n// CampaignConfig.Validate (domain.campaign.go): the campaign needs at least one\n// child flow, and each entry names a `flow_id` or a `flow_name`.\n//\n// ⚠️ yaml.v3 DROPS a null list entry when it decodes the list, so `- ` does not\n// count as an entry — a list of nothing but nulls is \"no child flows\", and a\n// null beside a real entry is simply ignored (measured: both save/refuse as\n// described). `flow_id` and `flow_name` are Go strings, so any scalar counts\n// (`flow_id: 123` saves) and a YAML null is empty. The finding's index is the\n// entry's position in the YAML list; the reference's message counts only the\n// non-null entries.\nfunction validateCampaignChildFlows(campaign: Record<string, unknown>, issues: Issues): void {\n const field = 'campaign.child_flows';\n const raw: unknown = campaign.child_flows;\n if (raw !== undefined && raw !== null && !Array.isArray(raw)) {\n issues.error({ field, message: 'campaign.child_flows must be a list', code: 'invalid_type' });\n return;\n }\n const entries = (Array.isArray(raw) ? raw : [])\n .map((entry: unknown, i: number) => ({ entry, i }))\n .filter(({ entry }) => entry !== null);\n if (entries.length === 0) {\n issues.error({\n field,\n message: 'campaign requires at least one entry in child_flows',\n code: 'campaign_no_child_flows',\n });\n return;\n }\n for (const { entry, i } of entries) {\n if (!isRecord(entry)) {\n issues.error({\n field: `${field}[${i}]`,\n message: 'each campaign.child_flows entry must be a mapping',\n code: 'invalid_type',\n });\n continue;\n }\n const id = issues.stringOf(entry, 'flow_id', `${field}[${i}]`);\n const name = issues.stringOf(entry, 'flow_name', `${field}[${i}]`);\n if ((id !== null && id !== '') || (name !== null && name !== '')) continue;\n issues.error({\n field: `${field}[${i}]`,\n message: `campaign.child_flows[${i}] needs a flow_id or a flow_name`,\n code: 'campaign_child_flow_no_id',\n suggestion: 'Name the child flow with flow_name, or pin it with flow_id',\n });\n }\n}\n\nexport function validateOrchestratorCampaign(\n flow: Flow,\n issues: Issues,\n opts: ValidateOptions,\n): void {\n const hasOrchestrator = isRecord(flow.orchestrator);\n\n if (hasOrchestrator) {\n const orch = flow.orchestrator as OrchestratorDefinition;\n\n // Every field read below is a Go `string` (issues.stringOf): `mode: 1` is\n // the invalid mode \"1\", not an absent one.\n if (!issues.nonEmptyStringOf(orch, 'exons', 'orchestrator')) {\n issues.error({\n field: 'orchestrator.exons',\n message: 'orchestrator requires an exons specification',\n code: 'orchestrator_exons_required',\n });\n }\n\n // AIF v2.695.0 (DC-FORGE-125, aigentflow#124): the per-question HITL\n // deadline. The reference REFUSES an unparseable or non-positive duration\n // (parser.go, beside the timer trigger's interval), so this oracle refuses\n // it too.\n //\n // NOTE the positivity check. `isValidGoDuration('-5m')` is true — it is a\n // well-formed Go duration — and the reference still refuses it, because a\n // deadline in the past is not a deadline. An oracle that accepted it would\n // be LOOSER than the door it predicts, which is the more damaging direction\n // for a \"would this save?\" answer.\n //\n // NOT ported, deliberately: the reference also LOGS a warning when the declared\n // timeout exceeds ORCH_MAX_MISSION_DURATION. That threshold is a server\n // constant this package cannot observe, and hard-coding 60m here would put\n // a second copy of a deployment-side number in another repository. See\n // PARITY.md divergence #12.\n //\n // Empty and null mean ABSENT, as they do in the reference: its field is a Go\n // string, a YAML null decodes to \"\", and the check runs only when the value\n // is non-empty. Refusing either would make this oracle stricter than the door.\n const declared: unknown = orch.human_question_timeout;\n if (declared !== undefined && declared !== null && declared !== '') {\n const text = issues.stringAt(declared, 'orchestrator.human_question_timeout');\n const parsed = text !== null ? parseGoDuration(text) : null;\n if (parsed === null || parsed <= 0) {\n issues.error({\n field: 'orchestrator.human_question_timeout',\n message: `human_question_timeout '${text ?? String(declared)}' is not a valid positive duration`,\n code: 'orchestrator_human_question_timeout_invalid',\n });\n }\n }\n\n // DC-COND-1: termination-authority mode. Empty defaults to monitor (valid).\n const mode = issues.stringOf(orch, 'mode', 'orchestrator');\n if (mode !== null && mode !== '' && !ORCHESTRATOR_MODES.has(mode)) {\n issues.error({\n field: 'orchestrator.mode',\n message: `Invalid orchestrator mode '${mode}'`,\n code: 'orchestrator_mode_invalid',\n suggestion: `Use one of: ${[...ORCHESTRATOR_MODES].join(', ')}`,\n });\n } else if (mode === MODE_OWNER && !flowHasOrchestratorYieldEdge(flow)) {\n // owner mode cedes lifecycle to the LLM, reachable only via an explicit\n // next: orchestrator yield edge. A self-terminating DAG under owner is refused.\n issues.error({\n field: 'orchestrator.mode',\n message:\n \"orchestrator mode 'owner' requires at least one step with next: 'orchestrator' (an explicit yield edge); a self-terminating DAG must use mode 'monitor'\",\n code: 'orchestrator_owner_needs_yield',\n });\n }\n\n // enforce_region makes the provider refuse a call that carries no region, so\n // declaring it without naming one would fail every turn closed; the reference\n // refuses it at save. `region` is a Go string (any scalar, null = empty) and\n // is judged after trimming whitespace.\n if (orch.enforce_region === true) {\n const region = issues.stringOf(orch, 'region', 'orchestrator');\n if (region === null || region.trim() === '') {\n issues.error({\n field: 'orchestrator.enforce_region',\n message:\n 'orchestrator: enforce_region requires region (name the region the model must run in, e.g. region: eu)',\n code: 'orchestrator_enforce_region_needs_region',\n suggestion:\n 'Add `region: eu` (or the region the model must run in), or drop enforce_region',\n });\n }\n }\n\n if (Array.isArray(orch.triggers)) {\n orch.triggers.forEach((rawTrigger: unknown, i: number) => {\n if (!isRecord(rawTrigger)) return;\n const trigger = rawTrigger as OrchestratorTrigger;\n const base = `orchestrator.triggers[${i}]`;\n const type = issues.stringOf(trigger, 'type', base);\n if (type === null || !ORCHESTRATOR_TRIGGERS.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Unknown orchestrator trigger type '${type ?? String(trigger.type)}'`,\n code: 'orchestrator_trigger_unknown',\n suggestion: `Use one of: ${[...ORCHESTRATOR_TRIGGERS].join(', ')}`,\n });\n return;\n }\n if (type === TRIGGER_TIMER) {\n // A Go `string` field, filled from ANY scalar by its source text:\n // `interval: 0` is \"0\" and saves, `interval: 100` is \"100\" (no unit).\n // A number used to read as \"no interval\" here.\n const interval = issues.stringOf(trigger, 'interval', base);\n if (interval === null || interval === '') {\n issues.error({\n field: `${base}.interval`,\n message: 'timer trigger requires an interval',\n code: 'orchestrator_timer_no_interval',\n });\n } else if (!isValidGoDuration(interval)) {\n issues.error({\n field: `${base}.interval`,\n message: `timer trigger interval '${interval}' is not a valid duration`,\n code: 'orchestrator_timer_bad_interval',\n });\n }\n }\n });\n }\n\n if (Array.isArray(orch.tools)) {\n orch.tools.forEach((raw: unknown, i: number) => {\n const tool = issues.stringAt(raw, `orchestrator.tools[${i}]`);\n if (tool === null || ORCHESTRATOR_TOOLS.has(tool)) return;\n const finding = {\n field: `orchestrator.tools[${i}]`,\n message: `Unrecognised orchestrator tool name '${tool}'`,\n code: 'orchestrator_tool_unknown',\n };\n if (opts.strictRegistries) {\n issues.error(finding);\n } else {\n issues.warn(finding);\n }\n });\n }\n\n if (orch.agentic === false) {\n issues.warn({\n field: 'orchestrator.agentic',\n message: 'orchestrator is most useful with agentic: true',\n code: 'orchestrator_not_agentic',\n });\n }\n }\n\n // Campaign requires an orchestrator.\n if (flow.campaign !== undefined && flow.campaign !== null) {\n if (!hasOrchestrator) {\n issues.error({\n field: 'campaign',\n message: 'campaign requires an orchestrator block',\n code: 'campaign_requires_orchestrator',\n });\n }\n const campaign = flow.campaign;\n\n // AIF v2.728.0 (DC-FORGE-155): `max_credits_per_child` is a Go int64 and\n // `CampaignConfig.Validate` refuses a negative value. 0 (and absent, and\n // null) means \"no per-child cap\".\n //\n // ⚠️ A FRACTION SAVES. yaml.v3 decodes a float into an int field by\n // truncating toward zero, so `1.5` is stored as 1 and `-0.5` as 0 (which\n // then passes the `>= 0` check). Measured against the reference's strict\n // save parser; this validator used to refuse every non-integer, which made\n // it stricter than the door it predicts. What still fails to decode: a\n // string, a boolean, NaN, +Inf, and a float at or above 2^63. `-.inf`\n // decodes to a negative int64 and is refused by the `>= 0` check.\n if (isRecord(campaign)) {\n const cap: unknown = campaign.max_credits_per_child;\n if (cap !== undefined && cap !== null) {\n const decoded = decodeGoInt(cap);\n if (decoded === null) {\n issues.error({\n field: 'campaign.max_credits_per_child',\n message: `campaign.max_credits_per_child must be a number of credits, got '${String(cap)}'`,\n code: 'invalid_type',\n });\n } else if (decoded < 0) {\n issues.error({\n field: 'campaign.max_credits_per_child',\n message: 'campaign: max_credits_per_child must be >= 0',\n code: 'campaign_invalid_max_credits_per_child',\n });\n }\n }\n validateCampaignChildFlows(campaign, issues);\n }\n\n // The rest of CampaignConfig.Validate — max_concurrent, max_depth and\n // max_total_children must each be >= 1 — is UNREACHABLE at the save door\n // and deliberately not ported: ApplyDefaults runs first and replaces every\n // value <= 0 with a positive default, so no document can reach it.\n\n // DC-COND-2: on_children_complete (if set) must reference a real step — the\n // engine routes into it deterministically once every child is terminal.\n const target = isRecord(campaign)\n ? issues.stringOf(campaign, 'on_children_complete', 'campaign')\n : null;\n if (target !== null && target !== '') {\n const steps = isRecord(flow.steps) ? flow.steps : {};\n if (!(target in steps)) {\n issues.error({\n field: 'campaign.on_children_complete',\n message: `campaign.on_children_complete references unknown step '${target}'`,\n code: 'campaign_handoff_step_unknown',\n });\n }\n }\n }\n}\n","// Step credential-binding validation.\n//\n// Mirrors `validateStepCredentialBindings` (parser.go): `credentials` and\n// `credential` are mutually exclusive; every source must be\n// `stored/{provider}/{name}` with non-empty provider and name; explicit\n// bindings require a non-empty `inject_as`. Applies to loop sub-steps too.\n\nimport type { CredentialBinding, Flow, LoopSubStep } from '../types.js';\nimport { CREDENTIAL_REFERENCE_PREFIX } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nfunction hasPrefix(source: string): boolean {\n return (\n source.length > CREDENTIAL_REFERENCE_PREFIX.length &&\n source.startsWith(CREDENTIAL_REFERENCE_PREFIX)\n );\n}\n\n// Matches Go's isValidCredentialSourceFormat: first '/' after the prefix must\n// have a non-empty provider before it and a non-empty name after it.\nfunction hasValidFormat(source: string): boolean {\n const rest = source.slice(CREDENTIAL_REFERENCE_PREFIX.length);\n const idx = rest.indexOf('/');\n return idx > 0 && idx < rest.length - 1;\n}\n\ninterface StepCreds {\n credential?: unknown;\n credentials?: unknown;\n}\n\nfunction checkBindings(creds: StepCreds, fieldBase: string, stepID: string, issues: Issues): void {\n const credentialsMap = creds.credentials;\n // Go `string` fields throughout. `fieldBase` is the owner's path plus\n // `.credential`, which is the shorthand's own document path.\n const credential = issues.stringAt(creds.credential, fieldBase);\n const hasCredentialsMap = isRecord(credentialsMap) && Object.keys(credentialsMap).length > 0;\n const hasShorthand = credential !== null && credential !== '';\n\n if (hasCredentialsMap && hasShorthand) {\n issues.error({\n field: fieldBase,\n message: `Step '${stepID}' cannot set both 'credentials' and 'credential'`,\n code: 'cred_bind_mutual_exclusive',\n stepId: stepID,\n });\n }\n\n if (isRecord(credentialsMap)) {\n for (const [bindingName, rawBinding] of Object.entries(credentialsMap)) {\n if (rawBinding === null || rawBinding === undefined) continue;\n if (!isRecord(rawBinding)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}`,\n message: `Credential binding '${bindingName}' must be a mapping`,\n code: 'invalid_type',\n stepId: stepID,\n });\n continue;\n }\n const binding = rawBinding as CredentialBinding;\n const bindingPath = `${fieldBase}s.${bindingName}`;\n const source = issues.stringOf(binding, 'source', bindingPath);\n if (source === null || !hasPrefix(source)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.source`,\n message: `Credential binding '${bindingName}' source must start with '${CREDENTIAL_REFERENCE_PREFIX}'`,\n code: 'cred_bind_invalid_source',\n stepId: stepID,\n });\n } else if (!hasValidFormat(source)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.source`,\n message: `Credential binding '${bindingName}' source must be '${CREDENTIAL_REFERENCE_PREFIX}{provider}/{name}'`,\n code: 'cred_bind_source_format',\n stepId: stepID,\n });\n }\n if (!issues.nonEmptyStringOf(binding, 'inject_as', bindingPath)) {\n issues.error({\n field: `${fieldBase}s.${bindingName}.inject_as`,\n message: `Credential binding '${bindingName}' requires a non-empty 'inject_as'`,\n code: 'cred_bind_inject_as_empty',\n stepId: stepID,\n });\n }\n }\n }\n\n if (hasShorthand) {\n const c = credential;\n if (!hasPrefix(c)) {\n issues.error({\n field: fieldBase,\n message: `Shorthand credential must start with '${CREDENTIAL_REFERENCE_PREFIX}'`,\n code: 'cred_bind_shorthand_source',\n stepId: stepID,\n });\n } else if (!hasValidFormat(c)) {\n issues.error({\n field: fieldBase,\n message: `Shorthand credential must be '${CREDENTIAL_REFERENCE_PREFIX}{provider}/{name}'`,\n code: 'cred_bind_shorthand_format',\n stepId: stepID,\n });\n }\n }\n}\n\nexport function validateCredentialBindings(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, step] of Object.entries(steps)) {\n if (!isRecord(step)) continue;\n checkBindings(step as StepCreds, `steps.${stepID}.credential`, stepID, issues);\n\n const loop = step.loop;\n if (isRecord(loop) && Array.isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n const subID =\n issues.stringOf(subStep, 'id', `steps.${stepID}.loop.steps[${i}]`) ?? String(i);\n checkBindings(\n subStep as StepCreds,\n `steps.${stepID}.loop.steps[${i}].credential`,\n `${stepID}.${subID}`,\n issues,\n );\n });\n }\n }\n}\n","// `input_schema` definition validation + the file-ordering lint.\n//\n// Mirrors `ValidateInputSchemaDefinition` + `LintInputSchemaFieldOrdering`\n// (input_schema.go). This validates the SCHEMA DEFINITION only — payload\n// validation (`ValidateInputAgainstSchema`) is runtime and out of scope.\n//\n// Note: pattern compilation uses the JS regex engine, not Go RE2; a pattern\n// valid in one engine but not the other is a known, documented divergence.\n\nimport type { Flow, InputSchema, InputSchemaField, VisibleWhenPredicate } from '../types.js';\nimport { INPUT_SCHEMA, INPUT_SCHEMA_VERSION } from '../spec/index.js';\nimport { Issues, isInteger, isNumber, isRecord } from './util.js';\n\nconst TYPE_ENUM = 'enum';\nconst TYPE_NUMBER = 'number';\nconst TYPE_ARRAY_OF_STRINGS = 'array_of_strings';\nconst TYPE_FILE = 'file';\n\nfunction fieldPath(schemaPath: string, i: number): string {\n return `${schemaPath}.fields[${i}]`;\n}\n\nfunction validateField(\n f: InputSchemaField,\n schemaPath: string,\n i: number,\n seen: Map<string, number>,\n issues: Issues,\n): void {\n const base = fieldPath(schemaPath, i);\n // `name`, `type` and `pattern` are Go `string` fields: `name: 5` is the name\n // \"5\", `type: 1` the unknown type \"1\".\n const name = issues.stringOf(f, 'name', base);\n const shownName = name ?? String(f.name);\n const pattern = issues.stringOf(f, 'pattern', base);\n\n // Name + duplicate detection.\n if (name === null || !INPUT_SCHEMA.fieldNamePattern.test(name)) {\n issues.error({\n field: base,\n message: `input_schema field name '${shownName}' is invalid (must match ${INPUT_SCHEMA.fieldNamePattern.source})`,\n code: 'input_schema_invalid_field_name',\n });\n } else if (seen.has(name)) {\n issues.error({\n field: base,\n message: `Duplicate input_schema field name '${name}' (first declared at index ${seen.get(name)})`,\n code: 'input_schema_duplicate_field_name',\n });\n } else {\n seen.set(name, i);\n }\n\n // Type — bail on per-type checks if unknown.\n const type = issues.stringOf(f, 'type', base);\n if (type === null || !INPUT_SCHEMA.types.has(type)) {\n issues.error({\n field: `${base}.type`,\n message: `Unknown input_schema field type '${type ?? String(f.type)}'`,\n code: 'input_schema_unknown_type',\n suggestion: `Use one of: ${[...INPUT_SCHEMA.types].join(', ')}`,\n });\n return;\n }\n\n // Per-type constraint sanity.\n if (type === TYPE_ENUM && (!Array.isArray(f.enum) || f.enum.length === 0)) {\n issues.error({\n field: `${base}.enum`,\n message: `enum field '${shownName}' must list at least one allowed value`,\n code: 'input_schema_enum_empty',\n });\n }\n if (isNumber(f.min) && isNumber(f.max) && f.min > f.max) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min (${f.min}) must be <= max (${f.max})`,\n code: 'input_schema_invalid_range',\n });\n }\n if (isInteger(f.min_length) && isInteger(f.max_length) && f.min_length > f.max_length) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min_length (${f.min_length}) must be <= max_length (${f.max_length})`,\n code: 'input_schema_invalid_range',\n });\n }\n if (isInteger(f.min_items) && isInteger(f.max_items) && f.min_items > f.max_items) {\n issues.error({\n field: `${base}`,\n message: `field '${shownName}': min_items (${f.min_items}) must be <= max_items (${f.max_items})`,\n code: 'input_schema_invalid_range',\n });\n }\n\n // Constraint-to-type compatibility.\n const stringy = INPUT_SCHEMA.stringTypes.has(type);\n const mismatch = (constraint: string): void =>\n issues.error({\n field: `${base}.${constraint}`,\n message: `constraint '${constraint}' is not meaningful for field '${shownName}' of type '${type}'`,\n code: 'input_schema_constraint_type_mismatch',\n });\n if (!stringy) {\n if (f.min_length !== undefined) mismatch('min_length');\n if (f.max_length !== undefined) mismatch('max_length');\n if (pattern !== null && pattern !== '') mismatch('pattern');\n }\n if (type !== TYPE_NUMBER) {\n if (f.min !== undefined) mismatch('min');\n if (f.max !== undefined) mismatch('max');\n }\n if (type !== TYPE_ARRAY_OF_STRINGS) {\n if (f.min_items !== undefined) mismatch('min_items');\n if (f.max_items !== undefined) mismatch('max_items');\n }\n if (type !== TYPE_FILE) {\n if (Array.isArray(f.accept) && f.accept.length > 0) mismatch('accept');\n if (f.max_size !== undefined) mismatch('max_size');\n }\n if (type !== TYPE_ENUM && Array.isArray(f.enum) && f.enum.length > 0) mismatch('enum');\n\n // Constraint value caps.\n const cap = (constraint: string, val: number): void =>\n issues.error({\n field: `${base}.${constraint}`,\n message: `constraint '${constraint}' (${val}) for field '${shownName}' exceeds the maximum of ${INPUT_SCHEMA.maxConstraintValue}`,\n code: 'input_schema_constraint_out_of_range',\n });\n if (isInteger(f.min_length) && f.min_length > INPUT_SCHEMA.maxConstraintValue)\n cap('min_length', f.min_length);\n if (isInteger(f.max_length) && f.max_length > INPUT_SCHEMA.maxConstraintValue)\n cap('max_length', f.max_length);\n if (isInteger(f.min_items) && f.min_items > INPUT_SCHEMA.maxConstraintValue)\n cap('min_items', f.min_items);\n if (isInteger(f.max_items) && f.max_items > INPUT_SCHEMA.maxConstraintValue)\n cap('max_items', f.max_items);\n\n // visible_when first-pass predicate shape.\n if (isRecord(f.visible_when)) {\n const vw = f.visible_when as VisibleWhenPredicate;\n const hasEquals = vw.equals !== undefined && vw.equals !== null;\n const hasIn = Array.isArray(vw.in) && vw.in.length > 0;\n if (!issues.nonEmptyStringOf(vw, 'field', `${base}.visible_when`)) {\n issues.error({\n field: `${base}.visible_when`,\n message: `field '${shownName}': visible_when requires a 'field'`,\n code: 'input_schema_visible_when_no_predicate',\n });\n } else if (hasEquals === hasIn) {\n issues.error({\n field: `${base}.visible_when`,\n message: `field '${shownName}': visible_when requires exactly one of 'equals' or 'in'`,\n code: 'input_schema_visible_when_no_predicate',\n });\n }\n }\n\n // Pattern length + compilation.\n if (pattern !== null && pattern !== '') {\n if (pattern.length > INPUT_SCHEMA.maxPatternLength) {\n issues.error({\n field: `${base}.pattern`,\n message: `field '${shownName}': pattern length ${pattern.length} exceeds the maximum of ${INPUT_SCHEMA.maxPatternLength}`,\n code: 'input_schema_pattern_too_long',\n });\n } else {\n try {\n new RegExp(pattern);\n } catch (e) {\n issues.error({\n field: `${base}.pattern`,\n message: `field '${shownName}': invalid pattern: ${e instanceof Error ? e.message : String(e)}`,\n code: 'input_schema_invalid_pattern',\n });\n }\n }\n }\n}\n\nfunction lintFieldOrdering(fields: InputSchemaField[], schemaPath: string, issues: Issues): void {\n let firstParametricIdx = -1;\n let firstParametricName = '';\n let firstParametricType = '';\n fields.forEach((f, i) => {\n if (!isRecord(f)) return;\n const type = issues.stringOf(f, 'type', fieldPath(schemaPath, i));\n if (type === null) return;\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i)) ?? `#${i}`;\n if (firstParametricIdx === -1 && INPUT_SCHEMA.parametricTypes.has(type)) {\n firstParametricIdx = i;\n firstParametricName = name;\n firstParametricType = type;\n return;\n }\n if (type === TYPE_FILE && firstParametricIdx !== -1) {\n issues.warn({\n field: fieldPath(schemaPath, i),\n message: `file field '${name}' is declared after parametric field '${firstParametricName}' (${firstParametricType}); consider moving file fields first`,\n code: 'input_schema_file_after_parametric',\n });\n }\n });\n}\n\n/**\n * Validate one `InputSchema`-shaped definition at an arbitrary base path.\n *\n * Mirrors the Go `ValidateInputSchemaDefinition`, which is reused verbatim for\n * both `flow.input_schema` and a step's `output_schema` (DC-CP-7). The emitted\n * `code`s are therefore the shared `input_schema_*` set regardless of the site;\n * only the `field` path differs (`schemaPath`).\n */\nexport function validateSchemaDefinition(\n schema: unknown,\n schemaPath: string,\n issues: Issues,\n): void {\n if (schema === undefined || schema === null) return;\n if (!isRecord(schema)) {\n issues.error({\n field: schemaPath,\n message: `${schemaPath} must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n const s = schema as InputSchema;\n\n if (s.version !== INPUT_SCHEMA_VERSION) {\n issues.error({\n field: `${schemaPath}.version`,\n message: `${schemaPath} version ${String(s.version)} is not supported (expected ${INPUT_SCHEMA_VERSION})`,\n code: 'input_schema_invalid_version',\n });\n }\n\n const fields = s.fields;\n if (fields === undefined || fields === null) return;\n if (!Array.isArray(fields)) {\n issues.error({\n field: `${schemaPath}.fields`,\n message: `${schemaPath}.fields must be a list`,\n code: 'invalid_type',\n });\n return;\n }\n\n // Resolution index for visible_when (forward references allowed).\n const allNames = new Set<string>();\n fields.forEach((f: unknown, i: number) => {\n if (!isRecord(f)) return;\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i));\n if (name !== null && name !== '') allNames.add(name);\n });\n\n const seen = new Map<string, number>();\n fields.forEach((rawField, i) => {\n if (!isRecord(rawField)) {\n issues.error({\n field: fieldPath(schemaPath, i),\n message: `${schemaPath} field at index ${i} must be a mapping`,\n code: 'invalid_type',\n });\n return;\n }\n validateField(rawField as InputSchemaField, schemaPath, i, seen, issues);\n });\n\n // Second pass: visible_when references must resolve.\n fields.forEach((rawField, i) => {\n if (!isRecord(rawField)) return;\n const f = rawField as InputSchemaField;\n if (!isRecord(f.visible_when)) return;\n const vw = f.visible_when as VisibleWhenPredicate;\n const ref = issues.stringOf(vw, 'field', `${fieldPath(schemaPath, i)}.visible_when`);\n if (ref !== null && ref !== '' && !allNames.has(ref)) {\n const name = issues.stringOf(f, 'name', fieldPath(schemaPath, i)) ?? `#${i}`;\n issues.error({\n field: `${fieldPath(schemaPath, i)}.visible_when.field`,\n message: `field '${name}': visible_when references unknown field '${ref}'`,\n code: 'input_schema_visible_when_unknown_field',\n });\n }\n });\n\n lintFieldOrdering(fields as InputSchemaField[], schemaPath, issues);\n}\n\nexport function validateInputSchema(flow: Flow, issues: Issues): void {\n validateSchemaDefinition(flow.input_schema, 'input_schema', issues);\n}\n","// `reserved_input_name`: an input the flow declares in the platform's `__`\n// namespace.\n//\n// The platform keeps that namespace for values it writes itself: the acting\n// person, the credential manifest, the untrusted-input marker. A declared default\n// under such a name used to be a way for a flow author to write one of them, and a\n// value or default written there is never delivered at run time, so the author\n// learns at save that the name cannot carry data.\n//\n// Both places an input is declared are read: the keys of the top-level `query:`\n// mapping (reported sorted, field `query.<name>`) and the `name` of every\n// `input_schema.fields[]` entry (in file order, field `input_schema.fields.<name>`).\n// A schema field is addressed by NAME, not by index like this port's other\n// input_schema findings, because the reference reports it that way and a host that\n// merges several verdicts drops a finding only when code and field both match.\n// A non-string name is skipped (`input_schema_invalid_field_name` names it).\n// Findings carry no step id.\n\nimport type { Flow } from '../types.js';\nimport { RESERVED_INPUT_NAMES } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nfunction formatField(format: string, name: string): string {\n return format.replace('%s', () => name);\n}\n\nexport function validateReservedInputNames(flow: Flow, issues: Issues): void {\n const rule = RESERVED_INPUT_NAMES;\n const report = (name: string, fieldFormat: string): void => {\n issues.error({\n field: formatField(fieldFormat, name),\n message: rule.messageFormat.replace('%s', () => JSON.stringify(name)),\n code: rule.code,\n suggestion: rule.suggestion,\n });\n };\n const query = (flow as { query?: unknown }).query;\n if (isRecord(query)) {\n for (const name of Object.keys(query).sort()) {\n if (name.startsWith(rule.prefix)) report(name, rule.queryFieldFormat);\n }\n }\n const schema = (flow as { input_schema?: unknown }).input_schema;\n const fields = isRecord(schema) ? schema.fields : undefined;\n if (!Array.isArray(fields)) return;\n for (const f of fields) {\n if (!isRecord(f)) continue;\n if (typeof f.name === 'string' && f.name.startsWith(rule.prefix)) {\n report(f.name, rule.schemaFieldFormat);\n }\n }\n}\n","// Per-step `output_schema` definition validation (DC-CP-7).\n//\n// A step may declare `output_schema`, the typed shape of its own output. In the\n// Go reference this reuses the SAME structure and validator as `input_schema`\n// (`ValidateInputSchemaDefinition` is called verbatim on `step.OutputSchema`),\n// so we delegate to the shared `validateSchemaDefinition` and only differ in the\n// base field path. It is optional (opt-in): a step without `output_schema` keeps\n// lenient behavior. Loop sub-steps may also carry an `output_schema`.\n//\n// NOTE: the companion `unresolvable_data_path` rule (a `.data.<step>.<field>`\n// reference to a field NOT declared in `<step>`'s output_schema) requires\n// resolving template field references against the state graph — the same\n// runtime concern this validator deliberately does NOT reproduce for templates.\n// It is a documented divergence; see PARITY.md.\n\nimport type { Flow, LoopSubStep, StepDefinition } from '../types.js';\nimport { Issues, isArray, isRecord } from './util.js';\nimport { validateSchemaDefinition } from './inputSchema.js';\n\nexport function validateOutputSchemas(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n if (step.output_schema !== undefined) {\n validateSchemaDefinition(step.output_schema, `steps.${stepID}.output_schema`, issues);\n }\n\n // Loop sub-steps each carry their own optional output_schema.\n const loop = step.loop;\n if (isRecord(loop) && isArray(loop.steps)) {\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub)) return;\n const subStep = sub as LoopSubStep;\n if (subStep.output_schema !== undefined) {\n validateSchemaDefinition(\n subStep.output_schema,\n `steps.${stepID}.loop.steps[${i}].output_schema`,\n issues,\n );\n }\n });\n }\n }\n}\n","// Per-step `quality_gate:` block validation (DC-CP-8).\n//\n// Mirrors `FlowParser.validateQualityGate` (parser.go): rubric non-empty;\n// threshold in [0,1]; on_fail ∈ {fail,goto,retry} (the Go enum also lists\n// `human`, but it is validation-REJECTED pending the human-task inbox, so we\n// reject it too — with its own code); when on_fail=goto, goto_step is required,\n// must name an existing step, and must not point at the gate's own step (a\n// failing self-goto loops forever). The Go layer additionally refuses a gate on\n// a composite step (loop/for_each/parallel) or on a member of another step's\n// parallel fan-out, because gate routing is only wired into the sequential\n// driver; those static guards are ported here as well.\n//\n// Comparison contract is the `code` set (the Go layer uses a single\n// ErrFlowValidation error class with distinct messages; the stable codes below\n// are this validator's parity surface).\n\nimport type { Flow, NextLogicDefinition, QualityGateDefinition, StepDefinition } from '../types.js';\nimport { QUALITY_GATE } from '../spec/index.js';\nimport { Issues, isNumber, isRecord } from './util.js';\n\nconst ON_FAIL_GOTO = 'goto';\n\nfunction isCompositeStep(step: StepDefinition): boolean {\n const next = step.next as NextLogicDefinition | undefined;\n return (\n isRecord(step.loop) || isRecord(step.for_each) || (isRecord(next) && isRecord(next.parallel))\n );\n}\n\n/** Step IDs that appear in some OTHER step's `next.parallel.steps` fan-out. */\nfunction parallelMembers(steps: Record<string, unknown>, issues: Issues): Map<string, string> {\n const members = new Map<string, string>();\n for (const [ownerID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const next = (rawStep as StepDefinition).next as NextLogicDefinition | undefined;\n const list = isRecord(next) && isRecord(next.parallel) ? next.parallel.steps : undefined;\n if (!Array.isArray(list)) continue;\n list.forEach((raw: unknown, i: number) => {\n const memberID = issues.stringAt(raw, `steps.${ownerID}.next.parallel.steps[${i}]`);\n if (memberID !== null && !members.has(memberID)) members.set(memberID, ownerID);\n });\n }\n return members;\n}\n\nfunction validateGate(\n gate: QualityGateDefinition,\n stepID: string,\n step: StepDefinition,\n steps: Record<string, unknown>,\n members: Map<string, string>,\n issues: Issues,\n): void {\n const field = `steps.${stepID}.quality_gate`;\n\n // rubric — required, non-empty.\n // Go `string` fields throughout: `rubric: 5` is a rubric, `on_fail: 1` is the\n // invalid action \"1\", `goto_step: 2` names the step \"2\".\n const rubric = issues.stringOf(gate, 'rubric', field);\n if (rubric === null || rubric.trim() === '') {\n issues.error({\n field: `${field}.rubric`,\n message: `quality_gate on step '${stepID}' requires a non-empty 'rubric'`,\n code: 'quality_gate_missing_rubric',\n stepId: stepID,\n });\n }\n\n // threshold — when set, must be in [0,1].\n if (gate.threshold !== undefined) {\n if (\n !isNumber(gate.threshold) ||\n gate.threshold < QUALITY_GATE.thresholdMin ||\n gate.threshold > QUALITY_GATE.thresholdMax\n ) {\n issues.error({\n field: `${field}.threshold`,\n message: `quality_gate on step '${stepID}' has threshold ${String(gate.threshold)} out of range [${QUALITY_GATE.thresholdMin},${QUALITY_GATE.thresholdMax}]`,\n code: 'quality_gate_threshold_out_of_range',\n stepId: stepID,\n });\n }\n }\n\n // on_fail — optional; when set must be a supported action.\n const onFail = issues.stringOf(gate, 'on_fail', field);\n if (onFail !== null && onFail !== '') {\n if (QUALITY_GATE.onFailRejected.has(onFail)) {\n // Present in the Go enum but not yet supported (e.g. `human`).\n issues.error({\n field: `${field}.on_fail`,\n message: `quality_gate on step '${stepID}' uses on_fail='${onFail}', which is not yet supported; use one of: ${[...QUALITY_GATE.onFailActions].join(', ')}`,\n code: 'quality_gate_on_fail_unsupported',\n stepId: stepID,\n });\n } else if (!QUALITY_GATE.onFailActions.has(onFail)) {\n issues.error({\n field: `${field}.on_fail`,\n message: `quality_gate on step '${stepID}' has invalid on_fail '${onFail}'`,\n code: 'quality_gate_invalid_on_fail',\n stepId: stepID,\n suggestion: `Use one of: ${[...QUALITY_GATE.onFailActions].join(', ')}`,\n });\n }\n }\n\n // goto_step — required + must resolve when on_fail=goto, and not be a self-goto.\n if (onFail === ON_FAIL_GOTO) {\n const goto = issues.stringOf(gate, 'goto_step', field);\n if (goto === null || goto === '') {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' uses on_fail=goto but goto_step is empty`,\n code: 'quality_gate_goto_missing',\n stepId: stepID,\n });\n } else if (!(goto in steps)) {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' goto_step '${goto}' does not name an existing step`,\n code: 'step_not_found',\n stepId: stepID,\n });\n } else if (goto === stepID) {\n issues.error({\n field: `${field}.goto_step`,\n message: `quality_gate on step '${stepID}' uses on_fail=goto pointing at itself; a failing self-goto loops forever (use on_fail=retry with max_retries)`,\n code: 'quality_gate_goto_self',\n stepId: stepID,\n });\n }\n }\n\n // Composite / parallel-member scope guards.\n if (isCompositeStep(step)) {\n issues.error({\n field,\n message: `quality_gate on step '${stepID}' is not supported on loop/for_each/parallel steps`,\n code: 'quality_gate_on_composite',\n stepId: stepID,\n });\n }\n const owner = members.get(stepID);\n if (owner !== undefined) {\n issues.error({\n field,\n message: `quality_gate on step '${stepID}' is not supported because it is a parallel member of step '${owner}'`,\n code: 'quality_gate_on_parallel_member',\n stepId: stepID,\n });\n }\n}\n\nexport function validateQualityGates(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n const members = parallelMembers(steps, issues);\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n if (!isRecord(step.quality_gate)) continue;\n validateGate(step.quality_gate as QualityGateDefinition, stepID, step, steps, members, issues);\n }\n}\n","// Focused syntax checker for Go `text/template` source.\n//\n// This is NOT a renderer and NOT a full parser. It reproduces the subset of\n// Go's `template.Parse` *syntax* failures that matter for static flow\n// validation, with a deliberate bias against false positives:\n//\n// 1. Unclosed `{{` action delimiters (respecting quoted strings + comments).\n// 2. Control-flow nesting balance: if / range / with / block / define must\n// each be closed by `end`; `else` must sit inside if / with / range.\n// 3. Empty actions (`{{}}`).\n// 4. (opt-in) Unknown function names in command position.\n//\n// Stray `}}` in text is NOT an error (Go treats it as literal text), matching\n// the reference behaviour. Field/variable/literal pipelines are intentionally\n// not deeply parsed — that would invite false positives without catching bugs\n// a flow author cares about at authoring time.\n\n/** A single Go-template syntax problem. */\nexport interface TemplateSyntaxError {\n message: string;\n /** When true, this came from the opt-in function allow-list pass. */\n isFunctionError?: boolean;\n}\n\nexport interface TemplateCheckOptions {\n /** Function names recognised by the AIgentFlow template engine. */\n knownFunctions?: ReadonlySet<string>;\n /** When true, an unknown command-position function name is reported. */\n strictFunctions?: boolean;\n}\n\nconst BLOCK_OPENERS = new Set(['if', 'range', 'with', 'block', 'define']);\nconst ELSE_CONTEXTS = new Set(['if', 'range', 'with']);\nconst KEYWORDS = new Set(['if', 'range', 'with', 'block', 'define', 'template', 'else', 'end']);\nconst LITERALS = new Set(['true', 'false', 'nil']);\n\nexport interface Action {\n /** Raw inner text between the delimiters (trim markers stripped). */\n body: string;\n /** True for comment actions (the Go `comment` action form). */\n isComment: boolean;\n}\n\n/**\n * Split template source into actions, respecting quoted strings and comments.\n * Returns the actions plus a fatal error if a `{{` is never closed.\n */\nexport function lexActions(src: string): { actions: Action[]; fatal?: TemplateSyntaxError } {\n const actions: Action[] = [];\n let i = 0;\n const n = src.length;\n\n while (i < n) {\n const open = src.indexOf('{{', i);\n if (open === -1) break;\n\n let j = open + 2;\n // Optional left-trim marker `{{-`.\n if (src[j] === '-') j += 1;\n\n // Comment action: `{{/* ... */}}`.\n const afterWs = skipSpaces(src, j);\n if (src.startsWith('/*', afterWs)) {\n const closeComment = src.indexOf('*/', afterWs + 2);\n if (closeComment === -1) {\n return { actions, fatal: { message: 'unclosed comment in action: missing \"*/\"' } };\n }\n let k = skipSpaces(src, closeComment + 2);\n if (src[k] === '-') k += 1;\n if (!src.startsWith('}}', k)) {\n return {\n actions,\n fatal: { message: 'unclosed action delimiter: expected \"}}\" after comment' },\n };\n }\n actions.push({ body: '', isComment: true });\n i = k + 2;\n continue;\n }\n\n // Scan for the closing `}}`, skipping over quoted strings.\n let k = j;\n let closed = -1;\n while (k < n) {\n const c = src[k];\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(src, k, c);\n if (end === -1) {\n return {\n actions,\n fatal: { message: `unterminated string in action: missing closing ${c}` },\n };\n }\n k = end + 1;\n continue;\n }\n if (c === '}' && src[k + 1] === '}') {\n closed = k;\n break;\n }\n k += 1;\n }\n if (closed === -1) {\n return { actions, fatal: { message: 'unclosed action delimiter \"{{\"' } };\n }\n\n let bodyEnd = closed;\n // Strip right-trim marker ` -}}` → the `-` immediately before `}}`.\n if (src[bodyEnd - 1] === '-') bodyEnd -= 1;\n const body = src.slice(j, bodyEnd).trim();\n actions.push({ body, isComment: false });\n i = closed + 2;\n }\n\n return { actions };\n}\n\nfunction skipSpaces(src: string, idx: number): number {\n let i = idx;\n while (\n i < src.length &&\n (src[i] === ' ' || src[i] === '\\t' || src[i] === '\\n' || src[i] === '\\r')\n ) {\n i += 1;\n }\n return i;\n}\n\n/** Returns the index of the closing quote, or -1 if unterminated. */\nexport function scanString(src: string, start: number, quote: string): number {\n let i = start + 1;\n const raw = quote === '`'; // backtick raw strings have no escapes\n while (i < src.length) {\n const c = src[i];\n if (!raw && c === '\\\\') {\n i += 2;\n continue;\n }\n if (c === quote) return i;\n i += 1;\n }\n return -1;\n}\n\n/** First whitespace-delimited token of an action body. */\nfunction firstToken(body: string): string {\n const m = /^[a-zA-Z]+/.exec(body);\n return m ? m[0] : '';\n}\n\n/**\n * Check Go template source for syntax errors. Returns one entry per problem;\n * an empty array means the template parses (to the depth this checker models).\n */\nexport function checkGoTemplateSyntax(\n src: string,\n opts: TemplateCheckOptions = {},\n): TemplateSyntaxError[] {\n const errors: TemplateSyntaxError[] = [];\n const { actions, fatal } = lexActions(src);\n if (fatal) {\n errors.push(fatal);\n return errors;\n }\n\n // Track control-flow nesting.\n const stack: string[] = [];\n\n for (const action of actions) {\n if (action.isComment) continue;\n if (action.body === '') {\n errors.push({ message: 'empty action \"{{}}\"' });\n continue;\n }\n\n const tok = firstToken(action.body);\n if (KEYWORDS.has(tok)) {\n if (tok === 'end') {\n if (stack.length === 0) {\n errors.push({ message: 'unexpected \"{{end}}\" with no matching block' });\n } else {\n stack.pop();\n }\n } else if (tok === 'else') {\n const top = stack[stack.length - 1];\n if (top === undefined || !ELSE_CONTEXTS.has(top)) {\n errors.push({ message: 'unexpected \"{{else}}\" outside of if / range / with' });\n }\n } else if (BLOCK_OPENERS.has(tok)) {\n stack.push(tok);\n }\n // `template` takes no `end` — nothing to push.\n continue;\n }\n\n // Non-keyword leading token. Optionally check the function allow-list.\n if (opts.strictFunctions && opts.knownFunctions) {\n checkFunctions(action.body, opts.knownFunctions, errors);\n }\n }\n\n for (let s = stack.length - 1; s >= 0; s--) {\n errors.push({ message: `unclosed \"{{${stack[s]}}}\" action: missing \"{{end}}\"` });\n }\n\n return errors;\n}\n\n/**\n * Opt-in: flag bare identifiers in command position that are not known\n * functions. A bare leading word in a Go pipeline stage is a function call;\n * fields (`.x`), variables (`$x`), and literals are skipped. Conservative by\n * design — see PARITY.md for why this is off by default.\n */\nfunction checkFunctions(\n body: string,\n known: ReadonlySet<string>,\n errors: TemplateSyntaxError[],\n): void {\n // Split into pipeline stages on top-level `|` (ignore `|` inside strings).\n const stages = splitPipeline(body);\n for (const stage of stages) {\n const trimmed = stage.trim();\n if (trimmed === '') continue;\n const first = trimmed.split(/\\s+/)[0] as string;\n // Skip fields, variables, parenthesised sub-pipelines, string/number\n // literals, assignment, and keywords.\n if (\n first.startsWith('.') ||\n first.startsWith('$') ||\n first.startsWith('(') ||\n first.startsWith('\"') ||\n first.startsWith('`') ||\n first.startsWith(\"'\") ||\n /^[-+]?[0-9]/.test(first) ||\n KEYWORDS.has(first) ||\n LITERALS.has(first)\n ) {\n continue;\n }\n const name = /^[a-zA-Z_][a-zA-Z0-9_]*/.exec(first)?.[0];\n if (name && !known.has(name)) {\n errors.push({\n message: `function \"${name}\" not defined`,\n isFunctionError: true,\n });\n }\n }\n}\n\nfunction splitPipeline(body: string): string[] {\n const stages: string[] = [];\n let current = '';\n let i = 0;\n while (i < body.length) {\n const c = body[i] as string;\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(body, i, c);\n if (end === -1) {\n current += body.slice(i);\n break;\n }\n current += body.slice(i, end + 1);\n i = end + 1;\n continue;\n }\n if (c === '|') {\n stages.push(current);\n current = '';\n i += 1;\n continue;\n }\n current += c;\n i += 1;\n }\n stages.push(current);\n return stages;\n}\n","// Detects a value PIPED into the template function `default`.\n//\n// `default` takes the value first (`default .x \"fallback\"`). A pipe hands the\n// piped value to the LAST parameter, so `{{ .x | default \"w\" }}` is\n// `default \"w\" .x`: the literal is the \"value\", it is never empty, and the\n// result is always the fallback. Nothing fails at run time, the data is simply\n// never used.\n//\n// The reference walks Go's parse tree. This port has no parse tree, so it runs\n// a small tokenizer over each `{{ ... }}` action instead — never a regex over\n// the raw text. It respects string, raw-string and character literals and\n// comments, splits a pipeline on top-level `|`, recurses into parentheses, and\n// recognises the pipeline of `if` / `else if` / `range` / `with` / `template` /\n// `block` actions and of a `$v :=` declaration. Only a bare identifier `default`\n// in command position counts; a field (`.query.default`), a variable\n// (`$default`) and a literal never do. Known limits are in PARITY.md.\n\nimport { lexActions, scanString } from './gotmpl-syntax.js';\n\nconst FUNCTION_NAME = 'default';\nconst PIPE = '|';\nconst OPEN_PAREN = '(';\nconst CLOSE_PAREN = ')';\n/**\n * Parenthesis nesting past which a pipeline is left unexamined. The validator runs on untrusted\n * flow documents (browser, CLI, a service), and a template of thousands of `(` would otherwise\n * overflow the stack; Go's own template parser caps nesting too, so such a template never\n * runs. Real templates nest a handful of levels.\n */\nconst MAX_NESTING_DEPTH = 100;\n\n/** Control keywords whose remainder is a pipeline (longest first). */\nconst PIPELINE_KEYWORDS = /^(?:else\\s+if|else\\s+with|if|range|with|template|block)(?![\\w$.])/;\n/** `define \"name\"` carries no pipeline; neither does a bare `else`/`end`. */\nconst NO_PIPELINE = /^(?:define|else|end|break|continue)(?![\\w$.])/;\n/** A variable declaration or assignment that opens a pipeline. */\nconst DECLARATION = /^\\$\\w*(?:\\s*,\\s*\\$\\w*)*\\s*:?=/;\n\ninterface Parsed {\n /** Printed form of the pipeline just parsed. */\n text: string;\n /** Index just past what was consumed. */\n end: number;\n}\n\n/** Returns the sorted, de-duplicated pipelines of `src` that pipe into `default`. */\nexport function pipedDefaultPipelines(src: string): string[] {\n const { actions, fatal } = lexActions(src);\n if (fatal) return [];\n const found = new Set<string>();\n try {\n for (const action of actions) {\n if (action.isComment || action.body === '') continue;\n scanAction(action.body, found);\n }\n } catch (err) {\n // A rule must never take the validator down: a template this module cannot walk is simply\n // not examined (the syntax check has its own say about it).\n if (!(err instanceof RangeError)) throw err;\n return [];\n }\n return [...found].sort();\n}\n\nfunction scanAction(body: string, found: Set<string>): void {\n let rest = body;\n const kw = PIPELINE_KEYWORDS.exec(rest);\n if (!kw && NO_PIPELINE.test(rest)) return;\n if (kw) {\n rest = rest.slice(kw[0].length).trimStart();\n const keyword = kw[0].replace(/\\s+/g, ' ');\n if (keyword === 'template' || keyword === 'block') {\n // Skip the template name literal; the remainder is the pipeline.\n const q = rest[0];\n if (q === '\"' || q === '`') {\n const end = scanString(rest, 0, q);\n if (end === -1) return;\n rest = rest.slice(end + 1).trimStart();\n }\n }\n }\n if (rest === '') return;\n parsePipeline(rest, 0, false, found, 0);\n}\n\n/**\n * Parses one pipeline starting at `start`; when `nested`, stops after the `)`\n * that closes it. Every pipeline met on the way (this one and any parenthesised\n * one) is checked and recorded in `found`.\n */\nfunction parsePipeline(\n src: string,\n start: number,\n nested: boolean,\n found: Set<string>,\n depth: number,\n): Parsed {\n if (depth > MAX_NESTING_DEPTH) return { text: src.slice(start), end: src.length };\n let i = start;\n const n = src.length;\n let decl = '';\n const decMatch = DECLARATION.exec(src.slice(i));\n if (decMatch) {\n decl = decMatch[0].replace(/\\s+/g, ' ') + ' ';\n i += decMatch[0].length;\n }\n\n const commands: string[][] = [];\n let current: string[] = [];\n let firstWords: string[] = [];\n let pipedDefault = false;\n const pushCommand = (): void => {\n if (current.length > 0) {\n commands.push(current);\n firstWords.push(current[0] as string);\n }\n current = [];\n };\n\n while (i < n) {\n const c = src[i] as string;\n if (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n i += 1;\n continue;\n }\n if (c === '\"' || c === '`' || c === \"'\") {\n const end = scanString(src, i, c);\n const stop = end === -1 ? n - 1 : end;\n current.push(src.slice(i, stop + 1));\n i = stop + 1;\n continue;\n }\n if (c === OPEN_PAREN) {\n const inner = parsePipeline(src, i + 1, true, found, depth + 1);\n current.push(`(${inner.text})`);\n i = inner.end;\n continue;\n }\n if (c === CLOSE_PAREN) {\n if (nested) {\n i += 1;\n break;\n }\n i += 1; // stray: tolerate\n continue;\n }\n if (c === PIPE) {\n pushCommand();\n i += 1;\n continue;\n }\n let j = i;\n while (j < n && !/[\\s|()\"`']/.test(src[j] as string)) j += 1;\n if (j === i) j = i + 1;\n current.push(src.slice(i, j));\n i = j;\n }\n pushCommand();\n\n firstWords.forEach((word, idx) => {\n if (idx > 0 && word === FUNCTION_NAME) pipedDefault = true;\n });\n const text = decl + commands.map((cmd) => cmd.join(' ')).join(` ${PIPE} `);\n if (pipedDefault) found.add(text);\n return { text, end: i };\n}\n","// Shape of a pre/post-processing operation: is the operation type one the\n// engine dispatches, and does the operation's handler read the config keys it\n// was given?\n//\n// Mirrors `validateProcessingOperationShape` (validation.go). Both verdicts are\n// WARNINGS in the reference and here: a flow carrying either mistake saves and\n// runs. That is the whole reason the rule is worth having — an operation type\n// the engine cannot dispatch fails at run time with \"unsupported operation\n// type\", and a config key the handler never reads is simply ignored, so a\n// `transformation:` written where the handler reads `transformer:` produces a\n// step that succeeds and does nothing.\n//\n// This module also owns the ONE enumeration of processing operations, which\n// `templates.ts` shares — the two rules disagree about nothing structural, and\n// a second walk would be a second place for the guard key to be mishandled.\n\nimport type { Flow, StepDefinition, ValidationIssue } from '../types.js';\nimport { PROCESSING_OPERATIONS, processingOperationConfigKeys } from '../spec/index.js';\nimport { Issues, isArray, isRecord } from './util.js';\n\n/** The optional guard key on a processing operation; every other key names the operation. */\nexport const PROCESSING_OP_GUARD_KEY = PROCESSING_OPERATIONS.guardKey;\n\n/** The two phases a processing operation can be declared in, in execution order. */\nconst PROCESSING_PHASES = ['pre_processing', 'post_processing'] as const;\n\n/**\n * One entry of a `pre_processing:` / `post_processing:` list, decomposed the way\n * the reference's custom unmarshaller decomposes it.\n *\n * A processing operation is written as a single-key map — `- data.set: { … }` —\n * plus an optional `if:` guard. `ProcessingOperationDefinition` unmarshals that\n * key into `OperationType` and its body into an INLINE `Config`, which is why\n * the operation name is NOT a path segment in any finding: the reference\n * addresses `steps.<id>.post_processing[0].<configKey>`.\n */\nexport interface ProcessingOperationRef {\n stepId: string;\n /** `steps.<id>.post_processing[0]` — the operation itself. */\n basePath: string;\n /** The raw list entry, for callers that must handle a non-map entry. */\n raw: unknown;\n /** The `if:` guard value when the entry carries one. */\n guard?: unknown;\n /**\n * Every non-guard key of the entry, as written. The reference refuses a map\n * with more than one such key at unmarshal time; this validator has no typed\n * unmarshal, so it carries them all and each rule decides what it can say.\n */\n entries: Array<readonly [string, unknown]>;\n /** Which handler will dispatch this operation — the dispatch set differs. */\n scope: ProcessingOperationScope;\n}\n\n/**\n * WHERE a processing operation is declared, because the dispatch set is not the\n * same in both places.\n *\n * `standard` is the top-level handler. `loopSubStep` is `executeLoopPostProcessing`,\n * which dispatches `loop.set` / `loop.break` ITSELF and falls through to the\n * standard handler for everything else — a strict superset. ⛔ The two are a\n * PARTITION and never a union: `loop.set` at the top level is an operation the\n * standard handler cannot dispatch, and saying otherwise would silently accept a\n * flow that fails at run time.\n */\nexport type ProcessingOperationScope = 'standard' | 'loopSubStep';\n\n/** The operation types dispatchable in a scope. */\nexport function dispatchableOperationTypes(scope: ProcessingOperationScope): ReadonlySet<string> {\n if (scope === 'standard') return PROCESSING_OPERATIONS.standardTypes;\n return new Set([\n ...PROCESSING_OPERATIONS.standardTypes,\n ...PROCESSING_OPERATIONS.loopSubStepTypes,\n ]);\n}\n\n/** Decompose both processing phases of one step, in declaration order. */\nexport function processingOperationsOfStep(\n stepId: string,\n step: StepDefinition,\n): ProcessingOperationRef[] {\n return decomposePhases(stepId, step as Record<string, unknown>, `steps.${stepId}`, 'standard');\n}\n\n/**\n * Decompose the processing operations of every sub-step of a `loop:` step.\n *\n * ⛔ The reference's `validateStepsInOrder` walks `flow.steps`, and a loop body\n * is a SECOND step table — so until v2.648.0 no template and no operation shape\n * inside a loop sub-step had been looked at by either implementation. This\n * validator inherited the same blind spot, recorded in PARITY.md as a scope note\n * rather than a divergence. DC-FORGE-78 closed it on both sides.\n *\n * Findings are attributed to the PARENT step id, because that is the id every\n * other surface knows this work by; the sub-step is named by its INDEX in the\n * field path, matching the reference's `steps.<id>.loop.steps[i]…`.\n */\nexport function loopSubStepProcessingOperations(\n stepId: string,\n step: StepDefinition,\n): ProcessingOperationRef[] {\n const refs: ProcessingOperationRef[] = [];\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n refs.push(...decomposePhases(stepId, sub.raw, sub.basePath, 'loopSubStep'));\n }\n return refs;\n}\n\n/** One sub-step of a `loop:` body, with the field path the reference addresses it by. */\nexport interface LoopSubStepRef {\n /** `steps.<parent>.loop.steps[i]` */\n basePath: string;\n raw: Record<string, unknown>;\n}\n\n/** Enumerate a loop step's sub-steps. Empty for a step with no `loop:` block. */\nexport function loopSubStepsOfStep(stepId: string, step: StepDefinition): LoopSubStepRef[] {\n const loop = (step as Record<string, unknown>).loop;\n if (!isRecord(loop)) return [];\n const subSteps = (loop as Record<string, unknown>).steps;\n if (!isArray(subSteps)) return [];\n const refs: LoopSubStepRef[] = [];\n subSteps.forEach((sub, i) => {\n if (!isRecord(sub)) return;\n refs.push({\n basePath: `steps.${stepId}.loop.steps[${i}]`,\n raw: sub as Record<string, unknown>,\n });\n });\n return refs;\n}\n\nfunction decomposePhases(\n stepId: string,\n container: Record<string, unknown>,\n pathPrefix: string,\n scope: ProcessingOperationScope,\n): ProcessingOperationRef[] {\n const refs: ProcessingOperationRef[] = [];\n for (const phase of PROCESSING_PHASES) {\n const ops = container[phase];\n if (!isArray(ops)) continue;\n ops.forEach((op, i) => {\n const basePath = `${pathPrefix}.${phase}[${i}]`;\n if (!isRecord(op)) {\n refs.push({ stepId, basePath, raw: op, entries: [], scope });\n return;\n }\n const ref: ProcessingOperationRef = { stepId, basePath, raw: op, entries: [], scope };\n for (const [key, value] of Object.entries(op)) {\n if (key === PROCESSING_OP_GUARD_KEY) {\n ref.guard = value;\n continue;\n }\n ref.entries.push([key, value] as const);\n }\n refs.push(ref);\n });\n }\n return refs;\n}\n\nfunction unknownOperationIssue(\n ref: ProcessingOperationRef,\n operationType: string,\n): Omit<ValidationIssue, 'severity'> {\n const known = [...dispatchableOperationTypes(ref.scope)].sort().join(', ');\n return {\n // The operation type is the YAML MAP KEY (`- data.set: {…}`), not a field.\n // Addressing a `.operation_type` here would send the author looking for\n // something the grammar does not have, so the finding points at the\n // operation itself.\n field: ref.basePath,\n message:\n `Processing operation type '${operationType}' is not dispatched by the engine; ` +\n 'at run time the step fails with \"unsupported operation type\" unless the ' +\n \"operation's `if:` guard is false\",\n code: 'unknown_processing_operation',\n stepId: ref.stepId,\n suggestion: `Operation types the engine dispatches here: ${known}`,\n };\n}\n\n/**\n * Warn about an operation type the standard handler cannot dispatch and about a\n * config key its handler never reads.\n *\n * Both scopes are walked (DC-FORGE-78): the top-level steps, where `loop.set` /\n * `loop.break` are correctly UNKNOWN because the standard handler has no case for\n * them, and every `loop:` body, where they are dispatchable. ⛔ Merging the two\n * sets would accept `loop.set` at the top level, which fails at run time.\n */\nexport function validateProcessingOperations(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n\n for (const [stepId, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n for (const ref of [\n ...processingOperationsOfStep(stepId, step),\n ...loopSubStepProcessingOperations(stepId, step),\n ]) {\n // The reference refuses an entry that is not a one-key map outright, at\n // unmarshal time. There is no operation to have an opinion about here, so\n // this rule says nothing and leaves the verdict to the structural pass.\n if (ref.entries.length !== 1) continue;\n const [operationType, config] = ref.entries[0] as readonly [string, unknown];\n\n if (!dispatchableOperationTypes(ref.scope).has(operationType)) {\n issues.warn(unknownOperationIssue(ref, operationType));\n // An unknown type has no key set, so every key under it would warn a\n // second time for the same one mistake. One verdict per defect.\n continue;\n }\n\n const [allowed, closed] = processingOperationConfigKeys(operationType);\n // Not closed: the author names the keys (`data.set` writes each one into\n // `.data`, and so on). There is no unknown key to find.\n if (!closed) continue;\n // The reference requires the config to be a mapping and fails to unmarshal\n // otherwise; a non-map config is not a key question.\n if (!isRecord(config)) continue;\n\n const permitted = new Set(allowed);\n const readable = [...allowed].sort().join(', ');\n // Sorted so one flow's verdicts keep a stable order between runs.\n for (const key of Object.keys(config).sort()) {\n if (permitted.has(key)) continue;\n issues.warn({\n field: `${ref.basePath}.${key}`,\n message:\n `Operation '${operationType}' does not read the config key '${key}', ` +\n 'so it is silently ignored at run time',\n code: 'unknown_processing_config_key',\n stepId: ref.stepId,\n suggestion: `'${operationType}' reads: ${readable}`,\n });\n }\n }\n }\n}\n","// Template syntax validation across a step's templated fields.\n//\n// Mirrors `validateTemplates` / `validateStepTemplates` / `countTemplates`\n// (validation.go): walk string leaves of `query`, `pre_processing`,\n// `post_processing`, and `next.conditions[].if`; anything containing `{{` is\n// run through the Go-template syntax checker. Runtime field-resolution\n// warnings (the reference's execution pass) are intentionally NOT reproduced —\n// see PARITY.md.\n\nimport type {\n Flow,\n NextCondition,\n NextLogicDefinition,\n StepDefinition,\n ValidateOptions,\n} from '../types.js';\nimport { TEMPLATE_FUNCTIONS, TEMPLATE_DEFAULT_PIPED } from '../spec/index.js';\nimport { checkGoTemplateSyntax } from '../template/gotmpl-syntax.js';\nimport { pipedDefaultPipelines } from '../template/gotmpl-default.js';\nimport { Issues, isArray, isRecord, isString } from './util.js';\nimport {\n PROCESSING_OP_GUARD_KEY,\n processingOperationsOfStep,\n loopSubStepProcessingOperations,\n loopSubStepsOfStep,\n type ProcessingOperationRef,\n type LoopSubStepRef,\n} from './processingOperations.js';\n\nfunction isTemplate(value: string): boolean {\n return value.includes('{{');\n}\n\n/** Counter threaded through the walk for the summary statistics. */\ninterface TemplateStats {\n found: number;\n syntaxErrors: number;\n}\n\nfunction checkTemplateString(\n value: string,\n field: string,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n demote = false,\n): void {\n if (!isTemplate(value)) return;\n stats.found += 1;\n const errors = checkGoTemplateSyntax(value, {\n knownFunctions: TEMPLATE_FUNCTIONS,\n // Always look up function names. PARITY.md divergence #4 promises a WARNING\n // for an unknown function by default and an error only under\n // strictRegistries; skipping the lookup entirely (as this did) said nothing\n // at all, while the reference refuses the flow.\n strictFunctions: true,\n });\n // DC-FORGE-78: a finding from inside a LOOP BODY is a warning, never an error.\n //\n // ⛔ The reference consults this validator at its RUN door\n // (FlowYAMLResolver.validateFlowWithQueryParams refuses the mission when the\n // result is invalid), over flows stored long before the loop body was walked\n // by anything. ⚠️ The \"the run already died anyway\" licence that would make an\n // Error safe requires the failing path to be UNCONDITIONAL, and inside a loop\n // body four of the six evaluation sites SWALLOW a template failure and carry\n // on with the raw string. So the walk warns, uniformly, and the CODE survives\n // the demotion — only the severity changes.\n const report = demote ? issues.warn.bind(issues) : issues.error.bind(issues);\n for (const err of errors) {\n if (err.isFunctionError) {\n const reportFunction = opts.strictRegistries === true ? report : issues.warn.bind(issues);\n reportFunction({\n field,\n message: `Template ${err.message}`,\n code: 'template_function_unknown',\n stepId: stepID,\n context: `Template: ${value}`,\n });\n } else {\n stats.syntaxErrors += 1;\n report({\n field,\n message: `Template syntax error: ${err.message}`,\n code: 'template_syntax_error',\n stepId: stepID,\n context: `Template: ${value}`,\n suggestion: 'Check Go template syntax: https://pkg.go.dev/text/template',\n });\n }\n }\n // The reference walks a parse tree, which exists only for a template that\n // parses: with any finding above there is nothing to walk, so say nothing.\n if (errors.length > 0) return;\n // A flow that RUNS with the wrong data is a save-time judgement: an error at\n // the top level, a warning in a loop body, exactly like the syntax error.\n for (const pipe of pipedDefaultPipelines(value)) {\n report({\n field,\n message: TEMPLATE_DEFAULT_PIPED.messageFormat.replace('%s', () => pipe),\n code: TEMPLATE_DEFAULT_PIPED.code,\n stepId: stepID,\n context: `Template: ${value}`,\n suggestion: TEMPLATE_DEFAULT_PIPED.suggestion,\n });\n }\n}\n\n/** Walk string leaves of an arbitrary value, mirroring walkObjectRecursive. */\nfunction walkStrings(\n basePath: string,\n value: unknown,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n check: boolean,\n demote = false,\n): void {\n if (isString(value)) {\n if (check) {\n checkTemplateString(value, basePath, stepID, issues, stats, opts, demote);\n } else if (isTemplate(value)) {\n stats.found += 1;\n }\n return;\n }\n if (isArray(value)) {\n value.forEach((item, i) => {\n walkStrings(`${basePath}[${i}]`, item, stepID, issues, stats, opts, check, demote);\n });\n return;\n }\n if (isRecord(value)) {\n for (const [key, v] of Object.entries(value)) {\n walkStrings(`${basePath}.${key}`, v, stepID, issues, stats, opts, check, demote);\n }\n }\n}\n\n/**\n * Walk one processing operation, producing the field paths the REFERENCE produces.\n *\n * A processing operation is written as a single-key map — `- data.set: { … }` —\n * plus an optional `if:` guard. Go's `ProcessingOperationDefinition` unmarshals\n * that key into `OperationType` and its body into an INLINE `Config`, so the\n * reference reports `…post_processing[0].<configKey>` and `…post_processing[0].if`.\n * Walking the raw record instead inserts the operation name as a path segment\n * (`…post_processing[0].data.set.<configKey>`), which is the same finding under a\n * different address.\n *\n * The decomposition itself lives in `processingOperations.ts` and is shared with\n * the operation-shape rules, so the guard key is recognised in exactly one place.\n */\nfunction walkProcessingOperation(\n ref: ProcessingOperationRef,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n): void {\n const demote = ref.scope === 'loopSubStep';\n if (!isRecord(ref.raw)) {\n walkStrings(ref.basePath, ref.raw, ref.stepId, issues, stats, opts, true, demote);\n return;\n }\n if (ref.guard !== undefined) {\n walkStrings(\n `${ref.basePath}.${PROCESSING_OP_GUARD_KEY}`,\n ref.guard,\n ref.stepId,\n issues,\n stats,\n opts,\n true,\n demote,\n );\n }\n for (const [, value] of ref.entries) {\n // The operation name is absorbed into OperationType; its body is inline.\n walkStrings(ref.basePath, value, ref.stepId, issues, stats, opts, true, demote);\n }\n}\n\n/**\n * Walk one loop sub-step's own templates — `condition:`, `query:` and\n * `next.conditions[].if`. Its processing operations come through\n * walkProcessingOperation like any other, because the decomposition is shared.\n *\n * ⛔ None of this was reachable before DC-FORGE-78: the walk below iterates\n * `flow.steps`, and a loop body is a second step table.\n */\nfunction walkLoopSubStep(\n sub: LoopSubStepRef,\n stepID: string,\n issues: Issues,\n stats: TemplateStats,\n opts: ValidateOptions,\n): void {\n const condition = sub.raw.condition;\n if (isString(condition) && condition !== '') {\n checkTemplateString(condition, `${sub.basePath}.condition`, stepID, issues, stats, opts, true);\n }\n if (sub.raw.query !== undefined) {\n walkStrings(`${sub.basePath}.query`, sub.raw.query, stepID, issues, stats, opts, true, true);\n }\n const next = sub.raw.next;\n if (isRecord(next) && isArray((next as NextLogicDefinition).conditions)) {\n (next as NextLogicDefinition).conditions!.forEach(\n (cond: NextCondition | unknown, i: number) => {\n if (!isRecord(cond)) return;\n const ifExpr = (cond as NextCondition).if;\n if (isString(ifExpr) && ifExpr !== '') {\n stats.found += 1;\n checkTemplateString(\n ifExpr,\n `${sub.basePath}.next.conditions[${i}].if`,\n stepID,\n issues,\n stats,\n opts,\n true,\n );\n }\n },\n );\n }\n}\n\nexport function validateTemplates(\n flow: Flow,\n issues: Issues,\n opts: ValidateOptions,\n): TemplateStats {\n const stats: TemplateStats = { found: 0, syntaxErrors: 0 };\n const steps = flow.steps;\n if (!isRecord(steps)) return stats;\n\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n const step = rawStep as StepDefinition;\n\n if (step.query !== undefined) {\n walkStrings(`steps.${stepID}.query`, step.query, stepID, issues, stats, opts, true);\n }\n for (const ref of processingOperationsOfStep(stepID, step)) {\n walkProcessingOperation(ref, issues, stats, opts);\n }\n for (const sub of loopSubStepsOfStep(stepID, step)) {\n walkLoopSubStep(sub, stepID, issues, stats, opts);\n }\n for (const ref of loopSubStepProcessingOperations(stepID, step)) {\n walkProcessingOperation(ref, issues, stats, opts);\n }\n // response_expectation templates are counted (matching countTemplates) but\n // not syntax-checked (matching validateStepTemplates).\n if (step.response_expectation !== undefined) {\n walkStrings(\n `steps.${stepID}.response_expectation`,\n step.response_expectation,\n stepID,\n issues,\n stats,\n opts,\n false,\n );\n }\n // next.conditions[].if expressions are syntax-checked (not counted).\n const next = step.next;\n if (isRecord(next) && isArray((next as NextLogicDefinition).conditions)) {\n (next as NextLogicDefinition).conditions!.forEach(\n (cond: NextCondition | unknown, i: number) => {\n if (!isRecord(cond)) return;\n const ifExpr = (cond as NextCondition).if;\n if (isString(ifExpr) && ifExpr !== '') {\n // Conditions are counted toward found so a syntax error there does\n // not push templatesValid above templatesFound.\n stats.found += 1;\n checkTemplateString(\n ifExpr,\n `steps.${stepID}.next.conditions[${i}].if`,\n stepID,\n issues,\n stats,\n opts,\n );\n }\n },\n );\n }\n }\n\n return stats;\n}\n","// A step `max_duration:` the reference's engine cannot turn into a deadline.\n//\n// Mirrors `validateStepMaxDurationIsApplied` (validation.go, AIF DC-FORGE-147).\n// The reference bounds each executor invocation of a step by its\n// `max_duration`. Two declarations fall outside that, and both are WARNINGS:\n//\n// - a value that does not parse as a Go duration. The engine runs the step\n// with no time limit rather than fail a stored flow at its run door.\n// - a value on a `loop:` step, which makes no executor call of its own.\n//\n// Loop sub-steps have no `max_duration` field in the reference, so there is no\n// second step table to walk.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, parseGoDuration } from './util.js';\n\nconst CODE_STEP_MAX_DURATION_IGNORED = 'step_max_duration_ignored';\nconst FIELD_MAX_DURATION = 'max_duration';\n\n/** The reference's no-bound spellings (shared with its async/HITL park expiry). */\nconst NO_BOUND_SPELLINGS: ReadonlySet<string> = new Set(['none', 'never', 'infinite']);\n\n/** Go's `%q` for the strings this rule quotes — see unreadLimits' note on non-ASCII. */\nfunction goQuote(s: string): string {\n return JSON.stringify(s);\n}\n\n/**\n * The reference's `parseStepMaxDuration`: true when the value is a no-bound\n * spelling or a Go `time.ParseDuration` string. \"0s\" and negative values parse\n * (the engine treats them as no bound), so they do not warn.\n */\nexport function isApplicableStepMaxDuration(raw: string): boolean {\n return NO_BOUND_SPELLINGS.has(raw) || parseGoDuration(raw) !== null;\n}\n\nexport function validateStepMaxDuration(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n // A Go `string`, filled from any scalar by its source text: `max_duration:\n // 90` arrives as \"90\", which then fails to parse.\n const declared = issues.stringOf(rawStep, FIELD_MAX_DURATION, `steps.${stepID}`);\n if (declared === null || declared === '') continue;\n const field = `steps.${stepID}.${FIELD_MAX_DURATION}`;\n if (!isApplicableStepMaxDuration(declared)) {\n issues.warn({\n field,\n message: `max_duration ${goQuote(declared)} on step ${goQuote(stepID)} is not a duration, so the step runs with no time limit. Use a Go duration such as \"90s\", \"5m\" or \"2h\" (there is no day unit: write \"48h\", not \"2d\"; templates are not rendered here), or \"none\" for no limit.`,\n code: CODE_STEP_MAX_DURATION_IGNORED,\n });\n continue;\n }\n if (isRecord(rawStep.loop)) {\n issues.warn({\n field,\n message: `max_duration ${goQuote(declared)} on loop step ${goQuote(stepID)} bounds nothing: a loop step makes no executor call of its own, and loop sub-steps have no max_duration key. Bound the loop with loop.max_iterations, or remove max_duration.`,\n code: CODE_STEP_MAX_DURATION_IGNORED,\n });\n }\n }\n}\n","// Grammar keys AIgentFlow deleted because nothing read them (AIF DC-FORGE-150,\n// v2.721.0): the top-level `budget:`, the top-level `max_retries:`, and a\n// `max_retries:` directly on a step. Plus `campaign.budget_max_per_child`\n// (AIF DC-FORGE-155, v2.728.0).\n//\n// The reference's save door (create / update / `POST /flows/validate`) parses\n// with yaml `KnownFields(true)`, so a flow declaring any of them is REFUSED, and\n// its `retiredGrammarKeys` table (parser.go) attaches migration advice to the\n// refusal. Stored flows still load leniently and run. This validator answers\n// \"would this save\", so each is an ERROR here — reported with the same code as\n// the other key the reference refuses specifically, `unknown_yaml_key`\n// (connectivity.ts, `next.conditions[].goto_step`).\n//\n// The working keys one level DOWN must never be reported: `error_strategy.\n// max_retries` (flow and step level) and `quality_gate.max_retries` are live\n// grammar, and `billing.max_credits` is the enforced spend ceiling.\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE_UNKNOWN_YAML_KEY = 'unknown_yaml_key';\nconst KEY_BUDGET = 'budget';\nconst KEY_MAX_RETRIES = 'max_retries';\nconst REMOVED_IN = 'v2.721.0';\nconst KEY_BUDGET_MAX_PER_CHILD = 'budget_max_per_child';\nconst BUDGET_MAX_PER_CHILD_REMOVED_IN = 'v2.728.0';\n\nconst BUDGET_MAX_PER_CHILD_MESSAGE =\n `\\`campaign.budget_max_per_child\\` (USD) was removed from the grammar in AIgentFlow ` +\n `${BUDGET_MAX_PER_CHILD_REMOVED_IN} because it capped nothing, and AIgentFlow refuses to ` +\n 'save a flow that declares it.';\nconst BUDGET_MAX_PER_CHILD_SUGGESTION =\n 'Use `campaign.max_credits_per_child: N` (a whole number of credits) — it is checked ' +\n 'before each agentic turn of a child, and a spawn may lower it with `max_credits`.';\n\nconst BUDGET_MESSAGE =\n `The flow-level \\`budget:\\` key was removed from the grammar in AIgentFlow ${REMOVED_IN} ` +\n 'because nothing read it (it limited no spend), and AIgentFlow refuses to save a flow ' +\n 'that declares it.';\nconst BUDGET_SUGGESTION =\n 'Delete it. To cap spend use `billing: { max_credits: N }` — it caps the credit ' +\n 'reservation and refuses further agentic turns (agentic ai://, exons://, the ' +\n 'orchestrator); plain chat steps and flow:// sub-flows are not checked against it.';\n\nfunction maxRetriesMessage(owner: string): string {\n return (\n `\\`max_retries:\\` on ${owner} was removed from the grammar in AIgentFlow ${REMOVED_IN} ` +\n 'because the retry engine never read it, and AIgentFlow refuses to save a flow that ' +\n 'declares it.'\n );\n}\nconst MAX_RETRIES_SUGGESTION =\n 'Delete it. To retry a step write `error_strategy: { action: \"retry\", max_retries: N }` ' +\n 'on that step (or on the flow) — the same key one level down, which is the one that ' +\n 'works (N counts attempts, including the first).';\n\n/** Key PRESENCE, not value: the strict decoder refuses the key whatever it holds, `0` and `null` included. */\nfunction declares(record: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(record, key);\n}\n\nexport function validateRetiredKeys(flow: Flow, issues: Issues): void {\n const root = flow as Record<string, unknown>;\n\n if (declares(root, KEY_BUDGET)) {\n issues.error({\n field: KEY_BUDGET,\n message: BUDGET_MESSAGE,\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: BUDGET_SUGGESTION,\n });\n }\n\n if (declares(root, KEY_MAX_RETRIES)) {\n issues.error({\n field: KEY_MAX_RETRIES,\n message: maxRetriesMessage('the flow'),\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n }\n\n // AIF v2.728.0 (DC-FORGE-155): the campaign's per-child USD cap, replaced by\n // `max_credits_per_child`. Same mechanism as the keys above: the strict\n // decoder refuses it and `retiredGrammarKeys` attaches the advice.\n const campaign = root.campaign;\n if (isRecord(campaign) && declares(campaign, KEY_BUDGET_MAX_PER_CHILD)) {\n issues.error({\n field: `campaign.${KEY_BUDGET_MAX_PER_CHILD}`,\n message: BUDGET_MAX_PER_CHILD_MESSAGE,\n code: CODE_UNKNOWN_YAML_KEY,\n suggestion: BUDGET_MAX_PER_CHILD_SUGGESTION,\n });\n }\n\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const [stepID, rawStep] of Object.entries(steps)) {\n if (!isRecord(rawStep)) continue;\n if (declares(rawStep, KEY_MAX_RETRIES)) {\n issues.error({\n field: `steps.${stepID}.${KEY_MAX_RETRIES}`,\n message: maxRetriesMessage(`step '${stepID}'`),\n code: CODE_UNKNOWN_YAML_KEY,\n stepId: stepID,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n }\n\n // A loop sub-step's type in the reference never had a `max_retries` field,\n // so the strict decoder refuses it there too — and the reference's advice\n // table matches the key name, not the type, so it attaches this same\n // advice. Reported for \"would this save\" parity (see PARITY.md).\n const loop = rawStep.loop;\n if (!isRecord(loop) || !Array.isArray(loop.steps)) continue;\n loop.steps.forEach((sub: unknown, i: number) => {\n if (!isRecord(sub) || !declares(sub, KEY_MAX_RETRIES)) return;\n const subID = issues.stringOf(sub, 'id', `steps.${stepID}.loop.steps[${i}]`) ?? String(i);\n issues.error({\n field: `steps.${stepID}.loop.steps[${i}].${KEY_MAX_RETRIES}`,\n message: maxRetriesMessage(`loop sub-step '${stepID}.${subID}'`),\n code: CODE_UNKNOWN_YAML_KEY,\n stepId: `${stepID}.${subID}`,\n suggestion: MAX_RETRIES_SUGGESTION,\n });\n });\n }\n}\n","// `flow_data_key_reserved`: a key of the top-level `data:` map may not name\n// engine state.\n//\n// Port of the reference's `FlowDataKeyReservation` /\n// `validateFlowDataKeysAreNotReserved`. `data:` is seeded into the mission's\n// `.data` namespace before the first step, and that namespace is also where the\n// engine keeps its own bookkeeping (the current flow, taint lists, the\n// orchestrator's and campaign's state, the memory scope, the mission's\n// organization). A flow declaring one of those names writes into engine state\n// instead of authoring data, so the save door refuses it. ERROR, with no loop\n// demotion: a `data:` block has no loop-body twin.\n//\n// Matching is exact and case-sensitive over the spec (`flowDataReservedKeys`):\n// the `exact` names, then the `prefixes` in order. Keys that merely contain a\n// reserved word (`memory_notes`, `orgid`) are legal. Findings are sorted by key.\n// The reference's run door tolerates this code on stored flows; this validator\n// answers \"would this save\", so it is an ordinary error here.\n\nimport type { Flow } from '../types.js';\nimport { FLOW_DATA_RESERVED_KEYS } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst KEY_DATA = 'data';\n\n/** Go's `%q` for a plain string: double-quoted with the escapes JSON shares. */\nfunction quote(key: string): string {\n return JSON.stringify(key);\n}\n\n/** Why `key` names engine state, or undefined when it is an author's key. */\nexport function flowDataKeyReservation(key: string): string | undefined {\n if (Object.prototype.hasOwnProperty.call(FLOW_DATA_RESERVED_KEYS.exact, key)) {\n return FLOW_DATA_RESERVED_KEYS.exact[key];\n }\n for (const p of FLOW_DATA_RESERVED_KEYS.prefixes) {\n if (key.startsWith(p.prefix)) return p.reason;\n }\n return undefined;\n}\n\nexport function validateFlowDataKeys(flow: Flow, issues: Issues): void {\n const data = flow[KEY_DATA];\n if (!isRecord(data)) return;\n for (const key of Object.keys(data).sort()) {\n const reason = flowDataKeyReservation(key);\n if (reason === undefined) continue;\n issues.error({\n field: FLOW_DATA_RESERVED_KEYS.fieldFormat.replace('%s', () => key),\n message: FLOW_DATA_RESERVED_KEYS.messageFormat\n .replace('%s', () => quote(key))\n .replace('%s', () => reason),\n code: FLOW_DATA_RESERVED_KEYS.code,\n suggestion: FLOW_DATA_RESERVED_KEYS.suggestion,\n });\n }\n}\n","// Three save-door refusals from `FlowParser.ValidateFlow` (parser.go) that are\n// pure functions of the document: the `tool_discovery` vocabulary, the mock\n// scenario `delay`, and an empty `output:` entry.\n//\n// Every one is an ERROR, because the reference refuses the flow at save. Two of\n// them (tool_discovery, mock delay) are routed through the reference's\n// `refuseRetroactively`, so a flow stored before the rule existed is only\n// logged at the load door and still runs. This validator answers \"would this\n// save\", so it reports them as errors — the same choice as the executor-URL\n// shape rule (PARITY.md, divergence #10).\n\nimport type { Flow } from '../types.js';\nimport { Issues, isRecord, isString, parseGoDuration } from './util.js';\n\n/** The closed `tool_discovery` vocabulary (reference: IsValidDiscoveryMode). */\nconst TOOL_DISCOVERY_MODES: ReadonlySet<string> = new Set(['eager', 'lazy', 'off']);\nconst TEMPLATE_ACTION_OPEN = '{{';\nconst KEY_TOOL_DISCOVERY = 'tool_discovery';\n\nexport function validateSaveDoorExtras(flow: Flow, issues: Issues): void {\n validateToolDiscovery(flow, issues);\n validateMockScenarioDelays(flow, issues);\n validateOutputParameters(flow, issues);\n}\n\n// validateToolDiscovery mirrors validateToolDiscoveryVocabulary (AIF\n// DC-FORGE-48). The value decides TOOL EXPOSURE, and every consuming switch\n// treats an unknown value as `eager` — so `tool_discovery: of`, a typo for\n// `off`, injected every tool. An empty value means \"unset\" and a templated one\n// is rendered at run time; both are skipped.\n//\n// The flow root and the orchestrator carry a Go `string` field, which yaml.v3\n// fills from ANY scalar: `tool_discovery: 5` is the string \"5\" and is refused.\n// On a step the surface is a free-form `query` key, so only a YAML string is\n// judged there — a number or boolean is left to the executor.\nfunction validateToolDiscovery(flow: Flow, issues: Issues): void {\n const check = (value: string | null, field: string, stepId?: string): void => {\n if (value === null || value === '' || value.includes(TEMPLATE_ACTION_OPEN)) return;\n if (TOOL_DISCOVERY_MODES.has(value)) return;\n issues.error({\n field,\n message: `tool_discovery '${value}' is not a recognised mode`,\n code: 'tool_discovery_invalid',\n ...(stepId !== undefined ? { stepId } : {}),\n suggestion: `Use one of: ${[...TOOL_DISCOVERY_MODES].join(', ')}, or omit the key`,\n });\n };\n\n if (KEY_TOOL_DISCOVERY in flow) {\n check(issues.stringOf(flow, KEY_TOOL_DISCOVERY, ''), KEY_TOOL_DISCOVERY);\n }\n const orch: unknown = flow.orchestrator;\n if (isRecord(orch) && KEY_TOOL_DISCOVERY in orch) {\n check(\n issues.stringOf(orch, KEY_TOOL_DISCOVERY, 'orchestrator'),\n `orchestrator.${KEY_TOOL_DISCOVERY}`,\n );\n }\n if (!isRecord(flow.steps)) return;\n for (const [stepID, step] of Object.entries(flow.steps as Record<string, unknown>)) {\n if (!isRecord(step) || !isRecord(step.query)) continue;\n const value: unknown = step.query[KEY_TOOL_DISCOVERY];\n if (!isString(value)) continue;\n check(value, `steps.${stepID}.query.${KEY_TOOL_DISCOVERY}`, stepID);\n }\n}\n\n// validateMockScenarioDelays mirrors the reference rule of the same name (AIF\n// DC-FORGE-51). yaml.v3 decodes `delay: 100` into the string \"100\", which has\n// no unit; the live call site discarded the parse error and ran with NO delay.\n// The reference refuses anything `time.ParseDuration` rejects rather than\n// guessing a unit, so `100` is refused and `100ms` saves.\n//\n// Every scenario and every step key is checked, including a step id the flow\n// does not define — the reference walks the map, not the step table.\nfunction validateMockScenarioDelays(flow: Flow, issues: Issues): void {\n const scenarios: unknown = flow.mock_scenarios;\n if (!isRecord(scenarios)) return;\n for (const [scenario, steps] of Object.entries(scenarios)) {\n if (!isRecord(steps)) continue;\n for (const [stepID, mock] of Object.entries(steps)) {\n if (!isRecord(mock)) continue;\n const field = `mock_scenarios.${scenario}.${stepID}.delay`;\n // Judged by the SOURCE spelling: `delay: 0.0` is the text \"0.0\" to the\n // reference (no unit, refused) although it parses to the number 0.\n const delay = issues.stringAt(mock.delay, field);\n if (delay === null || delay === '') continue;\n if (parseGoDuration(delay) !== null) continue;\n issues.error({\n field,\n message: `mock delay '${delay}' in scenario '${scenario}' step '${stepID}' is not a Go duration`,\n code: 'mock_delay_invalid',\n suggestion: 'Write a unit, e.g. \"100ms\" or \"2s\"; a bare number would run with no delay',\n });\n }\n }\n}\n\n// validateOutputParameters mirrors the reference rule of the same name. Only\n// an empty STRING is refused: a YAML null entry (`- ` or `- ~`) is dropped by\n// yaml.v3 when it decodes the list, so it never reaches the check and the flow\n// saves (measured against the reference).\nfunction validateOutputParameters(flow: Flow, issues: Issues): void {\n const output: unknown = flow.output;\n if (!Array.isArray(output)) return;\n output.forEach((entry: unknown, i: number) => {\n if (entry !== '') return;\n issues.error({\n field: `output[${i}]`,\n message: `output entry ${i} is an empty string`,\n code: 'output_param_empty',\n suggestion: 'Name the output parameter, or remove the entry',\n });\n });\n}\n","// Generic unknown-key rejection and value-KIND checks, derived from the\n// reference's own types.\n//\n// The reference's save door (create / update / `POST /flows/validate` / the\n// Studio assistant) decodes a flow with yaml.v3 `KnownFields(true)`\n// (`NewStrictFlowParser`, parser.go). That refuses, at EVERY depth, a key that\n// the containing Go struct does not declare — a step-level `output:`, a typo\n// such as `excutor:`, an unknown key inside `next:`, `error_strategy:`, a mock\n// scenario step, a query parameter definition, an orchestrator trigger. It also\n// fails to decode a value of the wrong KIND: `next: end` (a scalar where a\n// mapping is required), a mapping where a string is required, a mapping where a\n// list is required. Both are \"would not save\", so both are errors here.\n//\n// The key sets are NOT hand-listed. `KNOWN_KEYS` is generated by reflection over\n// the reference's `Flow` type with yaml.v3's own field rules, and was checked\n// against the reference's strict parser for every type and every key (PARITY.md).\n//\n// What stays open, because the reference leaves it open: a Go `map` has\n// author-chosen keys (`steps`, `query` definitions, `mock_scenarios`,\n// `executor_config`), a Go interface (`any`) is never inspected (a step's\n// `query:`, `data:`, a mock's `content:`), and a pre/post-processing entry has\n// its own unmarshaller (divergence #11 keeps its shape out of scope).\n//\n// Scalars are judged only for KIND (not mapping, not list). Whether `5` fits an\n// int field or `abc` a bool is left to the rules that already own those fields\n// (divergence #8).\n\nimport type { Flow } from '../types.js';\nimport { KNOWN_KEYS } from '../spec/index.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE_UNKNOWN_YAML_KEY = 'unknown_yaml_key';\nconst CODE_INVALID_TYPE = 'invalid_type';\n\nconst SHAPE_SCALAR = 'scalar';\nconst SHAPE_ANY = 'any';\nconst MAP_PREFIX = 'map<';\nconst LIST_PREFIX = 'list<';\nconst SHAPE_SUFFIX = '>';\n\n/**\n * Keys the reference DELETED from the grammar (`retiredGrammarKeys`, parser.go).\n * Its refusal names them wherever they appear, because the advice table matches\n * the key NAME in the decoder's error, not the type. The specific locations with\n * full advice are reported by retiredKeys.ts; this only keeps the generic\n * message from calling a once-valid key a typo.\n */\nconst RETIRED_KEYS: ReadonlySet<string> = new Set([\n 'budget',\n 'budget_exceeded_policy',\n 'budget_max_per_child',\n 'binary_results',\n 'conversations',\n 'max_retries',\n 'message_templates',\n 'unique_items',\n]);\n\ntype Shape =\n | { kind: 'scalar' }\n | { kind: 'any' }\n | { kind: 'struct'; name: string }\n | { kind: 'map'; elem: Shape }\n | { kind: 'list'; elem: Shape };\n\nconst shapeCache = new Map<string, Shape>();\n\nfunction parseShape(text: string): Shape {\n const cached = shapeCache.get(text);\n if (cached) return cached;\n let shape: Shape;\n if (text === SHAPE_SCALAR) shape = { kind: 'scalar' };\n else if (text === SHAPE_ANY) shape = { kind: 'any' };\n else if (text.startsWith(MAP_PREFIX) && text.endsWith(SHAPE_SUFFIX)) {\n shape = { kind: 'map', elem: parseShape(text.slice(MAP_PREFIX.length, -1)) };\n } else if (text.startsWith(LIST_PREFIX) && text.endsWith(SHAPE_SUFFIX)) {\n shape = { kind: 'list', elem: parseShape(text.slice(LIST_PREFIX.length, -1)) };\n } else if (Object.prototype.hasOwnProperty.call(KNOWN_KEYS.types, text)) {\n shape = { kind: 'struct', name: text };\n } else {\n // A spec defect, not a document defect: fail open rather than accuse every\n // flow. The spec test asserts every shape resolves, so this is unreachable\n // from a shipped build.\n shape = { kind: 'any' };\n }\n shapeCache.set(text, shape);\n return shape;\n}\n\nfunction child(path: string, key: string): string {\n return path === '' ? key : `${path}.${key}`;\n}\n\n/** The step id a finding under `steps.<id>` belongs to, for the summary count. */\nfunction stepIdOf(path: string): string | undefined {\n if (!path.startsWith('steps.')) return undefined;\n const rest = path.slice('steps.'.length);\n const end = rest.search(/[.[]/);\n return end === -1 ? rest : rest.slice(0, end);\n}\n\nfunction kindName(value: unknown): string {\n if (Array.isArray(value)) return 'a list';\n if (isRecord(value)) return 'a mapping';\n return 'a scalar';\n}\n\nexport function validateUnknownKeys(flow: Flow, issues: Issues): void {\n // Locations another rule already reported (with more specific advice) are not\n // reported twice: the retired keys and a condition's `goto_step`.\n const reported = new Set(\n issues.errors\n .filter((e) => e.code === CODE_UNKNOWN_YAML_KEY || e.code === CODE_INVALID_TYPE)\n .map((e) => `${e.code}\\u0000${e.field}`),\n );\n\n const report = (code: string, field: string, message: string, suggestion?: string): void => {\n const id = `${code}\\u0000${field}`;\n if (reported.has(id)) return;\n reported.add(id);\n const stepId = stepIdOf(field);\n issues.error({\n field,\n message,\n code,\n ...(stepId !== undefined ? { stepId } : {}),\n ...(suggestion !== undefined ? { suggestion } : {}),\n });\n };\n\n const walk = (value: unknown, shape: Shape, path: string): void => {\n // A YAML null decodes to the zero value of any Go type.\n if (value === null || value === undefined) return;\n\n switch (shape.kind) {\n case 'any':\n return;\n case 'scalar':\n if (isRecord(value) || Array.isArray(value)) {\n report(\n CODE_INVALID_TYPE,\n path,\n `'${path}' must be a single value, not ${kindName(value)}`,\n );\n }\n return;\n case 'list':\n if (!Array.isArray(value)) {\n report(CODE_INVALID_TYPE, path, `'${path}' must be a list, not ${kindName(value)}`);\n return;\n }\n value.forEach((item: unknown, i: number) => walk(item, shape.elem, `${path}[${i}]`));\n return;\n case 'map':\n if (!isRecord(value)) {\n report(CODE_INVALID_TYPE, path, `'${path}' must be a mapping, not ${kindName(value)}`);\n return;\n }\n for (const [key, item] of Object.entries(value)) walk(item, shape.elem, child(path, key));\n return;\n case 'struct': {\n if (!isRecord(value)) {\n report(\n CODE_INVALID_TYPE,\n path,\n `'${path === '' ? 'the flow' : path}' must be a mapping, not ${kindName(value)}`,\n );\n return;\n }\n const keys = KNOWN_KEYS.types[shape.name] ?? {};\n for (const [key, item] of Object.entries(value)) {\n const field = child(path, key);\n const declared = keys[key];\n if (declared === undefined) {\n const retired = RETIRED_KEYS.has(key)\n ? ' It was removed from the grammar and AIgentFlow refuses to save a flow that still declares it.'\n : '';\n report(\n CODE_UNKNOWN_YAML_KEY,\n field,\n `Unknown key '${key}'${path === '' ? ' at the top level' : ` in '${path}'`}.` +\n ` AIgentFlow refuses to save a flow with a key its grammar does not declare, because the key would be silently dropped.${retired}`,\n `Known keys here: ${Object.keys(keys).sort().join(', ')}`,\n );\n continue;\n }\n walk(item, parseShape(declared), field);\n }\n return;\n }\n }\n };\n\n walk(flow, { kind: 'struct', name: KNOWN_KEYS.root }, '');\n}\n\n/** Every shape string in the spec, for the spec self-test. */\nexport function unresolvedKnownKeyShapes(): string[] {\n const bad: string[] = [];\n const check = (text: string): boolean => {\n if (text === SHAPE_SCALAR || text === SHAPE_ANY) return true;\n if (text.startsWith(MAP_PREFIX) && text.endsWith(SHAPE_SUFFIX))\n return check(text.slice(MAP_PREFIX.length, -1));\n if (text.startsWith(LIST_PREFIX) && text.endsWith(SHAPE_SUFFIX))\n return check(text.slice(LIST_PREFIX.length, -1));\n return Object.prototype.hasOwnProperty.call(KNOWN_KEYS.types, text);\n };\n if (!check(KNOWN_KEYS.root)) bad.push(KNOWN_KEYS.root);\n for (const [typeName, keys] of Object.entries(KNOWN_KEYS.types)) {\n for (const [key, text] of Object.entries(keys)) {\n if (!check(text)) bad.push(`${typeName}.${key}: ${text}`);\n }\n }\n return bad;\n}\n","// `executor_config_env_scope`: an `executor_config:` value may name only the\n// environment variables of the key it is written under.\n//\n// Port of the reference's `ValidateExecutorConfigEnvScopes` (AIgentFlow\n// v2.597.0), which the save door applies to the whole block. `executor_config`\n// is author-written, so without it an author could point `base_url` at their\n// own endpoint and have the server expand a secret that belongs to another\n// provider into `api_key`.\n//\n// The checked values are the three Go-`string` fields (`api_key`, `base_url`,\n// `organization`), read by SOURCE TEXT like every string field, and every YAML\n// STRING in `extra` (the reference type-asserts `.(string)` on an `any`, so a\n// number there is never a reference). A value is a reference when it is exactly\n// `${NAME}` with NAME non-empty; `${A}${B}` is the single name `A}${B` and is\n// refused unless a scope names it, as in the reference.\n//\n// The scopes are the reference's scope function evaluated for every key that\n// has one (spec `executorConfigEnvScopes.scopes`). Any other key has an EMPTY\n// scope and refuses every reference: the reference reads those values raw, so a\n// `${...}` there would be sent verbatim as a credential.\n//\n// The reference stops at the first violation (a parse-door refusal); this\n// validator reports each one. The verdict is the same.\n\nimport type { Flow } from '../types.js';\nimport { EXECUTOR_CONFIG_ENV_SCOPES } from '../spec/index.js';\nimport { Issues, isRecord, isString } from './util.js';\n\nconst KEY_EXECUTOR_CONFIG = 'executor_config';\nconst CODE = 'executor_config_env_scope';\nconst NO_SCOPE: readonly string[] = [];\n\nexport function validateExecutorConfigEnvScopes(flow: Flow, issues: Issues): void {\n const config: unknown = flow[KEY_EXECUTOR_CONFIG];\n if (!isRecord(config)) return;\n const { fields, extraKey, scopes } = EXECUTOR_CONFIG_ENV_SCOPES;\n\n for (const configKey of Object.keys(config).sort()) {\n const instance = config[configKey];\n // null is skipped by the reference; any other non-mapping is an\n // `invalid_type` from the unknown-keys rule.\n if (!isRecord(instance)) continue;\n const base = `${KEY_EXECUTOR_CONFIG}.${configKey}`;\n // Own properties only: `constructor` or `toString` is an ordinary key with\n // an empty scope, not a lookup into Object.prototype.\n const scope = Object.prototype.hasOwnProperty.call(scopes, configKey)\n ? (scopes[configKey] ?? NO_SCOPE)\n : NO_SCOPE;\n\n for (const field of fields) {\n const value = issues.stringOf(instance, field, base);\n if (value === null) continue;\n checkReference(issues, `${base}.${field}`, configKey, field, value, scope);\n }\n const extra = instance[extraKey];\n if (!isRecord(extra)) continue;\n for (const extraName of Object.keys(extra).sort()) {\n const value = extra[extraName];\n if (!isString(value)) continue;\n checkReference(\n issues,\n `${base}.${extraKey}.${extraName}`,\n configKey,\n `${extraKey}.${extraName}`,\n value,\n scope,\n );\n }\n }\n}\n\nfunction checkReference(\n issues: Issues,\n field: string,\n configKey: string,\n fieldName: string,\n value: string,\n scope: readonly string[],\n): void {\n const name = envReferenceName(value);\n if (name === null || scope.includes(name)) return;\n const permitted =\n scope.length > 0 ? scope.join(', ') : '(none: this key expands no environment variables)';\n issues.error({\n field,\n code: CODE,\n message:\n `executor_config key '${configKey}' sets ${fieldName} to environment variable '${name}', ` +\n 'which it may not expand; a flow may only expand the variables belonging to the provider ' +\n `or protocol it writes them under. Permitted here: ${permitted}`,\n suggestion:\n 'To use an organisation secret, bind a stored credential on the step instead: ' +\n 'credentials: {<name>: {source: \"stored/<provider>/<credential>\", inject_as: \"api_key\"}}',\n });\n}\n\n/** The reference's isAuthorEnvReference: exactly `${NAME}`, NAME non-empty. */\nexport function envReferenceName(value: string): string | null {\n const { referencePrefix: prefix, referenceSuffix: suffix } = EXECUTOR_CONFIG_ENV_SCOPES;\n if (\n value.length < prefix.length + suffix.length ||\n !value.startsWith(prefix) ||\n !value.endsWith(suffix)\n ) {\n return null;\n }\n const name = value.slice(prefix.length, value.length - suffix.length);\n return name === '' ? null : name;\n}\n","// `server_owned_query_key`: a step's `query:`, or a loop sub-step's `query:`,\n// may not declare an executor parameter only the server sets.\n//\n// Port of the reference's `validateNoServerOwnedStepQueryKeys` /\n// `IsServerOwnedParamKey` (AIgentFlow CFX-05). The `aiv://` executor sends the\n// running org's aigentverse credential, or a signed token naming the running\n// person, to the base URL in its parameters, and the reference used to lay a\n// step's query over the credential resolver's output — so a shared flow\n// declaring `aiv_base_url: https://attacker.example` chose where that\n// credential went. The engine now discards such a value at run time; this is\n// the named refusal at save. ERROR: no legitimate flow sets these keys.\n//\n// Matching is exact and case-sensitive, over the key set in the spec\n// (`serverOwnedQueryKeys.keys`). Exactly the reference's two surfaces are\n// scanned: a top-level step's `query:` and a loop sub-step's `query:`. A\n// parallel branch or a for_each body is a top-level step. Any value is refused,\n// null and templates included.\n//\n// A loop sub-step is addressed by its id as written (source text, like every\n// Go-string field). A sub-step without an id is addressed by the empty string,\n// the reference's format with its zero value; the reference itself refuses the\n// missing id at parse (`loop_step_id_required` here), so the verdict is the same.\n\nimport type { Flow } from '../types.js';\nimport { SERVER_OWNED_QUERY_KEYS } from '../spec/index.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE = 'server_owned_query_key';\nconst KEY_QUERY = 'query';\nconst KEY_ID = 'id';\nconst SERVER_OWNED: ReadonlySet<string> = new Set(SERVER_OWNED_QUERY_KEYS.keys);\n\n/** Go's `fmt.Sprintf` for the `%s`-only field formats in the spec. */\nfunction formatField(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%s/g, () => args[i++] ?? '');\n}\n\nexport function validateServerOwnedQueryKeys(flow: Flow, issues: Issues): void {\n const steps = flow.steps;\n if (!isRecord(steps)) return;\n for (const stepID of Object.keys(steps).sort()) {\n const step = steps[stepID];\n if (!isRecord(step)) continue;\n const query = (step as Record<string, unknown>)[KEY_QUERY];\n if (isRecord(query)) {\n for (const key of Object.keys(query).sort()) {\n if (!SERVER_OWNED.has(key)) continue;\n refuse(\n issues,\n stepID,\n key,\n formatField(SERVER_OWNED_QUERY_KEYS.stepFieldFormat, stepID, key),\n );\n }\n }\n for (const sub of loopSubStepsOfStep(stepID, step)) {\n const subQuery = sub.raw[KEY_QUERY];\n if (!isRecord(subQuery)) continue;\n const subID = issues.stringOf(sub.raw, KEY_ID, sub.basePath) ?? '';\n for (const key of Object.keys(subQuery).sort()) {\n if (!SERVER_OWNED.has(key)) continue;\n refuse(\n issues,\n stepID,\n key,\n formatField(SERVER_OWNED_QUERY_KEYS.loopStepFieldFormat, stepID, subID, key),\n );\n }\n }\n }\n}\n\nfunction refuse(issues: Issues, stepId: string, key: string, field: string): void {\n issues.error({\n field,\n message: `query key '${key}' on step '${stepId}' is set by the server only (it carries the aigentverse credential and where it is sent), so a flow may not declare it`,\n code: CODE,\n stepId,\n suggestion:\n \"Remove it: the running org's aigentverse connection, or the signed-in person, is used automatically\",\n });\n}\n","// The origin reduction `credential_endpoint_unpaired` compares endpoints by,\n// ported from the reference (`credentialEndpointOrigin`), which is Go's\n// `net/url.Parse` (Go 1.25) plus `strings.TrimSpace` / `strings.ToLower`. The\n// rule only ever asks \"is this endpoint the family's DEFAULT origin?\", so the\n// port has to agree with Go on exactly two things: which strings Go refuses\n// (a refused string is compared as text, and can never equal a default), and\n// the scheme and host Go extracts from the rest.\n//\n// Not ported, verdict-neutral: Go validates a bracketed IPv6 literal with\n// `netip.ParseAddr`. A bracketed host is never a default's host, parsed or\n// refused, so the answer to the one question asked is the same.\n\n/** Go's `unicode.IsSpace` set, which `strings.TrimSpace` trims (not JS `trim`: Go keeps U+FEFF and trims U+0085). */\nconst GO_SPACE =\n '\\\\t\\\\n\\\\v\\\\f\\\\r \\\\u0085\\\\u00A0\\\\u1680\\\\u2000-\\\\u200A\\\\u2028\\\\u2029\\\\u202F\\\\u205F\\\\u3000';\nconst GO_TRIM_SPACE_RE = new RegExp(`^[${GO_SPACE}]+|[${GO_SPACE}]+$`, 'g');\n\n/** Go's `strings.TrimSpace`. */\nexport function goTrimSpace(s: string): string {\n return s.replace(GO_TRIM_SPACE_RE, '');\n}\n\n/**\n * Go's `strings.ToLower`: SIMPLE case mapping, one code point at a time. JS\n * `toLowerCase` applies SpecialCasing, which turns U+0130 into two code points\n * (Go: `i`) and a final sigma into U+03C2 (Go: U+03C3).\n */\nexport function goToLower(s: string): string {\n let out = '';\n for (const ch of s) {\n out += ch === '\\u0130' ? 'i' : ch.toLowerCase();\n }\n return out;\n}\n\n/** Go's `encoding` modes, the ones `parse` uses. */\nconst Mode = {\n Path: 1,\n Host: 2,\n Zone: 3,\n UserPassword: 4,\n Fragment: 5,\n} as const;\ntype EncodeMode = (typeof Mode)[keyof typeof Mode];\n\nfunction isAlnum(c: number): boolean {\n return (c >= 0x61 && c <= 0x7a) || (c >= 0x41 && c <= 0x5a) || (c >= 0x30 && c <= 0x39);\n}\n\nfunction isHex(c: number | undefined): boolean {\n return (\n c !== undefined &&\n ((c >= 0x30 && c <= 0x39) || (c >= 0x61 && c <= 0x66) || (c >= 0x41 && c <= 0x46))\n );\n}\n\nfunction unhex(c: number): number {\n if (c >= 0x30 && c <= 0x39) return c - 0x30;\n if (c >= 0x61 && c <= 0x66) return c - 0x61 + 10;\n return c - 0x41 + 10;\n}\n\n/** Go's `shouldEscape` for the modes `parse` uses. */\nfunction shouldEscape(c: number, mode: EncodeMode): boolean {\n if (isAlnum(c)) return false;\n const ch = String.fromCharCode(c);\n if ((mode === Mode.Host || mode === Mode.Zone) && `!$&'()*+,;=:[]<>\"`.includes(ch)) return false;\n if ('-_.~'.includes(ch)) return false;\n if ('$&+,/:;=?@'.includes(ch)) {\n switch (mode) {\n case Mode.Path:\n return ch === '?';\n case Mode.UserPassword:\n return ch === '@' || ch === '/' || ch === '?' || ch === ':';\n case Mode.Fragment:\n return false;\n default:\n break;\n }\n }\n if (mode === Mode.Fragment && '!()*'.includes(ch)) return false;\n return true;\n}\n\n/** Go's `unescape` over UTF-8 bytes: the decoded bytes, or null where Go returns an error. */\nfunction unescape(s: Uint8Array, mode: EncodeMode): Uint8Array | null {\n const out: number[] = [];\n for (let i = 0; i < s.length; ) {\n const c = s[i] as number;\n if (c === 0x25 /* % */) {\n const h1 = s[i + 1];\n const h2 = s[i + 2];\n if (i + 2 >= s.length || !isHex(h1) || !isHex(h2)) return null;\n const hi = unhex(h1 as number);\n const lo = unhex(h2 as number);\n const isPct25 = hi === 2 && lo === 5;\n if (mode === Mode.Host && hi < 8 && !isPct25) return null;\n if (mode === Mode.Zone) {\n const v = (hi << 4) | lo;\n if (!isPct25 && v !== 0x20 && shouldEscape(v, Mode.Host)) return null;\n }\n out.push((hi << 4) | lo);\n i += 3;\n continue;\n }\n if ((mode === Mode.Host || mode === Mode.Zone) && c < 0x80 && shouldEscape(c, mode)) {\n return null;\n }\n out.push(c);\n i++;\n }\n return Uint8Array.from(out);\n}\n\nconst utf8Encoder = new TextEncoder();\nconst utf8Decoder = new TextDecoder('utf-8');\n\nfunction unescapeText(s: string, mode: EncodeMode): string | null {\n const bytes = unescape(utf8Encoder.encode(s), mode);\n return bytes === null ? null : utf8Decoder.decode(bytes);\n}\n\n/** Go's `validOptionalPort`: \"\" or `:` followed by digits only. */\nfunction validOptionalPort(port: string): boolean {\n if (port === '') return true;\n if (port[0] !== ':') return false;\n return /^[0-9]*$/.test(port.slice(1));\n}\n\n/** Go's `validUserinfo`. */\nfunction validUserinfo(s: string): boolean {\n for (const ch of s) {\n const c = ch.codePointAt(0) as number;\n if (c < 0x80 && isAlnum(c)) continue;\n if (`-._:~!$&'()*+,;=%@`.includes(ch)) continue;\n return false;\n }\n return true;\n}\n\n/** Go's `parseHost`: the unescaped host (with port), or null on error. */\nfunction parseHost(host: string): string | null {\n const open = host.lastIndexOf('[');\n if (open !== -1) {\n const close = host.lastIndexOf(']');\n if (close < 0) return null;\n const colonPort = host.slice(close + 1);\n if (!validOptionalPort(colonPort)) return null;\n const port = unescapeText(colonPort, Mode.Host);\n if (port === null) return null;\n const hostname = host.slice(open + 1, close);\n const zone = hostname.indexOf('%25');\n let name: string | null;\n if (zone >= 0) {\n const hostPart = unescapeText(hostname.slice(0, zone), Mode.Host);\n const zonePart = unescapeText(hostname.slice(zone), Mode.Zone);\n name = hostPart === null || zonePart === null ? null : hostPart + zonePart;\n } else {\n name = unescapeText(hostname, Mode.Host);\n }\n if (name === null) return null;\n return `[${name}]${port}`;\n }\n const colon = host.lastIndexOf(':');\n if (colon !== -1 && !validOptionalPort(host.slice(colon))) return null;\n return unescapeText(host, Mode.Host);\n}\n\n/** Go's `parseAuthority`: the host, and whether the authority carries userinfo (`u.User != nil`). */\nfunction parseAuthority(authority: string): { host: string; hasUser: boolean } | null {\n const at = authority.lastIndexOf('@');\n const host = parseHost(at < 0 ? authority : authority.slice(at + 1));\n if (host === null) return null;\n if (at < 0) return { host, hasUser: false };\n const userinfo = authority.slice(0, at);\n if (!validUserinfo(userinfo)) return null;\n const colon = userinfo.indexOf(':');\n const parts = colon < 0 ? [userinfo] : [userinfo.slice(0, colon), userinfo.slice(colon + 1)];\n for (const part of parts) {\n if (unescapeText(part, Mode.UserPassword) === null) return null;\n }\n return { host, hasUser: true };\n}\n\n/** Go's `getScheme`: null for \"missing protocol scheme\". */\nfunction getScheme(raw: string): { scheme: string; rest: string } | null {\n for (let i = 0; i < raw.length; i++) {\n const c = raw.charCodeAt(i);\n if ((c >= 0x61 && c <= 0x7a) || (c >= 0x41 && c <= 0x5a)) continue;\n if ((c >= 0x30 && c <= 0x39) || c === 0x2b || c === 0x2d || c === 0x2e) {\n if (i === 0) return { scheme: '', rest: raw };\n continue;\n }\n if (c === 0x3a /* : */) {\n if (i === 0) return null;\n return { scheme: raw.slice(0, i), rest: raw.slice(i + 1) };\n }\n return { scheme: '', rest: raw };\n }\n return { scheme: '', rest: raw };\n}\n\nfunction containsCTL(s: string): boolean {\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n if (c < 0x20 || c === 0x7f) return true;\n }\n return false;\n}\n\n/** What {@link goParseURLParts} extracts from a URL Go accepts. */\nexport interface GoURLParts {\n scheme: string;\n /** `u.Host`: the host with its port, after any userinfo. */\n host: string;\n /** `u.User != nil`: an `@` in the authority, even an empty userinfo. */\n hasUser: boolean;\n /** `u.RawQuery`: the text after the first `?`. */\n rawQuery: string;\n /** `u.Fragment`, still escaped (callers judge only its emptiness). */\n fragment: string;\n}\n\n/**\n * Go's `url.Parse`, reduced to what it yields for `Scheme` and `Host`; null\n * where Go returns an error.\n */\nexport function goParseSchemeHost(rawURL: string): { scheme: string; host: string } | null {\n const u = goParseURLParts(rawURL);\n return u === null ? null : { scheme: u.scheme, host: u.host };\n}\n\n/**\n * Go's `url.Parse`, reduced to the parts the `examples:` file-reference rule\n * reads (scheme, host, userinfo presence, query, fragment); null where Go\n * returns an error.\n */\nexport function goParseURLParts(rawURL: string): GoURLParts | null {\n const hash = rawURL.indexOf('#');\n const main = hash < 0 ? rawURL : rawURL.slice(0, hash);\n const frag = hash < 0 ? '' : rawURL.slice(hash + 1);\n\n if (containsCTL(main)) return null;\n if (main === '*') {\n return { scheme: '', host: '', hasUser: false, rawQuery: '', fragment: frag };\n }\n const split = getScheme(main);\n if (split === null) return null;\n const scheme = split.scheme.toLowerCase(); // ASCII by construction\n let rest = split.rest;\n const questionMarks = rest.split('?').length - 1;\n let rawQuery = '';\n if (rest.endsWith('?') && questionMarks === 1) {\n rest = rest.slice(0, -1);\n } else if (questionMarks > 0) {\n rawQuery = rest.slice(rest.indexOf('?') + 1);\n rest = rest.slice(0, rest.indexOf('?'));\n }\n\n if (!rest.startsWith('/')) {\n if (scheme !== '') return finish({ scheme, host: '', hasUser: false, rawQuery }, frag); // opaque\n const slash = rest.indexOf('/');\n const segment = slash < 0 ? rest : rest.slice(0, slash);\n if (segment.includes(':')) return null;\n }\n\n let host = '';\n let hasUser = false;\n if ((scheme !== '' || !rest.startsWith('///')) && rest.startsWith('//')) {\n let authority = rest.slice(2);\n rest = '';\n const slash = authority.indexOf('/');\n if (slash >= 0) {\n rest = authority.slice(slash);\n authority = authority.slice(0, slash);\n }\n const parsed = parseAuthority(authority);\n if (parsed === null) return null;\n host = parsed.host;\n hasUser = parsed.hasUser;\n }\n if (unescapeText(rest, Mode.Path) === null) return null;\n return finish({ scheme, host, hasUser, rawQuery }, frag);\n}\n\nfunction finish(u: Omit<GoURLParts, 'fragment'>, frag: string): GoURLParts | null {\n if (frag !== '' && unescapeText(frag, Mode.Fragment) === null) return null;\n return { ...u, fragment: frag };\n}\n\n/**\n * The KEYS of Go's `url.Values` for a raw query (`u.Query()`): pairs split on\n * `&`, a pair containing `;` skipped, a key that does not unescape skipped,\n * `+` read as a space.\n */\nexport function goQueryKeys(rawQuery: string): string[] {\n const keys: string[] = [];\n for (const pair of rawQuery.split('&')) {\n if (pair === '' || pair.includes(';')) continue;\n const eq = pair.indexOf('=');\n const rawKey = eq < 0 ? pair : pair.slice(0, eq);\n const key = unescapeText(rawKey.replace(/\\+/g, ' '), Mode.Path);\n if (key !== null) keys.push(key);\n }\n return keys;\n}\n\n/**\n * The reference's `credentialEndpointOrigin`: lower-cased `scheme://host:port`\n * with the scheme's default port filled; a value Go does not parse, or with no\n * scheme or no host, is its trimmed, lower-cased self without trailing slashes.\n */\nexport function goEndpointOrigin(\n raw: string,\n defaultPorts: Readonly<Record<string, string>>,\n protocolSeparator: string,\n): string {\n const trimmed = goTrimSpace(raw);\n const u = goParseSchemeHost(trimmed);\n if (u === null || u.scheme === '' || u.host === '') {\n return goToLower(trimmed.replace(/\\/+$/, ''));\n }\n const scheme = goToLower(u.scheme);\n let host = goToLower(u.host);\n const lastColon = host.lastIndexOf(':');\n if (lastColon < 0 || lastColon <= host.lastIndexOf(']')) {\n if (Object.prototype.hasOwnProperty.call(defaultPorts, scheme)) {\n host += `:${defaultPorts[scheme]}`;\n }\n }\n return scheme + protocolSeparator + host;\n}\n","// `credential_endpoint_unpaired` (WARNING): a step names an endpoint its\n// credential will never be sent to.\n//\n// Port of the reference's `validateCredentialEndpointPairing` (AIgentFlow\n// DC-FORGE-231) and `validateFamilyCredentialEndpointPairing` (DC-FORGE-233),\n// together with the Go port (go-aigentflow-validator v0.6.2).\n//\n// AIgentFlow sends a credential the SERVER supplied (an org's or the\n// platform's stored key, or a value of one of the deployment's environment\n// variables) only to the endpoint that came with it: the default, the stored\n// credential's own base URL, or a deployment-configured one. An endpoint the\n// flow names is honoured only with a credential the flow supplies. That\n// run-time refusal is the control; this is the save-time warning about the\n// shapes that are statically certain to meet it. A warning, never an error: a\n// run may still bring its own key, and a warning never changes the verdict.\n//\n// Two arms, over the same steps (a top-level step and a loop sub-step):\n//\n// - ai:// — a step's `<provider>_base_url` with no key of the flow's own\n// (the step query's `api_key` / `<provider>_api_key`, or a literal\n// `executor_config.<provider>.api_key`), and a literal\n// `executor_config.<provider>.base_url` for an AI provider with no literal\n// key beside it, unless at least one step uses the provider and every such\n// step brings its own key. ollama and vllm are exempt.\n// - the families in the spec's table — a secret that is `${NAME}` for one of\n// the family's server variables (on a family whose plugin expands\n// references) beside an endpoint that is certainly the author's: not\n// templated, not a reference, not the family's default origin. A family\n// with an implicit service credential is not judged.\n//\n// Values are read as the reference reads them: a step `query:` and an `extra:`\n// block are Go `any` there, so only a YAML string counts; `api_key` and\n// `base_url` under `executor_config.<key>` are Go `string` fields, read by\n// source text. Two JS-only approximations, both looser (PARITY.md): an\n// endpoint shaped like a YAML timestamp is not read as a string (yaml.v3\n// decodes a PLAIN one into `time.Time`), and a `!!binary` value is not one.\n\nimport type { Flow } from '../types.js';\nimport {\n CREDENTIAL_ENDPOINT_PAIRING as CFG,\n TEMPLATE_ACTION_OPEN,\n EXECUTOR_CONFIG_ENV_SCOPES,\n} from '../spec/index.js';\nimport type { CredentialEndpointFamily } from '../spec/index.js';\nimport { envReferenceName } from './executorConfigEnv.js';\nimport { goEndpointOrigin } from './goUrl.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isRecord } from './util.js';\n\nconst CODE = 'credential_endpoint_unpaired';\nconst KEY_EXECUTOR_CONFIG = 'executor_config';\nconst KEY_EXECUTOR = 'executor';\nconst KEY_QUERY = 'query';\nconst KEY_ID = 'id';\n\ntype Rec = Record<string, unknown>;\n\n/**\n * A string yaml.v3 may have decoded into `time.Time` from a plain scalar\n * (its `parseTimestamp` formats, over-approximated: no range checks). Only\n * consulted where reading a value as a string can ADD a warning.\n */\nconst YAML_TIMESTAMP_LIKE =\n /^\\d{4}-\\d{1,2}-\\d{1,2}(?:[Tt]\\d{1,2}:\\d{1,2}:\\d{1,2}(?:[.,]\\d+)?(?:Z|[+-]\\d{2}:\\d{2})| \\d{1,2}:\\d{1,2}:\\d{1,2}(?:[.,]\\d+)?)?$/;\n\n/** An own property of a plain object (never one of Object.prototype's). */\nfunction own(m: unknown, key: string): unknown {\n if (!isRecord(m) || !Object.prototype.hasOwnProperty.call(m, key)) return undefined;\n return m[key];\n}\n\n/** Go's `fmt.Sprintf` for the `%s`-only field formats in the spec. */\nfunction formatField(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%s/g, () => args[i++] ?? '');\n}\n\n/** The reference's `query[key].(string)`, non-empty. */\nfunction nonEmptyString(m: unknown, key: string): string | null {\n const v = own(m, key);\n return typeof v === 'string' && v !== '' ? v : null;\n}\n\n/** {@link nonEmptyString} for an ENDPOINT: a timestamp-shaped value is not a string there. */\nfunction nonEmptyEndpoint(m: unknown, key: string): string | null {\n const v = nonEmptyString(m, key);\n return v === null || YAML_TIMESTAMP_LIKE.test(v) ? null : v;\n}\n\ninterface CredStep {\n executor: string;\n query: unknown;\n field: (key: string) => string;\n}\n\nfunction credentialEndpointSteps(flow: Flow, issues: Issues): CredStep[] {\n const steps = flow.steps;\n if (!isRecord(steps)) return [];\n const out: CredStep[] = [];\n for (const stepId of Object.keys(steps).sort()) {\n const step = steps[stepId];\n if (!isRecord(step)) continue;\n out.push({\n executor: issues.stringOf(step, KEY_EXECUTOR, `steps.${stepId}`) ?? '',\n query: own(step, KEY_QUERY),\n field: (key) => formatField(CFG.stepFieldFormat, stepId, key),\n });\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n const subId = issues.stringOf(sub.raw, KEY_ID, sub.basePath) ?? '';\n out.push({\n executor: issues.stringOf(sub.raw, KEY_EXECUTOR, sub.basePath) ?? '',\n query: own(sub.raw, KEY_QUERY),\n field: (key) => formatField(CFG.loopStepFieldFormat, stepId, subId, key),\n });\n }\n }\n return out;\n}\n\nfunction configInstance(flow: Flow, key: string): Rec | null {\n const inst = own(own(flow, KEY_EXECUTOR_CONFIG), key);\n return isRecord(inst) ? inst : null;\n}\n\n/** A Go-`string` field of an executor_config instance, by source text; \"\" when absent or null. */\nfunction configStringField(inst: Rec, configKey: string, field: string, issues: Issues): string {\n return issues.stringOf(inst, field, `${KEY_EXECUTOR_CONFIG}.${configKey}`) ?? '';\n}\n\nexport function validateCredentialEndpointPairing(flow: Flow, issues: Issues): void {\n const steps = credentialEndpointSteps(flow, issues);\n validateAI(flow, steps, issues);\n validateFamilies(flow, steps, issues);\n}\n\n// --- ai:// -----------------------------------------------------------------\n\nfunction aiStepProvider(executor: string): string {\n const prefix = CFG.ai.protocol + CFG.protocolSeparator;\n if (!executor.startsWith(prefix)) return '';\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n return slash < 0 ? rest : rest.slice(0, slash);\n}\n\nfunction aiQueryHasOwnKey(query: unknown, provider: string): boolean {\n return [CFG.ai.genericKeyParam, provider + CFG.ai.providerKeyParamSuffix].some(\n (key) => nonEmptyString(query, key) !== null,\n );\n}\n\nfunction aiConfigHasOwnKey(flow: Flow, provider: string, issues: Issues): boolean {\n const inst = configInstance(flow, provider);\n if (inst === null) return false;\n const key = configStringField(inst, provider, CFG.executorConfigApiKeyField, issues);\n return key !== '' && envReferenceName(key) === null;\n}\n\nfunction validateAI(flow: Flow, steps: CredStep[], issues: Issues): void {\n const keyless = new Set(CFG.ai.keylessProviders);\n const stepsUsing = new Map<string, number>();\n const stepsWithoutOwnKey = new Map<string, number>();\n for (const step of steps) {\n const provider = aiStepProvider(step.executor);\n if (provider === '' || keyless.has(provider)) continue;\n stepsUsing.set(provider, (stepsUsing.get(provider) ?? 0) + 1);\n const queryOwn = aiQueryHasOwnKey(step.query, provider);\n if (!queryOwn) stepsWithoutOwnKey.set(provider, (stepsWithoutOwnKey.get(provider) ?? 0) + 1);\n const urlKey = provider + CFG.ai.providerBaseUrlParamSuffix;\n if (\n nonEmptyEndpoint(step.query, urlKey) !== null &&\n !queryOwn &&\n !aiConfigHasOwnKey(flow, provider, issues)\n ) {\n warnStoredShape(issues, step.field(urlKey), provider);\n }\n }\n\n const config = own(flow, KEY_EXECUTOR_CONFIG);\n if (!isRecord(config)) return;\n const providers = new Set(CFG.ai.executorConfigProviders);\n for (const provider of Object.keys(config).sort()) {\n const inst = own(config, provider);\n if (!isRecord(inst) || !providers.has(provider) || keyless.has(provider)) continue;\n const baseUrl = configStringField(inst, provider, CFG.executorConfigBaseUrlField, issues);\n if (baseUrl === '') continue;\n if (envReferenceName(baseUrl) !== null) continue; // the deployment's endpoint\n if (aiConfigHasOwnKey(flow, provider, issues)) continue;\n if ((stepsUsing.get(provider) ?? 0) > 0 && (stepsWithoutOwnKey.get(provider) ?? 0) === 0) {\n continue; // every step brings its own key\n }\n warnStoredShape(issues, formatField(CFG.executorConfigBaseUrlFieldFormat, provider), provider);\n }\n}\n\nfunction warnStoredShape(issues: Issues, field: string, provider: string): void {\n issues.warn({\n field,\n code: CODE,\n message:\n `${field} names an endpoint for \"${provider}\" but the flow supplies no ${provider} key of its own. ` +\n `At run time the org's (or the platform's) stored ${provider} credential is never sent to a host ` +\n 'the flow chooses, so this step will be refused unless the run supplies its own key.',\n suggestion:\n \"To use a custom endpoint with the org's credential, store the base_url on the credential; \" +\n \"to use the provider's default endpoint, remove this field\",\n });\n}\n\n// --- the executor families -------------------------------------------------\n\nfunction familyOf(executor: string): { key: string; family: CredentialEndpointFamily } | null {\n const sep = executor.indexOf(CFG.protocolSeparator);\n if (sep <= 0) return null;\n const protocol = executor.slice(0, sep);\n const rest = executor.slice(sep + CFG.protocolSeparator.length);\n const slash = rest.indexOf('/');\n const driver = slash < 0 ? rest : rest.slice(0, slash);\n const candidates =\n driver === '' ? [protocol] : [protocol + CFG.familyKeySeparator + driver, protocol];\n for (const key of candidates) {\n const family = own(CFG.families, key);\n if (family !== undefined) return { key, family: family as CredentialEndpointFamily };\n }\n return null;\n}\n\nfunction serverEnvRef(family: CredentialEndpointFamily, value: string): string | null {\n const name = envReferenceName(value);\n if (name === null || !family.expandsServerEnvReferences || !family.serverEnv.includes(name)) {\n return null;\n }\n return name;\n}\n\nfunction listHas(list: readonly string[], s: string): boolean {\n return s !== '' && list.includes(s);\n}\n\ninterface FamilySecret {\n envName: string | null;\n field: string;\n}\n\n/** The step's credential: the step query first, then each executor_config block. */\nfunction familySecret(\n flow: Flow,\n family: CredentialEndpointFamily,\n step: CredStep,\n issues: Issues,\n): FamilySecret | null {\n for (const key of family.secretParams) {\n const v = nonEmptyString(step.query, key);\n if (v !== null) return { envName: serverEnvRef(family, v), field: step.field(key) };\n }\n for (const configKey of family.configKeys) {\n const inst = configInstance(flow, configKey);\n if (inst === null) continue;\n const apiKey = configStringField(inst, configKey, CFG.executorConfigApiKeyField, issues);\n if (apiKey !== '' && listHas(family.secretParams, family.configApiKeyParam)) {\n return {\n envName: serverEnvRef(family, apiKey),\n field: formatField(\n CFG.executorConfigKeyFieldFormat,\n configKey,\n CFG.executorConfigApiKeyField,\n ),\n };\n }\n const extra = own(inst, EXECUTOR_CONFIG_ENV_SCOPES.extraKey);\n for (const key of family.secretParams) {\n const v = nonEmptyString(extra, key);\n if (v !== null) {\n return {\n envName: serverEnvRef(family, v),\n field: formatField(CFG.executorConfigExtraFieldFormat, configKey, key),\n };\n }\n }\n }\n return null;\n}\n\nfunction isAuthorLiteral(family: CredentialEndpointFamily, v: string): boolean {\n if (v === '' || v.includes(TEMPLATE_ACTION_OPEN)) return false;\n if (envReferenceName(v) !== null) return false;\n const origin = goEndpointOrigin(v, CFG.defaultPorts, CFG.protocolSeparator);\n return !family.defaultEndpoints.some(\n (d) => goEndpointOrigin(d, CFG.defaultPorts, CFG.protocolSeparator) === origin,\n );\n}\n\n/** The field of the endpoint the step will use when it is certainly the author's, or null. */\nfunction familyAuthorEndpoint(\n flow: Flow,\n family: CredentialEndpointFamily,\n step: CredStep,\n issues: Issues,\n): string | null {\n const decide = (v: string, field: string): string | null =>\n isAuthorLiteral(family, v) ? field : null;\n for (const key of family.endpointParams) {\n const v = nonEmptyEndpoint(step.query, key);\n if (v !== null) return decide(v, step.field(key));\n }\n for (const configKey of family.configKeys) {\n const inst = configInstance(flow, configKey);\n if (inst === null) continue;\n const baseUrl = configStringField(inst, configKey, CFG.executorConfigBaseUrlField, issues);\n if (baseUrl !== '' && listHas(family.endpointParams, family.configBaseUrlParam)) {\n return decide(baseUrl, formatField(CFG.executorConfigBaseUrlFieldFormat, configKey));\n }\n const extra = own(inst, EXECUTOR_CONFIG_ENV_SCOPES.extraKey);\n for (const key of family.endpointParams) {\n const v = nonEmptyEndpoint(extra, key);\n if (v !== null)\n return decide(v, formatField(CFG.executorConfigExtraFieldFormat, configKey, key));\n }\n }\n return null;\n}\n\nfunction validateFamilies(flow: Flow, steps: CredStep[], issues: Issues): void {\n for (const step of steps) {\n const found = familyOf(step.executor);\n if (found === null || found.family.implicitServerCredential) continue;\n const { key: familyKey, family } = found;\n const secret = familySecret(flow, family, step, issues);\n if (secret === null || secret.envName === null) continue;\n const endpointField = familyAuthorEndpoint(flow, family, step, issues);\n if (endpointField === null) continue;\n issues.warn({\n field: endpointField,\n code: CODE,\n message:\n `${endpointField} names an endpoint for ${familyKey} while the step's credential ${secret.field} ` +\n `comes from the server's environment (${secret.envName}). A server-supplied credential is only ` +\n \"sent to the executor's default or deployment-configured endpoint, so this step is refused at \" +\n \"run time unless that endpoint is the deployment's own.\",\n suggestion:\n \"Supply the endpoint's own credential, or remove the endpoint (or name it by its deployment \" +\n \"variable) to use the deployment's\",\n });\n }\n}\n","// `compliance_residency_unenforced` (WARNING): an EU-only `compliance.residency`\n// beside a literal model call that nothing pins to the EU.\n//\n// Port of the reference's `validateResidencyEnforcement` (AIgentFlow v2.821.0),\n// together with the Go port. `compliance.residency` is checked by the reference\n// against its model CATALOGUE (declared deployments, not the host a call\n// dials); that check needs the catalogue and is not ported (PARITY.md). This\n// rule needs none, so it is: it says which calls leave the flow's residency\n// declaration without any evidence behind it.\n//\n// A warning, never an error: the call may be correct (the key is EU-confined, a\n// run input supplies the region) and a static check cannot see that.\n//\n// The rule is in the spec (`complianceResidency`): the EU-only code set, the\n// region-lane providers (those whose adapter routes on `region`), the formats.\n// A provider with no region lane (scaleway, vaiembed, anthropic native, ...)\n// cannot be pinned by these keys and is never warned.\n\nimport type { Flow } from '../types.js';\nimport { COMPLIANCE_RESIDENCY as CFG, TEMPLATE_ACTION_OPEN } from '../spec/index.js';\nimport { goTrimSpace, inspectExonsFrontmatter } from './exons.js';\nimport { loopSubStepsOfStep } from './processingOperations.js';\nimport { Issues, isArray, isRecord } from './util.js';\n\n/** An own property of a plain object (never one of Object.prototype's). */\nfunction own(m: unknown, key: string): unknown {\n if (!isRecord(m) || !Object.prototype.hasOwnProperty.call(m, key)) return undefined;\n return m[key];\n}\n\n/** Go's `fmt.Sprintf` for a format of `%s` / `%q` verbs; `%q` quotes, `%v` takes the text as given. */\nfunction sprintf(format: string, ...args: string[]): string {\n let i = 0;\n return format.replace(/%[sqv]/g, (verb) => {\n const arg = args[i++] ?? '';\n return verb === '%q' ? JSON.stringify(arg) : arg;\n });\n}\n\n/** The trimmed value, or '' when it is a template. */\nfunction literalOrEmpty(s: string): string {\n const t = goTrimSpace(s);\n return t.includes(TEMPLATE_ACTION_OPEN) ? '' : t;\n}\n\n/**\n * The declared residency codes when the declaration is EU-only (non-empty, every\n * code, trimmed and upper-cased, in the EU set), else null. `[\"EU\",\"US\"]` is not\n * EU-only: residency means \"at least one of these\".\n */\nfunction euOnlyResidency(flow: Flow, issues: Issues): string[] | null {\n const raw = own(own(flow, 'compliance'), 'residency');\n if (!isArray(raw)) return null;\n const codes: string[] = [];\n for (let i = 0; i < raw.length; i++) {\n if (raw[i] === null) continue; // yaml.v3 drops a null list element\n const code = issues.stringAt(raw[i], `compliance.residency[${i}]`);\n if (code === null) return null;\n codes.push(code);\n }\n if (codes.length === 0) return null;\n const eu = new Set(CFG.euResidencyCodes);\n return codes.every((c) => eu.has(goTrimSpace(c).toUpperCase())) ? codes : null;\n}\n\n/** The provider segment of `ai://<provider>/<operation>`: present only when a slash follows it. */\nfunction aiProvider(executor: string): string {\n const prefix = CFG.aiProtocol + CFG.protocolSeparator;\n if (!executor.startsWith(prefix)) return '';\n const rest = executor.slice(prefix.length);\n const slash = rest.indexOf('/');\n const provider = slash > 0 ? rest.slice(0, slash) : '';\n return provider.includes(TEMPLATE_ACTION_OPEN) ? '' : provider;\n}\n\nfunction isRegionLane(provider: string): boolean {\n const literal = literalOrEmpty(provider);\n return literal !== '' && CFG.regionLaneProviders.includes(literal.toLowerCase());\n}\n\n/** The reference's `query[key].(string)`, non-empty after trimming. */\nfunction nonBlankString(m: unknown, key: string): boolean {\n const v = own(m, key);\n return typeof v === 'string' && goTrimSpace(v) !== '';\n}\n\n/** The reference's `getBoolParam`: a bool, or one of the strings true / 1 / yes. */\nfunction queryEnforcesRegion(query: unknown): boolean {\n const v = own(query, CFG.enforceRegionParam);\n if (typeof v === 'boolean') return v;\n return typeof v === 'string' && CFG.enforceRegionTrueStrings.includes(v);\n}\n\n/** executor_config.<provider>.base_url names the host (the author chose it). */\nfunction flowDirectsEndpoint(flow: Flow, provider: string, issues: Issues): boolean {\n const key = provider.toLowerCase();\n const inst = own(own(flow, 'executor_config'), key);\n if (!isRecord(inst)) return false;\n const baseUrl = issues.stringOf(inst, 'base_url', `executor_config.${key}`);\n return baseUrl !== null && goTrimSpace(baseUrl) !== '';\n}\n\nfunction callPinsEndpoint(flow: Flow, provider: string, query: unknown, issues: Issues): boolean {\n if (nonBlankString(query, CFG.regionParam)) return true;\n if (queryEnforcesRegion(query)) return true;\n if (nonBlankString(query, provider.toLowerCase() + CFG.baseUrlParamSuffix)) return true;\n return flowDirectsEndpoint(flow, provider, issues);\n}\n\nexport function validateResidencyEnforcement(flow: Flow, issues: Issues): void {\n const residency = euOnlyResidency(flow, issues);\n if (residency === null) return;\n const warn = (\n site: string,\n field: string,\n stepId: string | undefined,\n provider: string,\n ): void => {\n issues.warn({\n field,\n ...(stepId === undefined ? {} : { stepId }),\n code: CFG.code,\n message: sprintf(CFG.messageFormat, site, provider, `[${residency.join(' ')}]`),\n suggestion: CFG.suggestion,\n });\n };\n\n const steps = flow.steps;\n if (isRecord(steps)) {\n for (const stepId of Object.keys(steps).sort()) {\n const step = steps[stepId];\n if (!isRecord(step)) continue;\n const calls: { executor: string; query: unknown; subId: string | null }[] = [\n {\n executor: issues.stringOf(step, 'executor', `steps.${stepId}`) ?? '',\n query: own(step, 'query'),\n subId: null,\n },\n ];\n for (const sub of loopSubStepsOfStep(stepId, step)) {\n calls.push({\n executor: issues.stringOf(sub.raw, 'executor', sub.basePath) ?? '',\n query: own(sub.raw, 'query'),\n subId: issues.stringOf(sub.raw, 'id', sub.basePath) ?? '',\n });\n }\n for (const call of calls) {\n const provider = aiProvider(call.executor);\n if (!isRegionLane(provider)) continue;\n if (callPinsEndpoint(flow, provider, call.query, issues)) continue;\n if (call.subId === null) {\n warn(\n sprintf(CFG.siteStepFormat, stepId),\n sprintf(CFG.stepFieldFormat, stepId),\n stepId,\n provider,\n );\n } else {\n warn(\n sprintf(CFG.siteLoopStepFormat, call.subId, stepId),\n sprintf(CFG.loopStepFieldFormat, stepId, call.subId),\n stepId,\n provider,\n );\n }\n }\n }\n }\n\n warnOrchestrator(flow, issues, warn);\n}\n\n/**\n * The orchestrator's provider is `execution.provider` of its exons frontmatter.\n * A document this validator cannot read the way the engine would (a tag in the\n * frontmatter, undecodable YAML) is skipped: no provider is known.\n */\nfunction warnOrchestrator(\n flow: Flow,\n issues: Issues,\n warn: (site: string, field: string, stepId: string | undefined, provider: string) => void,\n): void {\n const orch: unknown = flow.orchestrator;\n if (!isRecord(orch)) return;\n const source = issues.stringOf(orch, 'exons', 'orchestrator');\n if (source === null || source === '') return;\n const report = inspectExonsFrontmatter(source);\n if (report.parseError !== null || !report.specRead || !report.hasSpec) return;\n const provider = literalOrEmpty(report.provider);\n if (!isRegionLane(provider)) return;\n const region = issues.stringOf(orch, 'region', 'orchestrator');\n if (region !== null && goTrimSpace(region) !== '') return;\n if (orch.enforce_region === true) return;\n if (flowDirectsEndpoint(flow, provider, issues)) return;\n warn(CFG.siteOrchestrator, CFG.orchestratorField, undefined, provider);\n}\n","// The `examples:` block: concrete cases (an input, what a good result looks\n// like, why the case matters) recorded inside the flow document.\n//\n// Port of the reference's single examples walker. The engine never reads this\n// block; the validator is its only reader here, so every rule is a save-time\n// judgement of the DOCUMENT. The walker is PURE and OFFLINE: it never fetches a\n// reference and never resolves a host.\n//\n// Findings carry their own severity (the spec's `examples.codes` states it once\n// per code and a test holds the two together). Messages are the reference's own\n// wording, with the path carried in `field`.\n//\n// What differs from the reference is listed in PARITY.md (\"The examples block\"):\n// the inline `input` is judged by a NARROWED check (unknown field, required,\n// value kind, enum membership — no length/min/max/pattern/date-format), a\n// `matches` pattern is judged by length only (RE2 and JS RegExp disagree about\n// what compiles), and `example_ref_blocked_host` is not ported.\n\nimport type { Flow } from '../types.js';\nimport { EXAMPLES } from '../spec/index.js';\nimport { goParseURLParts, goQueryKeys, goToLower, goTrimSpace } from './goUrl.js';\nimport { Issues, isRecord } from './util.js';\n\ntype Rec = Record<string, unknown>;\ntype Severity = 'error' | 'warning';\n\ninterface Finding {\n code: string;\n severity: Severity;\n field: string;\n message: string;\n suggestion?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Vocabulary the spec does not carry as a list of its own.\n// ---------------------------------------------------------------------------\n\nconst KEY_EXAMPLES = 'examples';\nconst VISIBILITY_PUBLIC = 'public';\nconst STATUS_COMPLETED = 'completed';\nconst STATUS_FAILED = 'failed';\nconst STATUS_PAUSED_FOR_HUMAN = 'paused_for_human';\nconst ORIGIN_NONE = '';\nconst SIDE_EFFECTS_NONE = '';\nconst SCHEME_HTTPS = 'https';\nconst FILE_REF_KEYS: ReadonlySet<string> = new Set(['url', 'sha256', 'media_type', 'note']);\nconst FILE_REF_KEY = 'ref';\nconst TYPE_SECRET = 'secret';\nconst TYPE_FILE = 'file';\nconst TYPE_STRING = 'string';\nconst TYPE_MULTILINE = 'multiline';\nconst TYPE_NUMBER = 'number';\nconst TYPE_BOOL = 'bool';\nconst TYPE_ENUM = 'enum';\nconst TYPE_ARRAY_OF_STRINGS = 'array_of_strings';\nconst TYPE_DATE = 'date';\n/** How deep a value is followed (the reference's own bound on a self-referential alias). */\nconst MAX_RECURSION_DEPTH = 32;\n/** The one status a checkpoint may not name and an expectation may omit. */\nconst TEXTUAL_MEDIA_BASES: ReadonlySet<string> = new Set([\n 'application/json',\n 'application/xml',\n 'application/yaml',\n 'application/x-yaml',\n 'application/markdown',\n]);\n\nconst SUGGESTION_ID =\n 'Pick a short stable name such as standard_invoice; it is the key results are filed under, so it never changes once saved';\nconst SUGGESTION_CHECKPOINT = 'Did you rename the step? Update the checkpoint to the new name';\nconst SUGGESTION_SECRET_VALUE = 'Remove the value; you are asked for it when you run the check';\nconst SUGGESTION_EXPECTED =\n 'Add at least a rubric: one or two sentences on what a good result looks like';\n\n// ---------------------------------------------------------------------------\n// Go formatting helpers (the reference's messages are Go `Sprintf` output).\n// ---------------------------------------------------------------------------\n\nconst utf8Encoder = new TextEncoder();\n\nfunction byteLen(s: string): number {\n return utf8Encoder.encode(s).length;\n}\n\n/** Go's `utf8.RuneCountInString`. */\nfunction runeCount(s: string): number {\n let n = 0;\n for (const _ of s) n++;\n return n;\n}\n\n/** Go's `%q` for a string. */\nfunction q(s: string): string {\n let out = '\"';\n for (const ch of s) {\n const c = ch.codePointAt(0) as number;\n if (ch === '\"') out += '\\\\\"';\n else if (ch === '\\\\') out += '\\\\\\\\';\n else if (c === 0x07) out += '\\\\a';\n else if (c === 0x08) out += '\\\\b';\n else if (c === 0x0c) out += '\\\\f';\n else if (c === 0x0a) out += '\\\\n';\n else if (c === 0x0d) out += '\\\\r';\n else if (c === 0x09) out += '\\\\t';\n else if (c === 0x0b) out += '\\\\v';\n else if (c < 0x20 || c === 0x7f) out += `\\\\x${c.toString(16).padStart(2, '0')}`;\n else if (c >= 0x80 && /[\\p{C}\\p{Z}]/u.test(ch)) {\n out +=\n c > 0xffff\n ? `\\\\U${c.toString(16).padStart(8, '0')}`\n : `\\\\u${c.toString(16).padStart(4, '0')}`;\n } else out += ch;\n }\n return `${out}\"`;\n}\n\n/** Go `%v` for a float64: the shortest representation, in exponent form below 1e-4 and from 1e6 up. */\nfunction num(n: number): string {\n if (Number.isNaN(n)) return 'NaN';\n if (n === Infinity) return '+Inf';\n if (n === -Infinity) return '-Inf';\n if (n === 0) return Object.is(n, -0) ? '-0' : '0';\n const [mantissa = '', exponent = '0'] = n.toExponential().split('e');\n const exp = Number(exponent);\n if (exp < -4 || exp >= 6) {\n const sign = exp < 0 ? '-' : '+';\n return `${mantissa}e${sign}${String(Math.abs(exp)).padStart(2, '0')}`;\n }\n return String(n);\n}\n\nfunction has(o: Rec, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(o, key) && o[key] !== null && o[key] !== undefined;\n}\n\nfunction own(o: Rec, key: string): unknown {\n return Object.prototype.hasOwnProperty.call(o, key) ? o[key] : undefined;\n}\n\nfunction setOwn(o: Rec, key: string, value: unknown): void {\n Object.defineProperty(o, key, {\n value,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n}\n\nfunction sortedKeys(o: Rec): string[] {\n return Object.keys(o).sort();\n}\n\n/** A Go `*float64` read: a YAML number, or absent. */\nfunction numberOf(v: unknown): number | undefined {\n return typeof v === 'number' ? v : undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Values: normalisation and the RFC 7386 merge patch.\n// ---------------------------------------------------------------------------\n\n/**\n * Turn what a loader may hand over into something a live run would receive: a\n * date object (a loader that resolves timestamps) becomes the string a JSON\n * body carries, and depth is bounded so a self-referential alias terminates.\n * The `yaml` package this validator parses with leaves a date a string, so for\n * parsed text this is the identity.\n */\nfunction normalize(v: unknown, depth: number): unknown {\n if (depth > MAX_RECURSION_DEPTH) return null;\n if (v instanceof Date) {\n if (Number.isNaN(v.getTime())) return null;\n const iso = v.toISOString();\n if (/T00:00:00\\.000Z$/.test(iso)) return iso.slice(0, 10);\n return iso.replace(/\\.000Z$/, 'Z');\n }\n if (Array.isArray(v)) return v.map((x) => normalize(x, depth + 1));\n if (isRecord(v)) {\n const out: Rec = {};\n for (const k of Object.keys(v)) setOwn(out, k, normalize(v[k], depth + 1));\n return out;\n }\n return v;\n}\n\nfunction deepCopy(v: unknown, depth: number): unknown {\n if (depth > MAX_RECURSION_DEPTH) return v;\n if (Array.isArray(v)) return v.map((x) => deepCopy(x, depth + 1));\n if (isRecord(v)) {\n const out: Rec = {};\n for (const k of Object.keys(v)) setOwn(out, k, deepCopy(v[k], depth + 1));\n return out;\n }\n return v;\n}\n\nfunction mergePatch(target: Rec, patch: Rec, depth: number): void {\n if (depth > MAX_RECURSION_DEPTH) return;\n for (const k of Object.keys(patch)) {\n const pv = patch[k];\n if (pv === null || pv === undefined) {\n delete target[k];\n continue;\n }\n if (isRecord(pv)) {\n const current = own(target, k);\n const existing: Rec = isRecord(current) ? (deepCopy(current, 0) as Rec) : {};\n mergePatch(existing, pv, depth + 1);\n setOwn(target, k, existing);\n continue;\n }\n setOwn(target, k, deepCopy(pv, 0));\n }\n}\n\n/**\n * RFC 7386 JSON Merge Patch: a mapping merges recursively, null deletes the\n * key, anything else replaces. The base is never mutated and the result shares\n * no object with either argument.\n */\nexport function applyExamplePatch(base: Rec, patch: Rec): Rec {\n const out = deepCopy(base, 0) as Rec;\n mergePatch(out, patch, 0);\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// The file reference\n// ---------------------------------------------------------------------------\n\ninterface FileRef {\n url: string;\n sha256: string;\n mediaType: string;\n note: string;\n}\n\n/** The mapping shape a file-typed input takes, or null when it is anything else. */\nfunction asFileRef(v: unknown): FileRef | null {\n if (!isRecord(v)) return null;\n const keys = Object.keys(v);\n if (keys.length === 0) return null;\n for (const k of keys) if (!FILE_REF_KEYS.has(k)) return null;\n const str = (k: string): string => {\n const x = own(v, k);\n return typeof x === 'string' ? x : '';\n };\n return {\n url: str('url'),\n sha256: str('sha256'),\n mediaType: str('media_type'),\n note: str('note'),\n };\n}\n\nfunction isTextualMediaType(mediaType: string): boolean {\n const base = goToLower(goTrimSpace((mediaType.split(';')[0] ?? '').toString()));\n if (base.startsWith('text/')) return true;\n if (base.endsWith('+json') || base.endsWith('+xml')) return true;\n return TEXTUAL_MEDIA_BASES.has(base);\n}\n\n// ---------------------------------------------------------------------------\n// The walker\n// ---------------------------------------------------------------------------\n\ntype ExpectKind = 'final' | 'checkpoint';\n\nclass Walker {\n findings: Finding[] = [];\n\n constructor(\n private readonly flow: Flow,\n private readonly issues: Issues,\n ) {}\n\n // -- emit -------------------------------------------------------------\n\n private add(\n severity: Severity,\n code: string,\n field: string,\n message: string,\n suggestion?: string,\n ): void {\n this.findings.push({\n code,\n severity,\n field,\n message,\n ...(suggestion !== undefined ? { suggestion } : {}),\n });\n }\n\n private err(code: string, field: string, message: string, suggestion?: string): void {\n this.add('error', code, field, message, suggestion);\n }\n\n private warn(code: string, field: string, message: string): void {\n this.add('warning', code, field, message);\n }\n\n /** A Go `string` field read by its source text; absent is \"\". */\n private s(o: Rec, key: string, parentPath: string): string {\n return this.issues.stringOf(o, key, parentPath) ?? '';\n }\n\n // -- the set ----------------------------------------------------------\n\n run(examples: unknown[]): void {\n this.validateSet(examples);\n const seen = new Map<string, number>();\n examples.forEach((ex, i) => {\n if (isRecord(ex)) this.validateExample(i, ex, seen);\n });\n }\n\n private validateSet(examples: unknown[]): void {\n const n = examples.length;\n const L = EXAMPLES.limits;\n if (n > L.maxPerFlow) {\n this.err(\n 'examples_too_many',\n KEY_EXAMPLES,\n `flow declares ${n} examples; the limit is ${L.maxPerFlow}`,\n );\n }\n const size = blockBytes(examples);\n if (size !== null && size > L.maxBlockBytes) {\n this.err(\n 'examples_block_too_large',\n KEY_EXAMPLES,\n `the examples block is ${size} bytes; the limit is ${L.maxBlockBytes}. Move large inputs or target outputs to a file reference (https URL).`,\n );\n }\n const allHeld = examples.every((e) => isRecord(e) && own(e, 'hold_out') === true);\n if (allHeld) {\n this.warn(\n 'examples_all_held_out',\n KEY_EXAMPLES,\n 'every example is held out, so nothing is left to tune on',\n );\n }\n if (this.isPublic()) {\n this.warn(\n 'examples_published_with_public_flow',\n KEY_EXAMPLES,\n 'this flow is public, so everyone who can see it can read its examples, including their expected results. Only publish examples you are happy to show.',\n );\n }\n }\n\n private isPublic(): boolean {\n return this.s(this.flow as Rec, 'visibility', '') === VISIBILITY_PUBLIC;\n }\n\n // -- one example ------------------------------------------------------\n\n private validateExample(i: number, ex: Rec, seen: Map<string, number>): void {\n const L = EXAMPLES.limits;\n const path = `examples[${i}]`;\n const id = this.s(ex, 'id', path);\n const label = id === '' ? `#${i + 1}` : id;\n\n // id\n if (id === '') {\n this.err('example_id_missing', `${path}.id`, `example #${i + 1} has no id`, SUGGESTION_ID);\n } else if (!EXAMPLES.idPattern.test(id)) {\n this.err(\n 'example_id_invalid',\n `${path}.id`,\n `example id ${q(id)} is not valid: use lower-case letters, digits and underscores, starting with a letter (2 to 48 characters)`,\n SUGGESTION_ID,\n );\n } else {\n const first = seen.get(id);\n if (first !== undefined) {\n this.err(\n 'example_id_duplicate',\n `${path}.id`,\n `example id ${q(id)} is used by examples #${first + 1} and #${i + 1}`,\n );\n } else {\n seen.set(id, i);\n }\n }\n\n // title\n const title = this.s(ex, 'title', path);\n if (goTrimSpace(title) === '') {\n this.err(\n 'example_title_missing',\n `${path}.title`,\n `example ${q(label)} has no title; the title is what a person sees in the list of examples`,\n );\n } else {\n const n = runeCount(title);\n if (n > L.titleMaxRunes) {\n this.err(\n 'example_title_too_long',\n `${path}.title`,\n `example ${q(label)} title is ${n} characters; the limit is ${L.titleMaxRunes}`,\n );\n }\n }\n\n // guidance / notes\n const guidance = this.s(ex, 'guidance', path);\n if (goTrimSpace(guidance) === '') {\n this.warn(\n 'example_guidance_missing',\n `${path}.guidance`,\n `example ${q(label)} has no guidance. One sentence on why this case matters helps the judge and the next author.`,\n );\n } else {\n const n = runeCount(guidance);\n if (n > L.maxGuidanceRunes) {\n this.err(\n 'example_guidance_too_long',\n `${path}.guidance`,\n `example ${q(label)} guidance is ${n} characters; the limit is ${L.maxGuidanceRunes}`,\n );\n }\n }\n const notesN = runeCount(this.s(ex, 'notes', path));\n if (notesN > L.maxNotesRunes) {\n this.err(\n 'example_notes_too_long',\n `${path}.notes`,\n `example ${q(label)} notes are ${notesN} characters; the limit is ${L.maxNotesRunes}`,\n );\n }\n\n this.validateTags(path, label, own(ex, 'tags'));\n\n // weight, min_score, side_effects\n this.validateWeight(`${path}.weight`, label, numberOf(own(ex, 'weight')));\n const minScore = numberOf(own(ex, 'min_score'));\n if (minScore !== undefined && !scoreInRange(minScore)) {\n this.err(\n 'example_min_score_range',\n `${path}.min_score`,\n `example ${q(label)} has min_score ${num(minScore)}; use a number from 0 to 1 (0.7 is 7.3 out of 10)`,\n );\n }\n const sideEffects = this.s(ex, 'side_effects', path);\n if (sideEffects !== SIDE_EFFECTS_NONE && !EXAMPLES.sideEffects.has(sideEffects)) {\n this.err(\n 'example_side_effects_invalid',\n `${path}.side_effects`,\n `example ${q(label)} has side_effects ${q(sideEffects)}; use refuse or allow`,\n );\n }\n\n // hold_out on a public flow\n const holdOut = own(ex, 'hold_out') === true;\n if (holdOut && this.isPublic()) {\n this.err(\n 'example_holdout_in_public_flow',\n `${path}.hold_out`,\n `example ${q(label)} is held out but this flow is public: a held-out example must stay private, and a public flow's definition is readable by everyone. Make the flow private or remove hold_out.`,\n );\n }\n\n // input / input_ref\n const hasInput = has(ex, 'input');\n const hasInputRef = has(ex, 'input_ref');\n if (hasInput && hasInputRef) {\n this.err(\n 'example_input_conflict',\n path,\n `example ${q(label)} sets both input and input_ref; use exactly one`,\n );\n } else if (!hasInput && !hasInputRef) {\n this.err(\n 'example_input_missing',\n path,\n `example ${q(label)} has neither input nor input_ref; use input: {} for a flow that takes no input`,\n );\n }\n const rawInput = own(ex, 'input');\n const baseInput: Rec | null = isRecord(rawInput) ? rawInput : null;\n if (baseInput !== null) {\n this.checkInput(`${path}.input`, label, baseInput, 'example_input_invalid');\n }\n const rawInputRef = own(ex, 'input_ref');\n if (isRecord(rawInputRef)) {\n this.validateFileRef(`${path}.input_ref`, this.fileRefOf(rawInputRef, `${path}.input_ref`));\n }\n\n // expected\n let binaryOnly = false;\n const expected = own(ex, 'expected');\n if (!has(ex, 'expected')) {\n this.err(\n 'example_expected_missing',\n `${path}.expected`,\n `example ${q(label)} does not say what a good result is: add a rubric, fields, exact or reference`,\n SUGGESTION_EXPECTED,\n );\n } else if (isRecord(expected)) {\n this.validateExpectation(`${path}.expected`, label, expected, 'final', '');\n binaryOnly = this.expectationIsBinaryReferenceOnly(expected, `${path}.expected`);\n }\n if (binaryOnly) {\n this.warn(\n 'examples_unreadable_by_judge',\n `${path}.expected`,\n 'this example can be run but not scored',\n );\n }\n\n // checkpoints\n this.validateCheckpoints(path, label, own(ex, 'checkpoints'));\n\n // variants\n this.validateVariants(i, path, label, ex, hasInput, baseInput);\n\n // credential-shaped literals anywhere in the example\n this.scanSecretLike(i, path, ex);\n }\n\n private validateTags(path: string, label: string, tags: unknown): void {\n if (!Array.isArray(tags)) return;\n if (tags.length > EXAMPLES.limits.maxTags) {\n this.err(\n 'example_tag_invalid',\n `${path}.tags`,\n `example ${q(label)} has ${tags.length} tags; the limit is ${EXAMPLES.limits.maxTags}`,\n );\n }\n const seen = new Set<string>();\n tags.forEach((item: unknown, j: number) => {\n const field = `${path}.tags[${j}]`;\n const tag = item === null ? '' : (this.issues.stringAt(item, field) ?? null);\n if (tag === null) return;\n if (!EXAMPLES.tagPattern.test(tag)) {\n this.err('example_tag_invalid', field, `example ${q(label)} has an invalid tag ${q(tag)}`);\n } else if (seen.has(tag)) {\n this.err(\n 'example_tag_invalid',\n field,\n `example ${q(label)} lists the tag ${q(tag)} more than once`,\n );\n }\n seen.add(tag);\n });\n }\n\n private validateWeight(field: string, label: string, weight: number | undefined): void {\n if (weight === undefined) return;\n if (Number.isNaN(weight) || weight <= 0 || weight > EXAMPLES.limits.weightMax) {\n this.err(\n 'example_weight_range',\n field,\n `example ${q(label)} has weight ${num(weight)}; use a number above 0 and at most 10`,\n );\n }\n }\n\n // -- input ------------------------------------------------------------\n\n /**\n * Judge one inline input map (an example's `input`, or a variant's patched\n * input). NARROWED relative to the reference, which runs its full value\n * validator: here an unknown field, a missing required field, a value of the\n * wrong KIND and an enum value outside its list are judged; length, range,\n * pattern and date-format constraints are not (PARITY.md).\n */\n private checkInput(field: string, label: string, raw: Rec, code: string): void {\n const input = (normalize(raw, 0) as Rec | null) ?? {};\n const L = EXAMPLES.limits;\n const size = jsonBytes(input);\n if (size !== null && size > L.maxInlineInputBytes) {\n this.err(\n 'example_input_too_large',\n field,\n `example ${q(label)} input is ${size} bytes; the limit is ${L.maxInlineInputBytes}. Put the large part behind an https file reference.`,\n );\n return;\n }\n const schema = own(this.flow as Rec, 'input_schema');\n const query = own(this.flow as Rec, 'query');\n if (isRecord(schema)) {\n this.checkInputAgainstSchema(field, label, input, schema, code);\n } else if (isRecord(query) && Object.keys(query).length > 0) {\n const declared = sortedKeys(query);\n for (const k of sortedKeys(input)) {\n if (!Object.prototype.hasOwnProperty.call(query, k)) {\n this.err(\n code,\n `${field}.${k}`,\n `example ${q(label)}: ${q(k)} is not a declared input of this flow (declared: ${declared.join(', ')})`,\n );\n }\n }\n } else {\n this.warn(\n 'example_input_unvalidated',\n field,\n `example ${q(label)} cannot be checked: the flow declares no input_schema and no query parameters.`,\n );\n }\n }\n\n private checkInputAgainstSchema(\n field: string,\n label: string,\n input: Rec,\n schema: Rec,\n code: string,\n ): void {\n const fields = this.schemaFields(schema);\n const byName = new Map<string, SchemaField>();\n for (const f of fields) byName.set(f.name, f);\n\n // Build the run input: a file reference in a file-typed field becomes\n // {ref: <url>}; a secret-typed value is reported and removed (a secret is\n // never judged — the person running the evaluation supplies it).\n const runInput: Rec = {};\n for (const name of sortedKeys(input)) {\n const val = input[name];\n const f = byName.get(name);\n const present = val !== null && val !== undefined;\n if (f !== undefined && f.type === TYPE_SECRET) {\n if (present) {\n this.err(\n 'example_secret_value',\n `${field}.${name}`,\n `example ${q(label)} gives a value for ${q(name)}, which is a secret field. Examples are saved inside the flow and are never allowed to hold secrets; remove it. The person running the evaluation is asked for it at run time.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n continue;\n }\n if (f !== undefined && f.type === TYPE_FILE && present) {\n const ref = asFileRef(val);\n if (ref === null) {\n this.err(\n 'example_file_input_needs_ref',\n `${field}.${name}`,\n `example ${q(label)}: field ${q(name)} is a file; give it as {url: \"https://…\"}. A pasted upload id would stop working as soon as the session ends.`,\n );\n continue;\n }\n this.validateFileRef(`${field}.${name}`, ref);\n setOwn(runInput, name, { [FILE_REF_KEY]: ref.url });\n continue;\n }\n setOwn(runInput, name, val);\n }\n\n for (const failure of this.judgeRun(fields, byName, runInput)) {\n // A required secret nobody may supply here is not an error at save: it\n // makes the case needs-secret at run time.\n if (failure.required) {\n const f = byName.get(failure.field);\n if (f !== undefined && f.type === TYPE_SECRET) continue;\n }\n const at = failure.field !== '' ? `${field}.${failure.field}` : field;\n this.err(code, at, `example ${q(label)}: ${failure.message}`);\n }\n }\n\n private schemaFields(schema: Rec): SchemaField[] {\n const raw = own(schema, 'fields');\n if (!Array.isArray(raw)) return [];\n const out: SchemaField[] = [];\n raw.forEach((f: unknown, i: number) => {\n if (!isRecord(f)) return;\n const base = `input_schema.fields[${i}]`;\n const enumRaw = own(f, 'enum');\n const enumValues: string[] = [];\n if (Array.isArray(enumRaw)) {\n enumRaw.forEach((e: unknown, j: number) => {\n enumValues.push(e === null ? '' : (this.issues.stringAt(e, `${base}.enum[${j}]`) ?? ''));\n });\n }\n const vw = own(f, 'visible_when');\n out.push({\n name: this.s(f, 'name', base),\n type: this.s(f, 'type', base),\n required: own(f, 'required') === true,\n enumValues,\n visibleWhen: isRecord(vw)\n ? {\n field: this.s(vw, 'field', `${base}.visible_when`),\n equals: own(vw, 'equals'),\n in: Array.isArray(own(vw, 'in')) ? (own(vw, 'in') as unknown[]) : [],\n }\n : null,\n });\n });\n return out;\n }\n\n /** The narrowed run-time judgement: required, kind, enum, unknown field. */\n private judgeRun(\n fields: SchemaField[],\n byName: Map<string, SchemaField>,\n runInput: Rec,\n ): RunFailure[] {\n const failures: RunFailure[] = [];\n for (const f of fields) {\n if (!isVisible(f, runInput)) continue;\n const raw = own(runInput, f.name);\n if (raw === undefined || raw === null) {\n if (f.required) {\n failures.push({\n field: f.name,\n message: `input field ${q(f.name)} is required`,\n required: true,\n });\n }\n continue;\n }\n failures.push(...inputValueFailures(f, raw));\n }\n for (const k of sortedKeys(runInput)) {\n if (!byName.has(k)) {\n failures.push({\n field: k,\n message: `input field ${q(k)} is not declared in input_schema`,\n required: false,\n });\n }\n }\n return failures;\n }\n\n // -- file reference ---------------------------------------------------\n\n private fileRefOf(rec: Rec, path: string): FileRef {\n return {\n url: this.s(rec, 'url', path),\n sha256: this.s(rec, 'sha256', path),\n mediaType: this.s(rec, 'media_type', path),\n note: this.s(rec, 'note', path),\n };\n }\n\n private validateFileRef(field: string, ref: FileRef): void {\n const L = EXAMPLES.limits;\n const raw = ref.url;\n const invalid = 'the file reference needs a url of at most 2048 characters';\n if (raw === '' || byteLen(raw) > L.maxUrlBytes) {\n this.err('example_ref_invalid', field, invalid);\n return;\n }\n const u = goParseURLParts(raw);\n if (u === null) {\n this.err('example_ref_invalid', field, invalid);\n return;\n }\n const scheme = u.scheme.toLowerCase();\n if (EXAMPLES.reservedRefSchemes.has(scheme)) {\n this.err(\n 'example_ref_scheme_reserved',\n field,\n `${scheme}: references are not available yet. Use an https URL, or paste the text into the example.`,\n );\n return;\n }\n if (scheme !== SCHEME_HTTPS) {\n this.err(\n 'example_ref_scheme',\n field,\n `only https:// references are allowed (got ${q(scheme)})`,\n );\n return;\n }\n if (u.hasUser || u.fragment !== '' || raw.includes('#') || u.host === '') {\n this.err('example_ref_invalid', field, 'a reference must not carry a login or a fragment');\n return;\n }\n // The reference's blocked-host rule (a private or local address) is not\n // ported: it reuses the server's own address tables (PARITY.md).\n if (ref.sha256 !== '' && !EXAMPLES.sha256Pattern.test(ref.sha256)) {\n this.err(\n 'example_ref_sha256_invalid',\n field,\n 'sha256 must be 64 lowercase hexadecimal characters',\n );\n }\n if (ref.mediaType !== '' && !EXAMPLES.mediaTypePattern.test(ref.mediaType)) {\n this.err(\n 'example_ref_media_type_invalid',\n field,\n `media_type ${q(ref.mediaType)} must look like type/subtype`,\n );\n }\n const noteN = runeCount(ref.note);\n if (noteN > L.maxNoteRunes) {\n this.err(\n 'example_ref_invalid',\n field,\n `the note is ${noteN} characters; the limit is ${L.maxNoteRunes}`,\n );\n }\n if (ref.sha256 === '') {\n this.warn(\n 'example_ref_unpinned',\n field,\n 'this reference is not pinned. If the file at that address changes, your scores change with it. Add sha256 to freeze it.',\n );\n }\n for (const key of goQueryKeys(u.rawQuery)) {\n if (EXAMPLES.signedUrlQueryKeyPattern.test(key)) {\n this.warn(\n 'example_ref_signed_url',\n field,\n 'this address looks like a signed link. Anyone who can read the flow can use it until it expires, and it will stop working. Prefer a stable public address.',\n );\n break;\n }\n }\n }\n\n // -- expectation ------------------------------------------------------\n\n /** The names `fields` / `exact` may use, and whether such a list is declared at all. */\n private outputNamesFor(kind: ExpectKind, stepId: string): { names: string[]; declared: boolean } {\n if (kind === 'final') {\n const out = own(this.flow as Rec, 'output');\n const names: string[] = [];\n if (Array.isArray(out)) {\n out.forEach((item: unknown, i: number) => {\n names.push(item === null ? '' : (this.issues.stringAt(item, `output[${i}]`) ?? ''));\n });\n }\n return { names, declared: names.length > 0 };\n }\n const steps = own(this.flow as Rec, 'steps');\n const step = isRecord(steps) ? own(steps, stepId) : undefined;\n const schema = isRecord(step) ? own(step, 'output_schema') : undefined;\n const fields = isRecord(schema) ? own(schema, 'fields') : undefined;\n if (!Array.isArray(fields) || fields.length === 0) return { names: [], declared: false };\n const names: string[] = [];\n fields.forEach((f: unknown, i: number) => {\n if (isRecord(f)) names.push(this.s(f, 'name', `steps.${stepId}.output_schema.fields[${i}]`));\n });\n return { names, declared: true };\n }\n\n private validateExpectation(\n path: string,\n label: string,\n e: Rec,\n kind: ExpectKind,\n stepId: string,\n ): void {\n const L = EXAMPLES.limits;\n\n // status\n const status = this.s(e, 'status', path);\n if (status !== '' && !EXAMPLES.statuses.has(status)) {\n this.err(\n 'example_status_invalid',\n `${path}.status`,\n 'status must be completed, failed or paused_for_human',\n );\n }\n const noOutput = status === STATUS_FAILED || status === STATUS_PAUSED_FOR_HUMAN;\n const fieldsRec = own(e, 'fields');\n const exactRec = own(e, 'exact');\n const fieldKeys = isRecord(fieldsRec) ? sortedKeys(fieldsRec) : [];\n const exactKeys = isRecord(exactRec) ? sortedKeys(exactRec) : [];\n const hasFields = fieldKeys.length > 0;\n const hasExact = exactKeys.length > 0;\n if (hasFields && hasExact) {\n this.err(\n 'example_expected_conflict',\n path,\n 'use fields (some fields) or exact (the whole result), not both',\n );\n } else if (noOutput && (hasFields || hasExact)) {\n this.err(\n 'example_expected_conflict',\n path,\n `a case that ends in ${status} has no output to match; remove fields and exact, or expect status completed`,\n );\n }\n\n // min_score\n const minScore = numberOf(own(e, 'min_score'));\n if (minScore !== undefined && !scoreInRange(minScore)) {\n this.err(\n 'example_min_score_range',\n `${path}.min_score`,\n `min_score ${num(minScore)} is out of range; use a number from 0 to 1`,\n );\n }\n\n // rubric\n const rubric = this.s(e, 'rubric', path);\n if (rubric !== '') {\n if (goTrimSpace(rubric) === '') {\n this.err(\n 'example_rubric_empty',\n `${path}.rubric`,\n 'the rubric is empty; write what a good result looks like, or remove it',\n );\n } else {\n const n = runeCount(rubric);\n if (n > L.maxRubricRunes) {\n this.err(\n 'example_rubric_too_long',\n `${path}.rubric`,\n `the rubric is ${n} characters; the limit is ${L.maxRubricRunes}`,\n );\n }\n }\n }\n\n // reference\n const reference = own(e, 'reference');\n if (isRecord(reference)) this.validateReference(`${path}.reference`, reference);\n\n // fields / exact keys\n const { names, declared } = this.outputNamesFor(kind, stepId);\n const checkKey = (field: string, key: string): void => {\n if (!declared && kind === 'final') {\n this.warn(\n 'example_expected_field_unchecked',\n field,\n `this flow declares no output list, so ${q(key)} cannot be checked against it`,\n );\n } else if (!declared) {\n this.warn(\n 'example_expected_field_unchecked',\n field,\n `this step declares no output_schema, so ${q(key)} cannot be checked against it`,\n );\n } else if (!names.includes(key)) {\n this.err(\n 'example_expected_field_unknown',\n field,\n kind === 'checkpoint'\n ? `${q(key)} is not a field this step declares in its output_schema (declared: ${names.join(', ')})`\n : `${q(key)} is not an output of this flow (outputs: ${names.join(', ')})`,\n );\n }\n };\n for (const key of fieldKeys) {\n const fpath = `${path}.fields.${key}`;\n checkKey(fpath, key);\n const matcher = own(fieldsRec as Rec, key);\n if (isRecord(matcher)) this.validateFieldMatcher(fpath, matcher);\n }\n for (const key of exactKeys) checkKey(`${path}.exact.${key}`, key);\n\n // must_not / must_not_contain\n const mustNot = this.stringList(own(e, 'must_not'), `${path}.must_not`);\n const mustNotContain = this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`);\n const mustNotMsg = `must_not takes up to ${L.maxMustNot} statements of at most ${L.maxMustNotRunes} characters each, none empty`;\n if (mustNot.length > L.maxMustNot) {\n this.err('example_must_not_invalid', `${path}.must_not`, mustNotMsg);\n }\n mustNot.forEach((item, j) => {\n if (goTrimSpace(item) === '' || runeCount(item) > L.maxMustNotRunes) {\n this.err('example_must_not_invalid', `${path}.must_not[${j}]`, mustNotMsg);\n }\n });\n const mncMsg = `must_not_contain takes up to ${L.maxMustNotContain} literals of 1 to ${L.maxMustNotContainLength} characters each`;\n if (mustNotContain.length > L.maxMustNotContain) {\n this.err('example_must_not_contain_invalid', `${path}.must_not_contain`, mncMsg);\n }\n mustNotContain.forEach((item, j) => {\n const n = runeCount(item);\n if (n === 0 || n > L.maxMustNotContainLength) {\n this.err('example_must_not_contain_invalid', `${path}.must_not_contain[${j}]`, mncMsg);\n }\n });\n for (const key of fieldKeys) {\n const matcher = own(fieldsRec as Rec, key);\n if (!isRecord(matcher)) continue;\n const eq = own(matcher, 'equals');\n if (typeof eq !== 'string' || eq === '') continue;\n for (const banned of mustNotContain) {\n if (banned !== '' && equalFold(banned, eq)) {\n this.warn(\n 'example_expectation_contradiction',\n `${path}.fields.${key}`,\n `${q(banned)} is required by ${q(key)} and forbidden by must_not_contain`,\n );\n }\n }\n }\n\n // A checkpoint cannot name a status.\n if (kind === 'checkpoint' && status !== '') {\n this.err(\n 'example_checkpoint_status',\n `${path}.status`,\n `example ${q(label)}: a checkpoint cannot set status; status describes how the whole run ends`,\n );\n }\n\n // checks nothing\n if (\n rubric === '' &&\n !has(e, 'reference') &&\n !hasFields &&\n !hasExact &&\n mustNot.length === 0 &&\n mustNotContain.length === 0 &&\n (status === '' || status === STATUS_COMPLETED)\n ) {\n this.err(\n 'example_expected_empty',\n path,\n 'this expectation checks nothing; add a rubric, fields, exact, reference, must_not or must_not_contain',\n SUGGESTION_EXPECTED,\n );\n }\n }\n\n /** A Go `[]string` read: scalars by their text, null as \"\", anything else dropped. */\n private stringList(v: unknown, path: string): string[] {\n if (!Array.isArray(v)) return [];\n const out: string[] = [];\n v.forEach((item: unknown, j: number) => {\n if (item === null) out.push('');\n else {\n const t = this.issues.stringAt(item, `${path}[${j}]`);\n if (t !== null) out.push(t);\n }\n });\n return out;\n }\n\n private validateReference(path: string, r: Rec): void {\n const text = this.s(r, 'text', path);\n const hasText = text !== '';\n const hasRef = has(r, 'ref');\n if (hasText === hasRef) {\n this.err('example_reference_invalid', path, 'a reference needs exactly one of text or ref');\n return;\n }\n if (hasText) {\n const n = byteLen(text);\n if (n > EXAMPLES.limits.maxReferenceTextBytes) {\n this.err(\n 'example_reference_invalid',\n path,\n `the reference text is ${n} bytes; the limit is ${EXAMPLES.limits.maxReferenceTextBytes}. Put it behind an https file reference.`,\n );\n }\n return;\n }\n const refRec = own(r, 'ref');\n if (!isRecord(refRec)) return;\n const ref = this.fileRefOf(refRec, `${path}.ref`);\n this.validateFileRef(`${path}.ref`, ref);\n if (ref.mediaType !== '' && !isTextualMediaType(ref.mediaType)) {\n this.warn(\n 'example_reference_binary',\n path,\n 'this reference is not text, so it cannot be compared in this version; the example will be skipped, not failed.',\n );\n }\n }\n\n private expectationIsBinaryReferenceOnly(e: Rec, path: string): boolean {\n const reference = own(e, 'reference');\n const refRec = isRecord(reference) ? own(reference, 'ref') : undefined;\n if (!isRecord(refRec)) return false;\n const mediaType = this.s(refRec, 'media_type', `${path}.reference.ref`);\n if (mediaType === '' || isTextualMediaType(mediaType)) return false;\n const status = this.s(e, 'status', path);\n const fields = own(e, 'fields');\n const exact = own(e, 'exact');\n return (\n this.s(e, 'rubric', path) === '' &&\n !(isRecord(fields) && Object.keys(fields).length > 0) &&\n !(isRecord(exact) && Object.keys(exact).length > 0) &&\n this.stringList(own(e, 'must_not'), `${path}.must_not`).length === 0 &&\n this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`).length === 0 &&\n (status === '' || status === STATUS_COMPLETED)\n );\n }\n\n private validateFieldMatcher(path: string, m: Rec): void {\n const L = EXAMPLES.limits;\n const matches = this.s(m, 'matches', path);\n const oneOf = own(m, 'one_of');\n const approx = numberOf(own(m, 'approx'));\n const tolerance = numberOf(own(m, 'tolerance'));\n let operators = 0;\n if (has(m, 'equals')) operators++;\n if (this.s(m, 'contains', path) !== '') operators++;\n if (this.s(m, 'not_contains', path) !== '') operators++;\n if (matches !== '') operators++;\n if (Array.isArray(oneOf) && oneOf.length > 0) operators++;\n if (approx !== undefined) operators++;\n if (typeof own(m, 'present') === 'boolean') operators++;\n if (operators !== 1) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n 'write exactly one of equals, contains, not_contains, matches, one_of, approx, present',\n );\n return;\n }\n // Only the length is judged: whether a pattern COMPILES is a question for\n // the reference's regular-expression engine, which this port is not.\n if (matches !== '' && byteLen(matches) > L.maxPatternLength) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n `the pattern in matches must be a valid regular expression of at most ${L.maxPatternLength} characters`,\n );\n }\n // approx needs its tolerance, and tolerance belongs to approx alone.\n if (\n (approx !== undefined) !== (tolerance !== undefined) ||\n (tolerance !== undefined && (Number.isNaN(tolerance) || tolerance < 0))\n ) {\n this.err(\n 'example_field_matcher_invalid',\n path,\n 'approx needs a tolerance (a number, zero or more) beside it, and tolerance is only for approx',\n );\n }\n }\n\n // -- checkpoints ------------------------------------------------------\n\n private validateCheckpoints(path: string, label: string, cps: unknown): void {\n if (!isRecord(cps) || Object.keys(cps).length === 0) return;\n const stepsRaw = own(this.flow as Rec, 'steps');\n const steps: Rec = isRecord(stepsRaw) ? stepsRaw : {};\n const stepIds = sortedKeys(steps);\n for (const id of sortedKeys(cps)) {\n const cpath = `${path}.checkpoints.${id}`;\n const step = own(steps, id);\n if (!isRecord(step)) {\n this.err(\n 'example_checkpoint_step_unknown',\n cpath,\n `example ${q(label)}: checkpoint ${q(id)} is not a step of this flow (steps: ${stepIds.join(', ')})`,\n SUGGESTION_CHECKPOINT,\n );\n continue;\n }\n const next = own(step, 'next');\n if (has(step, 'for_each') || has(step, 'loop') || (isRecord(next) && has(next, 'parallel'))) {\n this.err(\n 'example_checkpoint_step_composite',\n cpath,\n `example ${q(label)}: step ${q(id)} repeats or branches, so there is no single result to check; put the checkpoint on a plain step or check the final output`,\n );\n continue;\n }\n const cp = own(cps, id);\n if (cp === null || cp === undefined) {\n this.validateExpectation(cpath, label, {}, 'checkpoint', id);\n } else if (isRecord(cp)) {\n this.validateExpectation(cpath, label, cp, 'checkpoint', id);\n }\n }\n }\n\n // -- variants ---------------------------------------------------------\n\n private validateVariants(\n i: number,\n path: string,\n label: string,\n ex: Rec,\n hasInput: boolean,\n baseInput: Rec | null,\n ): void {\n const L = EXAMPLES.limits;\n const variants = own(ex, 'variants');\n if (!Array.isArray(variants) || variants.length === 0) return;\n if (variants.length > L.maxVariants) {\n this.err(\n 'example_variants_too_many',\n `${path}.variants`,\n `example ${q(label)} has ${variants.length} variants; the limit is ${L.maxVariants}`,\n );\n }\n const seen = new Set<string>();\n variants.forEach((v: unknown, j: number) => {\n if (!isRecord(v)) return;\n const vpath = `examples[${i}].variants[${j}]`;\n const vid = this.s(v, 'id', vpath);\n const vlabel = vid === '' ? `#${j + 1}` : vid;\n const both = `${label}/${vlabel}`;\n\n if (!EXAMPLES.idPattern.test(vid)) {\n this.err(\n 'example_variant_id_invalid',\n `${vpath}.id`,\n `variant id ${q(vid)} of example ${q(label)} is not valid: use lower-case letters, digits and underscores, starting with a letter (2 to 48 characters)`,\n SUGGESTION_ID,\n );\n } else if (seen.has(vid)) {\n this.err(\n 'example_variant_id_duplicate',\n `${vpath}.id`,\n `variant id ${q(vid)} is used twice in example ${q(label)}`,\n );\n }\n seen.add(vid);\n\n const origin = this.s(v, 'origin', vpath);\n if (origin === ORIGIN_NONE || !EXAMPLES.origins.has(origin)) {\n this.err(\n 'example_variant_origin_invalid',\n `${vpath}.origin`,\n `variant ${q(vlabel)} of example ${q(label)} has origin ${q(origin)}; use author (a person wrote or approved it) or synthetic (generated)`,\n );\n }\n const vtitleN = runeCount(this.s(v, 'title', vpath));\n if (vtitleN > L.titleMaxRunes) {\n this.err(\n 'example_title_too_long',\n `${vpath}.title`,\n `example ${q(both)} title is ${vtitleN} characters; the limit is ${L.titleMaxRunes}`,\n );\n }\n const vguidanceN = runeCount(this.s(v, 'guidance', vpath));\n if (vguidanceN > L.maxGuidanceRunes) {\n this.err(\n 'example_guidance_too_long',\n `${vpath}.guidance`,\n `example ${q(both)} guidance is ${vguidanceN} characters; the limit is ${L.maxGuidanceRunes}`,\n );\n }\n const provN = runeCount(this.s(v, 'provenance', vpath));\n if (provN > L.maxProvenanceRunes) {\n this.err(\n 'example_notes_too_long',\n `${vpath}.provenance`,\n `example ${q(both)} notes are ${provN} characters; the limit is ${L.maxProvenanceRunes}`,\n );\n }\n this.validateWeight(`${vpath}.weight`, both, numberOf(own(v, 'weight')));\n\n const patch = own(v, 'input_patch');\n const patchRec: Rec | null = isRecord(patch) ? patch : null;\n const hasPatch = patchRec !== null && Object.keys(patchRec).length > 0;\n const hasRef = has(v, 'input_ref');\n if (hasPatch && hasRef) {\n this.err(\n 'example_variant_input_conflict',\n vpath,\n `variant ${q(vlabel)} of example ${q(label)} sets both input_patch and input_ref; use one`,\n );\n } else if (!hasPatch && !hasRef && !has(v, 'expected')) {\n this.err(\n 'example_variant_empty',\n vpath,\n `variant ${q(vlabel)} of example ${q(label)} changes neither the input nor the expectation`,\n );\n }\n const refRec = own(v, 'input_ref');\n if (isRecord(refRec)) {\n this.validateFileRef(`${vpath}.input_ref`, this.fileRefOf(refRec, `${vpath}.input_ref`));\n }\n if (hasPatch && patchRec !== null) {\n if (!hasInput) {\n this.warn(\n 'example_variant_unchecked',\n `${vpath}.input_patch`,\n `variant ${q(vlabel)} of example ${q(label)} cannot be checked: its parent takes its input from input_ref.`,\n );\n } else if (baseInput !== null) {\n this.checkVariantPatch(vpath, label, vlabel, baseInput, patchRec);\n }\n }\n const expected = own(v, 'expected');\n if (isRecord(expected)) {\n this.validateExpectation(`${vpath}.expected`, both, expected, 'final', '');\n }\n });\n }\n\n /**\n * Judge the PATCHED input like a live run, and report a secret the patch\n * itself supplies. A null patch value deleting a secret is fine.\n */\n private checkVariantPatch(\n vpath: string,\n label: string,\n vlabel: string,\n base: Rec,\n patch: Rec,\n ): void {\n const schema = own(this.flow as Rec, 'input_schema');\n if (isRecord(schema)) {\n for (const f of this.schemaFields(schema)) {\n if (f.type !== TYPE_SECRET) continue;\n const val = own(patch, f.name);\n if (val !== undefined && val !== null) {\n this.err(\n 'example_secret_value',\n `${vpath}.input_patch.${f.name}`,\n `example ${q(`${label}/${vlabel}`)} gives a value for ${q(f.name)}, which is a secret field. Examples are saved inside the flow and are never allowed to hold secrets; remove it. The person running the evaluation is asked for it at run time.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n }\n }\n const patched = applyExamplePatch(base, patch);\n // A scratch walker, so the variant wording replaces the example wording and\n // the parent's own secret findings are not reported twice.\n const scratch = new Walker(this.flow, this.issues);\n scratch.checkInput(\n `${vpath}.input_patch`,\n `${label}/${vlabel}`,\n patched,\n 'example_variant_input_invalid',\n );\n for (const f of scratch.findings) {\n if (f.code === 'example_secret_value') continue;\n this.findings.push(f);\n }\n }\n\n // -- credential-shaped literals ----------------------------------------\n\n private scanSecretLike(i: number, path: string, ex: Rec): void {\n const emit = (field: string, s: string): void => {\n const name = secretMatch(s);\n if (name !== '') {\n this.err(\n 'example_secret_like_value',\n field,\n `${field} looks like a credential (${name}). Examples are saved in the flow definition and must never contain keys or tokens. Replace it with a made-up value.`,\n SUGGESTION_SECRET_VALUE,\n );\n }\n };\n emit(`${path}.title`, this.s(ex, 'title', path));\n emit(`${path}.guidance`, this.s(ex, 'guidance', path));\n emit(`${path}.notes`, this.s(ex, 'notes', path));\n const input = own(ex, 'input');\n if (isRecord(input)) scanLeaves(`${path}.input`, input, 0, emit);\n const expected = own(ex, 'expected');\n if (isRecord(expected)) this.scanExpectationLeaves(`${path}.expected`, expected, emit);\n const cps = own(ex, 'checkpoints');\n if (isRecord(cps)) {\n for (const id of sortedKeys(cps)) {\n const cp = own(cps, id);\n if (isRecord(cp)) this.scanExpectationLeaves(`${path}.checkpoints.${id}`, cp, emit);\n }\n }\n const variants = own(ex, 'variants');\n if (Array.isArray(variants)) {\n variants.forEach((v: unknown, j: number) => {\n if (!isRecord(v)) return;\n const vpath = `examples[${i}].variants[${j}]`;\n emit(`${vpath}.title`, this.s(v, 'title', vpath));\n emit(`${vpath}.guidance`, this.s(v, 'guidance', vpath));\n emit(`${vpath}.provenance`, this.s(v, 'provenance', vpath));\n scanLeaves(`${vpath}.input_patch`, own(v, 'input_patch'), 0, emit);\n const vexp = own(v, 'expected');\n if (isRecord(vexp)) this.scanExpectationLeaves(`${vpath}.expected`, vexp, emit);\n });\n }\n }\n\n private scanExpectationLeaves(\n path: string,\n e: Rec,\n emit: (field: string, s: string) => void,\n ): void {\n emit(`${path}.rubric`, this.s(e, 'rubric', path));\n const reference = own(e, 'reference');\n if (isRecord(reference)) {\n emit(`${path}.reference.text`, this.s(reference, 'text', `${path}.reference`));\n }\n this.stringList(own(e, 'must_not'), `${path}.must_not`).forEach((s, j) =>\n emit(`${path}.must_not[${j}]`, s),\n );\n this.stringList(own(e, 'must_not_contain'), `${path}.must_not_contain`).forEach((s, j) =>\n emit(`${path}.must_not_contain[${j}]`, s),\n );\n const fields = own(e, 'fields');\n if (isRecord(fields)) {\n for (const key of sortedKeys(fields)) {\n const m = own(fields, key);\n if (!isRecord(m)) continue;\n const fpath = `${path}.fields.${key}`;\n scanLeaves(`${fpath}.equals`, own(m, 'equals'), 0, emit);\n emit(`${fpath}.contains`, this.s(m, 'contains', fpath));\n emit(`${fpath}.not_contains`, this.s(m, 'not_contains', fpath));\n const oneOf = own(m, 'one_of');\n if (Array.isArray(oneOf)) {\n oneOf.forEach((one: unknown, j: number) =>\n scanLeaves(`${fpath}.one_of[${j}]`, one, 0, emit),\n );\n }\n }\n }\n scanLeaves(`${path}.exact`, own(e, 'exact'), 0, emit);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Free helpers\n// ---------------------------------------------------------------------------\n\ninterface SchemaField {\n name: string;\n type: string;\n required: boolean;\n enumValues: string[];\n visibleWhen: { field: string; equals: unknown; in: unknown[] } | null;\n}\n\ninterface RunFailure {\n field: string;\n message: string;\n /** The failure is \"required field missing\" (a required secret is then not an error). */\n required: boolean;\n}\n\nfunction scoreInRange(v: number): boolean {\n return !Number.isNaN(v) && v >= EXAMPLES.limits.minScoreMin && v <= EXAMPLES.limits.minScoreMax;\n}\n\n/** Go's `strings.EqualFold`, by simple case folding of each code point. */\nfunction equalFold(a: string, b: string): boolean {\n const ca = [...a];\n const cb = [...b];\n if (ca.length !== cb.length) return false;\n return ca.every((c, i) => {\n const d = cb[i] as string;\n return c === d || c.toLowerCase() === d.toLowerCase() || c.toUpperCase() === d.toUpperCase();\n });\n}\n\n/** The name of the first credential shape `s` resembles, or \"\". */\nfunction secretMatch(s: string): string {\n for (const p of EXAMPLES.secretPatterns) {\n if (p.re.test(s)) return p.name;\n }\n return '';\n}\n\nfunction scanLeaves(\n path: string,\n v: unknown,\n depth: number,\n emit: (field: string, s: string) => void,\n): void {\n if (depth > MAX_RECURSION_DEPTH) return;\n if (isRecord(v)) {\n for (const k of sortedKeys(v)) scanLeaves(`${path}.${k}`, v[k], depth + 1, emit);\n return;\n }\n if (typeof v === 'string') emit(path, v);\n else if (Array.isArray(v)) {\n v.forEach((item: unknown, i: number) => scanLeaves(`${path}[${i}]`, item, depth + 1, emit));\n }\n}\n\n/** The byte length of a value's JSON, or null where it cannot be encoded. */\nfunction jsonBytes(v: unknown): number | null {\n try {\n const text = JSON.stringify(v);\n return text === undefined ? null : byteLen(text);\n } catch {\n return null;\n }\n}\n\n/**\n * The size of the whole block as JSON, measured the way the reference measures\n * its typed structs: empty values are omitted. Measured over the raw document\n * with empties dropped, so it is never larger than the reference's count.\n */\nfunction blockBytes(examples: unknown[]): number | null {\n try {\n const text = JSON.stringify(normalize(examples, 0), function (this: unknown, _k, v: unknown) {\n if (Array.isArray(this)) return v;\n if (v === null || v === '' || v === false) return undefined;\n if (Array.isArray(v) && v.length === 0) return undefined;\n return v;\n });\n return text === undefined ? null : byteLen(text);\n } catch {\n return null;\n }\n}\n\nfunction isVisible(f: SchemaField, input: Rec): boolean {\n const vw = f.visibleWhen;\n if (vw === null) return true;\n if (!Object.prototype.hasOwnProperty.call(input, vw.field)) return false;\n const dep = input[vw.field];\n if (vw.equals !== undefined && vw.equals !== null) return valuesEqual(dep, vw.equals);\n return vw.in.some((candidate) => valuesEqual(dep, candidate));\n}\n\n/** Cross-kind matches are not equal: `true` is never `\"true\"`. */\nfunction valuesEqual(a: unknown, b: unknown): boolean {\n const aNil = a === null || a === undefined;\n const bNil = b === null || b === undefined;\n if (aNil || bNil) return aNil && bNil;\n if (typeof a === 'number') return typeof b === 'number' && a === b;\n if (typeof a === 'boolean') return typeof b === 'boolean' && a === b;\n if (typeof a === 'string') return typeof b === 'string' && a === b;\n return false;\n}\n\nfunction mismatch(f: SchemaField, expected: string): RunFailure {\n return {\n field: f.name,\n message: `input field ${q(f.name)} is not a valid ${expected}`,\n required: false,\n };\n}\n\n/** The narrowed kind / enum judgement of one present value. */\nfunction inputValueFailures(f: SchemaField, raw: unknown): RunFailure[] {\n switch (f.type) {\n case TYPE_STRING:\n case TYPE_MULTILINE:\n case TYPE_SECRET:\n return typeof raw === 'string' ? [] : [mismatch(f, TYPE_STRING)];\n case TYPE_NUMBER:\n // Any YAML number: the reference also takes NaN and the infinities here.\n return typeof raw === 'number' ? [] : [mismatch(f, TYPE_NUMBER)];\n case TYPE_BOOL:\n return typeof raw === 'boolean' ? [] : [mismatch(f, TYPE_BOOL)];\n case TYPE_ENUM:\n if (typeof raw !== 'string') return [mismatch(f, TYPE_ENUM)];\n if (f.enumValues.includes(raw)) return [];\n return [\n {\n field: f.name,\n message: `input field ${q(f.name)} value ${q(raw)} is not one of [${f.enumValues.join(',')}]`,\n required: false,\n },\n ];\n case TYPE_ARRAY_OF_STRINGS: {\n if (!Array.isArray(raw)) return [mismatch(f, TYPE_ARRAY_OF_STRINGS)];\n const out: RunFailure[] = [];\n raw.forEach((item: unknown, i: number) => {\n if (typeof item !== 'string') {\n out.push({\n field: f.name,\n message: `input field ${q(f.name)} index ${i} is not a string`,\n required: false,\n });\n }\n });\n return out;\n }\n case TYPE_DATE:\n // Kind only: the YYYY-MM-DD shape and the calendar are not judged here.\n return typeof raw === 'string' ? [] : [mismatch(f, TYPE_DATE)];\n case TYPE_FILE: {\n if (typeof raw === 'string') return raw === '' ? [mismatch(f, TYPE_FILE)] : [];\n if (isRecord(raw)) {\n const ref = own(raw, FILE_REF_KEY);\n return typeof ref === 'string' && ref !== '' ? [] : [mismatch(f, TYPE_FILE)];\n }\n return [mismatch(f, TYPE_FILE)];\n }\n default:\n return [];\n }\n}\n\n// ---------------------------------------------------------------------------\n// Entry\n// ---------------------------------------------------------------------------\n\n/**\n * Judge the flow's `examples:` block. An absent or empty block is no findings:\n * every flow that predates the grammar is unchanged.\n */\nexport function validateExamples(flow: Flow, issues: Issues): void {\n const examples = (flow as Rec)[KEY_EXAMPLES];\n if (!Array.isArray(examples) || examples.length === 0) return;\n const walker = new Walker(flow, issues);\n walker.run(examples);\n for (const f of walker.findings) {\n const issue = {\n field: f.field,\n message: f.message,\n code: f.code,\n ...(f.suggestion !== undefined ? { suggestion: f.suggestion } : {}),\n };\n if (f.severity === 'error') issues.error(issue);\n else issues.warn(issue);\n }\n}\n\n/** Every severity the walker emits, by code — held to the spec's table by a test. */\nexport function exampleCodeSeverities(): Readonly<Record<string, Severity>> {\n return EXAMPLES.codes;\n}\n","// Public API for the AIgentFlow flow validator.\n//\n// Static, offline validation of flow YAML. Reproduces the *static* verdicts of\n// the AIgentFlow Go reference validator (Validator.ValidateFlowWithDetails +\n// FlowParser.ValidateFlow). Runtime concerns — credentials, the compliance\n// catalog, and template field resolution — are out of scope. See PARITY.md.\n\nimport type { Flow, ValidateOptions, ValidationIssue, ValidationResult } from './types.js';\nimport { parseFlow, type ParseOutput } from './parse.js';\nimport { Issues } from './validators/util.js';\nimport { validateBasicStructure } from './validators/basicStructure.js';\nimport { validateExecutors, validateRemovedFlowKeys } from './validators/executors.js';\nimport { validateQuerySchema } from './validators/querySchema.js';\nimport { validateResponseExpectations } from './validators/responseExpectation.js';\nimport { validateErrorStrategies } from './validators/errorStrategy.js';\nimport { validateConnectivity } from './validators/connectivity.js';\nimport { validateNextLogic } from './validators/nextLogic.js';\nimport { validateExpressionFunctions } from './validators/expressionFunctions.js';\nimport { validateLoopForEachThrottle } from './validators/loopForEachThrottle.js';\nimport { validateOrchestratorCampaign } from './validators/orchestratorCampaign.js';\nimport { validateCredentialBindings } from './validators/credentialBindings.js';\nimport { validateInputSchema } from './validators/inputSchema.js';\nimport { validateReservedInputNames } from './validators/reservedInputs.js';\nimport { validateOutputSchemas } from './validators/outputSchema.js';\nimport { validateQualityGates } from './validators/qualityGate.js';\nimport { validateTemplates } from './validators/templates.js';\nimport { validateProcessingOperations } from './validators/processingOperations.js';\nimport { validateStepMaxDuration } from './validators/stepMaxDuration.js';\nimport { validateRetiredKeys } from './validators/retiredKeys.js';\nimport { validateFlowDataKeys } from './validators/flowDataKeys.js';\nimport { validateSaveDoorExtras } from './validators/saveDoor.js';\nimport { validateUnknownKeys } from './validators/unknownKeys.js';\nimport { validateExecutorConfigEnvScopes } from './validators/executorConfigEnv.js';\nimport { validateServerOwnedQueryKeys } from './validators/serverOwnedQueryKeys.js';\nimport { validateCredentialEndpointPairing } from './validators/credentialEndpoint.js';\nimport { validateOrchestratorExons } from './validators/exons.js';\nimport { validateResidencyEnforcement } from './validators/complianceResidency.js';\nimport { validateExamples } from './validators/examples.js';\nimport type { ScalarSources } from './validators/util.js';\n\nexport { SPEC_VERSION, INPUT_SCHEMA_VERSION } from './spec/index.js';\nexport { parseFlow } from './parse.js';\nexport type { ParseOutput } from './parse.js';\nexport type {\n Flow,\n ValidateOptions,\n ValidationIssue,\n ValidationResult,\n ValidationSummary,\n Severity,\n} from './types.js';\n\nfunction countStepsWithErrors(errors: ValidationIssue[]): number {\n const ids = new Set<string>();\n for (const e of errors) {\n if (e.stepId) ids.add(e.stepId);\n }\n return ids.size;\n}\n\n/**\n * Validate an already-parsed flow object. Use this when you have a plain\n * object (e.g. from your own YAML/JSON loader); use {@link validateFlow} to\n * parse YAML text and validate in one step.\n */\nexport function validateFlowObject(flow: unknown, opts: ValidateOptions = {}): ValidationResult {\n return validateParsed(flow, opts, undefined);\n}\n\n// `sources` carries the source spelling of number/boolean scalars, which only a\n// YAML text has; every rule reads a Go `string` field through\n// `issues.stringAt`, which consults it. Without it (validateFlowObject) a\n// number is judged by its JavaScript rendering — PARITY.md divergence #13.\nfunction validateParsed(\n flow: unknown,\n opts: ValidateOptions,\n sources: ScalarSources | undefined,\n): ValidationResult {\n const issues = new Issues(sources);\n\n if (flow === null || typeof flow !== 'object' || Array.isArray(flow)) {\n issues.error({\n field: '',\n message: 'Flow must be a mapping (object) at the top level',\n code: 'invalid_flow_root',\n });\n return {\n valid: false,\n errors: issues.errors,\n warnings: issues.warnings,\n summary: {\n totalSteps: 0,\n validSteps: 0,\n errorCount: issues.errors.length,\n warningCount: issues.warnings.length,\n templatesFound: 0,\n templatesValid: 0,\n },\n };\n }\n\n const f = flow as Flow;\n\n validateBasicStructure(f, issues);\n validateRetiredKeys(f, issues);\n validateRemovedFlowKeys(f, issues);\n validateExecutors(f, issues);\n validateQuerySchema(f, issues);\n validateResponseExpectations(f, issues);\n validateErrorStrategies(f, issues);\n validateConnectivity(f, issues);\n validateNextLogic(f, issues);\n validateExpressionFunctions(f, issues);\n validateLoopForEachThrottle(f, issues);\n validateOrchestratorCampaign(f, issues, opts);\n validateCredentialBindings(f, issues);\n validateInputSchema(f, issues);\n validateReservedInputNames(f, issues);\n validateOutputSchemas(f, issues);\n validateQualityGates(f, issues);\n validateProcessingOperations(f, issues);\n validateStepMaxDuration(f, issues);\n validateSaveDoorExtras(f, issues);\n validateExecutorConfigEnvScopes(f, issues);\n validateServerOwnedQueryKeys(f, issues);\n validateFlowDataKeys(f, issues);\n validateCredentialEndpointPairing(f, issues);\n validateExamples(f, issues);\n // The orchestrator's inline .exons frontmatter. A tag that cannot render\n // (`exons_attributes`) needs an .exons ENGINE to judge and is not judged here\n // at all — PARITY.md, divergence #16.\n validateOrchestratorExons(f, issues);\n validateResidencyEnforcement(f, issues);\n // Last among the structural rules: it skips a location another rule has\n // already reported with more specific advice.\n validateUnknownKeys(f, issues);\n const templateStats = validateTemplates(f, issues, opts);\n\n const totalSteps =\n f.steps && typeof f.steps === 'object' && !Array.isArray(f.steps)\n ? Object.keys(f.steps).length\n : 0;\n const errorCount = issues.errors.length;\n\n return {\n valid: errorCount === 0,\n errors: issues.errors,\n warnings: issues.warnings,\n summary: {\n totalSteps,\n validSteps: Math.max(0, totalSteps - countStepsWithErrors(issues.errors)),\n errorCount,\n warningCount: issues.warnings.length,\n templatesFound: templateStats.found,\n templatesValid: Math.max(0, templateStats.found - templateStats.syntaxErrors),\n },\n };\n}\n\n/**\n * Parse flow YAML text and validate it. Parse errors (syntax, duplicate keys)\n * are returned as `error`-severity issues; on a parse failure the structural\n * validators are skipped because there is no usable document.\n */\nexport function validateFlow(yamlText: string, opts: ValidateOptions = {}): ValidationResult {\n const parsed: ParseOutput = parseFlow(yamlText);\n\n if (parsed.parseErrors.length > 0 || parsed.flow === undefined) {\n return {\n valid: false,\n errors: parsed.parseErrors,\n warnings: parsed.parseWarnings,\n summary: {\n totalSteps: 0,\n validSteps: 0,\n errorCount: parsed.parseErrors.length,\n warningCount: parsed.parseWarnings.length,\n templatesFound: 0,\n templatesValid: 0,\n },\n };\n }\n\n const result = validateParsed(parsed.flow, opts, parsed.scalarSources);\n // Surface any non-fatal YAML warnings alongside the validation warnings.\n if (parsed.parseWarnings.length > 0) {\n result.warnings.unshift(...parsed.parseWarnings);\n result.summary.warningCount = result.warnings.length;\n }\n return result;\n}\n"]}