{"success":true,"codes":[{"code":"E1000","category":"Syntax","meaning":"The source contains invalid or incomplete syntax.","remedy":"Check the indicated token, separators, and numeric literals. Use integers without extra leading zeros or decimals with one decimal point."},{"code":"E1001","category":"Syntax","meaning":"An element selector has a missing or malformed position.","remedy":"Use a 1-based position such as ST(01) or ST->N1(02). Separate composite positions with a colon, as in ST->N9(07:02), not a decimal point."},{"code":"E1002","category":"Syntax","meaning":"A closing parenthesis, bracket, or brace is missing.","remedy":"Close the function call, expression, list, dictionary, or block before the next statement."},{"code":"E1101","category":"Syntax","meaning":"A dictionary entry is missing its value after the colon.","remedy":"Supply both parts of each key:value entry, for example {\"a\":\"x\"}."},{"code":"E1201","category":"Syntax","meaning":"A list literal has a missing item between commas.","remedy":"Remove the extra comma or supply a value, for example [1,2] or [1,\"\",2]."},{"code":"E1301","category":"Syntax","meaning":"A forEach dictionary projection is missing its value after the colon.","remedy":"Use a complete key:value projection, for example forEach(x in ST->N1 => x(01):x(02))."},{"code":"E1401","category":"Variables and types","meaning":"A referenced variable is not in scope.","remedy":"Define it before use and check the available names in the diagnostic. Loop variables are available only inside their loop."},{"code":"E1402","category":"Variables and types","meaning":"A value is in scope but has the wrong type for the operation.","remedy":"Use a list or dictionary where a collection is required: trim(\" A \") returns a string, while trim([\" A \"]) returns a list. A segment selection is iterable but is not a mutable list; project a list with forEach before add, set, or indexing. key/val require a supported collection binding."},{"code":"E1501","category":"Assignment","meaning":"A compound assignment targets an uninitialized or non-assignable variable.","remedy":"Initialize a separate user variable first, for example total = 0, then total += 1. Do not use compound assignment on an iterating segment binding."},{"code":"E1502","category":"Assignment","meaning":"A compound numeric assignment targets a non-numeric value.","remedy":"Assign a number or explicitly convert numeric text with toNumber before applying the compound operator."},{"code":"E1601","category":"X12 paths","meaning":"A segment path does not follow the transaction set's immediate-child structure.","remedy":"Start from ST or a segment variable and follow the available child segments listed in the diagnostic. Check the selected X12 version and transaction set."},{"code":"E1602","category":"X12 paths","meaning":"The logical HL descendant operator is used with an invalid source or target.","remedy":"Use >> HL from ST or an HL segment to follow HL01/HL02 parent links. Use -> for ordinary transaction-set structure navigation."},{"code":"E1701","category":"X12 elements","meaning":"An element or sub-element position is outside its valid range.","remedy":"Use the segment's 1-based element range and the composite's valid sub-element range. Start at 01, not 00."},{"code":"E1702","category":"X12 elements","meaning":"A direct segment element selector does not target the root ST segment.","remedy":"Use ST(n), a segment loop variable such as line(n), or a path starting at ST such as ST->N1(n)."},{"code":"E1703","category":"X12 elements","meaning":"An element selector or predicate has a missing or invalid position.","remedy":"Supply a valid 1-based position, for example ST(01), ST->N1(02), or ST->N1[01 == \"ST\"]."},{"code":"E1704","category":"X12 elements","meaning":"A sub-element was selected from an element that is not composite.","remedy":"Select the whole element without a colon, or choose a composite element from the X12 reference."},{"code":"E1801","category":"Variables and types","meaning":"A named string constant is unknown.","remedy":"Choose one of the available constants in the diagnostic, or use a quoted string literal for plain text."},{"code":"E1901","category":"Functions","meaning":"The function name is unknown.","remedy":"Check its spelling against the function reference. An embedded custom function must be registered in the FunctionRegistry."},{"code":"E1902","category":"Functions","meaning":"The function was called with an incorrect argument count.","remedy":"Match the required and optional arguments in the function signature."},{"code":"E2001","category":"X12 conversion","meaning":"decodeId expected an X12 identifier element.","remedy":"Select an ID-typed element whose code list should be decoded; do not pass ordinary text or another element type."},{"code":"E2002","category":"X12 conversion","meaning":"A selected X12 date element is empty in isoLocalDate.","remedy":"Supply a date or guard the conversion with isEmpty(...)."},{"code":"E2003","category":"X12 conversion","meaning":"A selected X12 date element is empty in unixTime.","remedy":"Supply a date or guard the conversion with isEmpty(...)."},{"code":"E2004","category":"X12 conversion","meaning":"A selected X12 time element is empty in unixTime.","remedy":"Supply a time or guard the conversion with isEmpty(...)."},{"code":"E2101","category":"Lists","meaning":"A list read uses an index outside the list's bounds.","remedy":"Use a zero-based index below the list length and check for an empty list before indexing."},{"code":"E2102","category":"Lists","meaning":"A list assignment uses an index outside the existing list.","remedy":"Replace an existing zero-based position. Use add(list, value) to append a new item."},{"code":"E2103","category":"Lists","meaning":"A list index is not a supported non-negative integer.","remedy":"Supply a numeric index such as 0, 1, or 2 within the supported integer range; do not use text or a negative value."},{"code":"E2104","category":"Lists","meaning":"A list index has a fractional value.","remedy":"Supply a whole-number index rather than a fractional decimal."},{"code":"E2201","category":"Collection projections","meaning":"A dictionary assignment uses a forEach without a dictionary projection.","remedy":"Use => with key:value, for example forEach(x in ST->N1 => x(01):x(02))."},{"code":"E2202","category":"Collection projections","meaning":"A list assignment uses a forEach without a value projection.","remedy":"Use => with a value, for example forEach(x in ST->N1 => x(02))."},{"code":"E2301","category":"Dictionaries","meaning":"A dictionary key is a collection rather than a scalar value.","remedy":"Use a scalar key such as \"sku\" or 1; project a single value from a collection first."},{"code":"E2302","category":"Dictionaries","meaning":"key cannot read an entry from an empty dictionary.","remedy":"Guard an empty dictionary or call key inside a loop over its entries."},{"code":"E2303","category":"Dictionaries","meaning":"val cannot read an entry from an empty dictionary.","remedy":"Guard an empty dictionary or call val inside a loop over its entries."},{"code":"E2304","category":"Dictionaries","meaning":"A nested assignment traverses a dictionary key that does not exist.","remedy":"Initialize intermediate dictionaries before assigning through their keys."},{"code":"E2305","category":"Dictionaries","meaning":"A nested assignment traverses or indexes a value that is neither a dictionary nor a list.","remedy":"Initialize the intermediate value as the intended collection before assigning through it."},{"code":"E2306","category":"Dictionaries","meaning":"An assignment through an iterating dictionary entry targets a different key.","remedy":"Replace the current entry's value using its existing key, or update the owning dictionary explicitly."},{"code":"E2401","category":"Numbers and conditions","meaning":"A variable cannot be converted to a number in an arithmetic context.","remedy":"Assign a numeric value or use toNumber on a supported single numeric value before arithmetic."},{"code":"E2402","category":"Numbers and conditions","meaning":"An expression or aggregate projection cannot be converted to a number.","remedy":"Select or produce a numeric value. Check empty selections and find results before using them in arithmetic or sumOf."},{"code":"E2501","category":"Numbers and conditions","meaning":"An expression is not a segment-element source.","remedy":"For an element selector, use ST, an X12 path, or a segment binding rather than an ordinary function result."},{"code":"E2502","category":"Numbers and conditions","meaning":"A relational comparison requires numeric operands.","remedy":"Use == or != to compare text, or toNumber(...) to explicitly convert numeric text before ordering it."},{"code":"E2503","category":"Numbers and conditions","meaning":"An arrow-filter relational comparison has non-numeric operands.","remedy":"Use ==, !=, %==, or %!= for string qualifiers. Use numeric values for <, >, <=, and >=."},{"code":"E2504","category":"Numbers and conditions","meaning":"A condition requires a boolean but received another type.","remedy":"Use a comparison or a boolean result. Strings, numbers, and collections are not implicitly true or false."},{"code":"E2601","category":"Selection and cardinality","meaning":"find matched more than one item.","remedy":"Tighten the predicate or use a collection-returning construct when several matches are valid."},{"code":"E2602","category":"Selection and cardinality","meaning":"find matched no item and has no default value.","remedy":"Provide a default or widen the predicate if absence is valid; otherwise correct the input."},{"code":"E2603","category":"Selection and cardinality","meaning":"find encountered an unsupported matched value type.","remedy":"Use supported mapper values in the source collection. If ordinary DSL values trigger this, retain the mapping and input as a reproducible defect."},{"code":"E2604","category":"Selection and cardinality","meaning":"A segment selection violates its !, ?, or + cardinality assertion.","remedy":"Use ! for exactly one, ? for zero or one, and + for at least one match. Tighten the predicate or change/remove the assertion when that multiplicity is intentional."},{"code":"E2701","category":"Qualifier helpers","meaning":"More than one segment was supplied to a single-segment helper.","remedy":"Use a loop variable or select a single segment before reading its qualifier/value pairs."},{"code":"E2702","category":"Qualifier helpers","meaning":"The first argument is not a segment or segment selection.","remedy":"Use qualifierValue(ST->PO1!, \"UP\", 6), not qualifierValue(\"PO1\", \"UP\", 6). Index an ordinary list to select its segment first."},{"code":"E2703","category":"Qualifier helpers","meaning":"The required qualifier is missing.","remedy":"Supply the qualifier or use qualifierValue(...) for optional data."},{"code":"E2704","category":"Qualifier helpers","meaning":"The qualifier occurs more than once in the segment.","remedy":"Correct duplicate source pairs or select an explicit element position."},{"code":"E2705","category":"Qualifier helpers","meaning":"The required segment argument is empty.","remedy":"Supply a segment or use qualifierValue(...) for optional data."},{"code":"E2706","category":"Qualifier helpers","meaning":"The matched qualifier has no paired value element beside it.","remedy":"Correct the first qualifier position or supply the paired element."},{"code":"E2707","category":"Qualifier helpers","meaning":"firstQualifierElement is not a positive whole 32-bit integer.","remedy":"Supply the 1-based position of the first qualifier, for example 6 for PO1 qualifier/value pairs."},{"code":"E2801","category":"Required values and aggregates","meaning":"required received an empty value, or an aggregate source has an unsupported type. This code has two existing meanings.","remedy":"Read the diagnostic's function label: for required, supply a non-empty value; for aggregate, use a segment path, element selection, list, or dictionary."},{"code":"E2802","category":"Collection projections","meaning":"A flatMap projection does not return a list.","remedy":"Return a list such as [item], an element selection, or a mapped forEach list. A segment selection is not a projected list."},{"code":"E2901","category":"Date formatting","meaning":"The input date cannot be parsed by formatDate.","remedy":"Supply a supported basic or ISO date, or an X12 date element."},{"code":"E2902","category":"Date formatting","meaning":"A selected X12 date element is empty in formatDate.","remedy":"Supply a date or guard the conversion with isEmpty(...)."},{"code":"E2903","category":"Date formatting","meaning":"The formatter pattern is invalid.","remedy":"Use a valid date formatter pattern, for example yyyy-MM-dd, and check literal quoting."},{"code":"E2904","category":"Date formatting","meaning":"The selected X12 element is not a date.","remedy":"Select a date field or pass supported date text instead."},{"code":"E2905","category":"Date formatting","meaning":"The output pattern requests fields unavailable in a date.","remedy":"Remove time-of-day or other unsupported fields from the pattern."},{"code":"E3001","category":"Expression mode","meaning":"Expression validation requires exactly one value-returning expression.","remedy":"Provide one expression without assignments or statement blocks. Use program mode for a full mapping."},{"code":"E3101","category":"UPC-A","meaning":"A code contains a character other than ASCII 0-9.","remedy":"Supply digits only, without spaces, signs, or separators."},{"code":"E3102","category":"UPC-A","meaning":"A code is neither 11 nor 12 characters long.","remedy":"Supply an 11-digit body or a complete 12-digit UPC-A code."},{"code":"E3103","category":"UPC-A","meaning":"The existing check digit does not match the first 11 digits.","remedy":"Correct the source UPC-A code; the function does not replace an incorrect digit."},{"code":"E3104","category":"UPC-A","meaning":"The argument is not a list of alphanumeric X12 elements.","remedy":"Pass an element selection such as ST->PO1(07). Scalar values and lists of strings are not accepted."},{"code":"E3201","category":"Text","meaning":"A list item is neither text nor an X12 element.","remedy":"Supply a flat list of text values or an X12 element selection."},{"code":"E3202","category":"Text","meaning":"The first argument is neither a string nor a list.","remedy":"Supply text, for example \"abc\", a text list, or an X12 element selection."},{"code":"E3203","category":"Text","meaning":"An index is not a populated whole 32-bit integer.","remedy":"Supply a whole-number index in the supported range."},{"code":"E3204","category":"Text","meaning":"An index or range is outside an input item's bounds.","remedy":"Check every item's length and keep the start at or before the end."},{"code":"E3205","category":"Text","meaning":"A segment selection was supplied where text or elements are required.","remedy":"Select elements, for example join(ST->PO1(07), \",\"), or explicitly project text first."},{"code":"E3301","category":"Lists","meaning":"join received a first argument that is not a list.","remedy":"Supply a list of values or an element selection."},{"code":"E3302","category":"Lists","meaning":"join received a collection as its separator.","remedy":"Supply a scalar separator such as \",\"."},{"code":"E3401","category":"Rounding","meaning":"The value cannot be converted to a populated number.","remedy":"Supply a number, numeric text, or one populated numeric element before rounding."},{"code":"E3402","category":"Rounding","meaning":"The scale is not a populated whole 32-bit integer.","remedy":"Supply an integer scale such as 2 for cents or -1 for tens."},{"code":"E3403","category":"Rounding","meaning":"The requested decimal scale cannot be represented.","remedy":"Choose a practical scale supported by decimal arithmetic."},{"code":"E3501","category":"Dictionaries","meaning":"containsKey received a first argument that is not a dictionary.","remedy":"Supply a dictionary and the scalar key to look up."},{"code":"E3601","category":"Structured output","meaning":"xml received a collection as its tag name.","remedy":"Supply a scalar tag name, for example xml(\"item\", value)."},{"code":"E3701","category":"X12 conversion","meaning":"decodeId received an argument that is not a list.","remedy":"Pass an X12 identifier element selection."},{"code":"E3702","category":"X12 conversion","meaning":"A decodeId list item is not an X12 element.","remedy":"Select identifier elements instead of passing ordinary strings."},{"code":"E3801","category":"X12 conversion","meaning":"isoLocalDate received an argument that is not a list.","remedy":"Pass an X12 date element selection."},{"code":"E3802","category":"X12 conversion","meaning":"An isoLocalDate list item is not an X12 date element.","remedy":"Select a date field; use formatDate(...) for text dates."},{"code":"E3901","category":"X12 conversion","meaning":"A unixTime argument is not a list of X12 elements.","remedy":"Pass paired X12 date and time element selections."},{"code":"E3902","category":"X12 conversion","meaning":"The date and time lists have different lengths.","remedy":"Select one time value for each date value."},{"code":"E3903","category":"X12 conversion","meaning":"A date-list element has the wrong X12 type.","remedy":"Pass date elements as the first unixTime argument."},{"code":"E3904","category":"X12 conversion","meaning":"A time-list element has the wrong X12 type.","remedy":"Pass time elements as the second unixTime argument."},{"code":"E4001","category":"Location helpers","meaning":"A toLatLong argument is not a list of X12 elements.","remedy":"Select paired location identifier and qualifier elements."},{"code":"E4002","category":"Location helpers","meaning":"The location identifier and qualifier lists have different lengths.","remedy":"Select one qualifier for each location identifier."},{"code":"E4003","category":"Location helpers","meaning":"A location qualifier is not an identifier element with definition 309.","remedy":"Pass the X12 Location Qualifier element as the second toLatLong argument."},{"code":"E4101","category":"ISO 6346","meaning":"An argument is not a list of alphanumeric X12 elements.","remedy":"Select the equipment initial and number elements."},{"code":"E4102","category":"ISO 6346","meaning":"The equipment initial and number lists have different lengths.","remedy":"Select one equipment number for each initial."},{"code":"E4103","category":"ISO 6346","meaning":"The element definitions are not 206 and 207.","remedy":"Pass Equipment Initial first and Equipment Number second."},{"code":"E4104","category":"ISO 6346","meaning":"The combined identifier is neither 10 nor 11 characters long.","remedy":"Supply the 10-character body with an optional check digit."},{"code":"E4105","category":"ISO 6346","meaning":"The body contains a character outside A-Z and 0-9.","remedy":"Supply uppercase letters and digits without spaces or punctuation."},{"code":"E4201","category":"ISO 6346","meaning":"decodeIso6346 received an argument that is not a list.","remedy":"Pass an X12 equipment-type element selection."},{"code":"E4202","category":"ISO 6346","meaning":"A decodeIso6346 list item is not an X12 identifier element.","remedy":"Select an ID-typed equipment-type element."},{"code":"E4203","category":"ISO 6346","meaning":"The selected element does not have definition 24.","remedy":"Select Equipment Type (element 24) before decoding."},{"code":"E4301","category":"Structured output","meaning":"A list or dictionary refers back to itself during toJson serialization.","remedy":"Remove the circular reference. Reusing the same collection in separate branches is allowed."},{"code":"E4401","category":"Structured output","meaning":"A list or dictionary refers back to itself during set conversion.","remedy":"Remove the circular reference before converting to a set."},{"code":"E4501","category":"X12 conversion","meaning":"The identifier definition is not a populated whole 32-bit integer.","remedy":"Supply an integer X12 identifier definition number."},{"code":"E4601","category":"Number conversion","meaning":"The value is not a supported number or numeric text.","remedy":"For example, toNumber(\"EA\") fails; provide a numeric value instead."},{"code":"E4602","category":"Number conversion","meaning":"The value or selection is empty.","remedy":"Guard missing data or explicitly supply a default, for example toNumber(firstNonEmpty([], \"0\"))."},{"code":"E4603","category":"Number conversion","meaning":"More than one value was supplied.","remedy":"Select one item, project each item with forEach, or aggregate the collection before conversion."},{"code":"E4701","category":"Ordering","meaning":"The sorting key is not a number, text, or single X12 element.","remedy":"Project one scalar key, for example orderBy(n in [1] => n), rather than => [n]."},{"code":"E4702","category":"Ordering","meaning":"Numeric and text keys are mixed in one sort.","remedy":"Use one key type throughout; for numeric order, explicitly convert numeric text with toNumber."},{"code":"E4703","category":"Ordering","meaning":"The direction is not the string \"asc\" or \"desc\".","remedy":"Choose \"asc\" for ascending or \"desc\" for descending order."},{"code":"E4801","category":"Splitting text","meaning":"The input is not text or a single text/X12 element.","remedy":"For example, split(123, \",\") fails; use split(\"123\", \",\") for text."},{"code":"E4802","category":"Splitting text","meaning":"An input list or selection contains zero or multiple values.","remedy":"Use forEach or flatMap to split each input explicitly, or select one populated item."},{"code":"E4803","category":"Splitting text","meaning":"The separator is empty or is not a string.","remedy":"Use a non-empty literal separator, for example split(\"A,B\", \",\")."}]}