@aster-cloud/aster-lang-ts 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/dist/scripts/generate_error_codes.js +49 -6
  2. package/dist/scripts/generate_error_codes.js.map +1 -1
  3. package/dist/src/ai/providers/openai.d.ts +10 -0
  4. package/dist/src/ai/providers/openai.d.ts.map +1 -1
  5. package/dist/src/ai/providers/openai.js +4 -0
  6. package/dist/src/ai/providers/openai.js.map +1 -1
  7. package/dist/src/config/lexicons/regex-guard.d.ts.map +1 -1
  8. package/dist/src/config/lexicons/regex-guard.js +128 -0
  9. package/dist/src/config/lexicons/regex-guard.js.map +1 -1
  10. package/dist/src/core/interpreter.d.ts.map +1 -1
  11. package/dist/src/core/interpreter.js +221 -27
  12. package/dist/src/core/interpreter.js.map +1 -1
  13. package/dist/src/cst/cst_builder.js +0 -14
  14. package/dist/src/cst/cst_builder.js.map +1 -1
  15. package/dist/src/cst/cst_printer.d.ts.map +1 -1
  16. package/dist/src/cst/cst_printer.js +20 -3
  17. package/dist/src/cst/cst_printer.js.map +1 -1
  18. package/dist/src/diagnostics/error_codes.d.ts +3 -3
  19. package/dist/src/diagnostics/error_codes.d.ts.map +1 -1
  20. package/dist/src/diagnostics/error_codes.js +509 -78
  21. package/dist/src/diagnostics/error_codes.js.map +1 -1
  22. package/dist/src/formatter.d.ts +7 -0
  23. package/dist/src/formatter.d.ts.map +1 -1
  24. package/dist/src/formatter.js +175 -5
  25. package/dist/src/formatter.js.map +1 -1
  26. package/dist/src/frontend/canonicalizer.d.ts.map +1 -1
  27. package/dist/src/frontend/canonicalizer.js +47 -6
  28. package/dist/src/frontend/canonicalizer.js.map +1 -1
  29. package/dist/src/frontend/lexer.d.ts +2 -1
  30. package/dist/src/frontend/lexer.d.ts.map +1 -1
  31. package/dist/src/frontend/lexer.js +10 -3
  32. package/dist/src/frontend/lexer.js.map +1 -1
  33. package/dist/src/frontend/transformers.d.ts.map +1 -1
  34. package/dist/src/frontend/transformers.js +50 -3
  35. package/dist/src/frontend/transformers.js.map +1 -1
  36. package/dist/src/lower_to_core.js +101 -4
  37. package/dist/src/lower_to_core.js.map +1 -1
  38. package/dist/src/lsp/canonicalize-options.d.ts +26 -0
  39. package/dist/src/lsp/canonicalize-options.d.ts.map +1 -0
  40. package/dist/src/lsp/canonicalize-options.js +14 -0
  41. package/dist/src/lsp/canonicalize-options.js.map +1 -0
  42. package/dist/src/lsp/completion.d.ts.map +1 -1
  43. package/dist/src/lsp/completion.js +22 -4
  44. package/dist/src/lsp/completion.js.map +1 -1
  45. package/dist/src/lsp/server.js +29 -1
  46. package/dist/src/lsp/server.js.map +1 -1
  47. package/dist/src/lsp/tenant-init.d.ts +55 -0
  48. package/dist/src/lsp/tenant-init.d.ts.map +1 -0
  49. package/dist/src/lsp/tenant-init.js +88 -0
  50. package/dist/src/lsp/tenant-init.js.map +1 -0
  51. package/dist/src/mapping/candidate-generator.d.ts +84 -0
  52. package/dist/src/mapping/candidate-generator.d.ts.map +1 -0
  53. package/dist/src/mapping/candidate-generator.js +114 -0
  54. package/dist/src/mapping/candidate-generator.js.map +1 -0
  55. package/dist/src/mapping/entity-proposer.d.ts +85 -0
  56. package/dist/src/mapping/entity-proposer.d.ts.map +1 -0
  57. package/dist/src/mapping/entity-proposer.js +162 -0
  58. package/dist/src/mapping/entity-proposer.js.map +1 -0
  59. package/dist/src/mapping/mapping-ir.d.ts +85 -0
  60. package/dist/src/mapping/mapping-ir.d.ts.map +1 -0
  61. package/dist/src/mapping/mapping-ir.js +195 -0
  62. package/dist/src/mapping/mapping-ir.js.map +1 -0
  63. package/dist/src/mapping/proof-ir.d.ts +125 -0
  64. package/dist/src/mapping/proof-ir.d.ts.map +1 -0
  65. package/dist/src/mapping/proof-ir.js +48 -0
  66. package/dist/src/mapping/proof-ir.js.map +1 -0
  67. package/dist/src/mapping/quantity-ir.d.ts +93 -0
  68. package/dist/src/mapping/quantity-ir.d.ts.map +1 -0
  69. package/dist/src/mapping/quantity-ir.js +151 -0
  70. package/dist/src/mapping/quantity-ir.js.map +1 -0
  71. package/dist/src/mapping/source-ir.d.ts +82 -0
  72. package/dist/src/mapping/source-ir.d.ts.map +1 -0
  73. package/dist/src/mapping/source-ir.js +231 -0
  74. package/dist/src/mapping/source-ir.js.map +1 -0
  75. package/dist/src/nodeid/change-impact.d.ts +77 -0
  76. package/dist/src/nodeid/change-impact.d.ts.map +1 -0
  77. package/dist/src/nodeid/change-impact.js +132 -0
  78. package/dist/src/nodeid/change-impact.js.map +1 -0
  79. package/dist/src/nodeid/node-id-map.d.ts +69 -0
  80. package/dist/src/nodeid/node-id-map.d.ts.map +1 -0
  81. package/dist/src/nodeid/node-id-map.js +193 -0
  82. package/dist/src/nodeid/node-id-map.js.map +1 -0
  83. package/dist/src/parser/decl-parser.d.ts.map +1 -1
  84. package/dist/src/parser/decl-parser.js +10 -4
  85. package/dist/src/parser/decl-parser.js.map +1 -1
  86. package/dist/src/parser/expr-stmt-parser.d.ts.map +1 -1
  87. package/dist/src/parser/expr-stmt-parser.js +36 -24
  88. package/dist/src/parser/expr-stmt-parser.js.map +1 -1
  89. package/dist/src/parser/span-utils.d.ts +25 -0
  90. package/dist/src/parser/span-utils.d.ts.map +1 -1
  91. package/dist/src/parser/span-utils.js +43 -0
  92. package/dist/src/parser/span-utils.js.map +1 -1
  93. package/dist/src/parser/type-parser.d.ts.map +1 -1
  94. package/dist/src/parser/type-parser.js +21 -0
  95. package/dist/src/parser/type-parser.js.map +1 -1
  96. package/dist/src/typecheck/expression.d.ts.map +1 -1
  97. package/dist/src/typecheck/expression.js +26 -0
  98. package/dist/src/typecheck/expression.js.map +1 -1
  99. package/dist/test/fuzz/fuzz.test.js +62 -2
  100. package/dist/test/fuzz/fuzz.test.js.map +1 -1
  101. package/dist/test/unit/call-arity.test.d.ts +2 -0
  102. package/dist/test/unit/call-arity.test.d.ts.map +1 -0
  103. package/dist/test/unit/call-arity.test.js +71 -0
  104. package/dist/test/unit/call-arity.test.js.map +1 -0
  105. package/dist/test/unit/canonicalizer/canonicalizer.test.js +42 -4
  106. package/dist/test/unit/canonicalizer/canonicalizer.test.js.map +1 -1
  107. package/dist/test/unit/canonicalizer/line-preservation.test.d.ts +2 -0
  108. package/dist/test/unit/canonicalizer/line-preservation.test.d.ts.map +1 -0
  109. package/dist/test/unit/canonicalizer/line-preservation.test.js +71 -0
  110. package/dist/test/unit/canonicalizer/line-preservation.test.js.map +1 -0
  111. package/dist/test/unit/canonicalizer/marker-restore-linear.test.d.ts +2 -0
  112. package/dist/test/unit/canonicalizer/marker-restore-linear.test.d.ts.map +1 -0
  113. package/dist/test/unit/canonicalizer/marker-restore-linear.test.js +98 -0
  114. package/dist/test/unit/canonicalizer/marker-restore-linear.test.js.map +1 -0
  115. package/dist/test/unit/canonicalizer/possessive-anchor.test.d.ts +2 -0
  116. package/dist/test/unit/canonicalizer/possessive-anchor.test.d.ts.map +1 -0
  117. package/dist/test/unit/canonicalizer/possessive-anchor.test.js +101 -0
  118. package/dist/test/unit/canonicalizer/possessive-anchor.test.js.map +1 -0
  119. package/dist/test/unit/formatter-redos.test.d.ts +2 -0
  120. package/dist/test/unit/formatter-redos.test.d.ts.map +1 -0
  121. package/dist/test/unit/formatter-redos.test.js +196 -0
  122. package/dist/test/unit/formatter-redos.test.js.map +1 -0
  123. package/dist/test/unit/interpreter/interpreter.test.js +7 -2
  124. package/dist/test/unit/interpreter/interpreter.test.js.map +1 -1
  125. package/dist/test/unit/lexer/bom.test.d.ts +2 -0
  126. package/dist/test/unit/lexer/bom.test.d.ts.map +1 -0
  127. package/dist/test/unit/lexer/bom.test.js +49 -0
  128. package/dist/test/unit/lexer/bom.test.js.map +1 -0
  129. package/dist/test/unit/list-get-bounds.test.d.ts +2 -0
  130. package/dist/test/unit/list-get-bounds.test.d.ts.map +1 -0
  131. package/dist/test/unit/list-get-bounds.test.js +66 -0
  132. package/dist/test/unit/list-get-bounds.test.js.map +1 -0
  133. package/dist/test/unit/long-bigint-exact.test.d.ts +2 -0
  134. package/dist/test/unit/long-bigint-exact.test.d.ts.map +1 -0
  135. package/dist/test/unit/long-bigint-exact.test.js +79 -0
  136. package/dist/test/unit/long-bigint-exact.test.js.map +1 -0
  137. package/dist/test/unit/lsp/completion-lexicon.test.d.ts +2 -0
  138. package/dist/test/unit/lsp/completion-lexicon.test.d.ts.map +1 -0
  139. package/dist/test/unit/lsp/completion-lexicon.test.js +83 -0
  140. package/dist/test/unit/lsp/completion-lexicon.test.js.map +1 -0
  141. package/dist/test/unit/lsp/tenant-vocabulary.test.d.ts +2 -0
  142. package/dist/test/unit/lsp/tenant-vocabulary.test.d.ts.map +1 -0
  143. package/dist/test/unit/lsp/tenant-vocabulary.test.js +187 -0
  144. package/dist/test/unit/lsp/tenant-vocabulary.test.js.map +1 -0
  145. package/dist/test/unit/map-builtins.test.js +163 -3
  146. package/dist/test/unit/map-builtins.test.js.map +1 -1
  147. package/dist/test/unit/map-structural-equality.test.d.ts +2 -0
  148. package/dist/test/unit/map-structural-equality.test.d.ts.map +1 -0
  149. package/dist/test/unit/map-structural-equality.test.js +64 -0
  150. package/dist/test/unit/map-structural-equality.test.js.map +1 -0
  151. package/dist/test/unit/map-type-guard.test.js +8 -5
  152. package/dist/test/unit/map-type-guard.test.js.map +1 -1
  153. package/dist/test/unit/mapping/candidate-generator.test.d.ts +2 -0
  154. package/dist/test/unit/mapping/candidate-generator.test.d.ts.map +1 -0
  155. package/dist/test/unit/mapping/candidate-generator.test.js +177 -0
  156. package/dist/test/unit/mapping/candidate-generator.test.js.map +1 -0
  157. package/dist/test/unit/mapping/entity-proposer.test.d.ts +2 -0
  158. package/dist/test/unit/mapping/entity-proposer.test.d.ts.map +1 -0
  159. package/dist/test/unit/mapping/entity-proposer.test.js +168 -0
  160. package/dist/test/unit/mapping/entity-proposer.test.js.map +1 -0
  161. package/dist/test/unit/mapping/mapping-ir.test.d.ts +2 -0
  162. package/dist/test/unit/mapping/mapping-ir.test.d.ts.map +1 -0
  163. package/dist/test/unit/mapping/mapping-ir.test.js +144 -0
  164. package/dist/test/unit/mapping/mapping-ir.test.js.map +1 -0
  165. package/dist/test/unit/mapping/proof-ir.test.d.ts +2 -0
  166. package/dist/test/unit/mapping/proof-ir.test.d.ts.map +1 -0
  167. package/dist/test/unit/mapping/proof-ir.test.js +119 -0
  168. package/dist/test/unit/mapping/proof-ir.test.js.map +1 -0
  169. package/dist/test/unit/mapping/quantity-ir.test.d.ts +2 -0
  170. package/dist/test/unit/mapping/quantity-ir.test.d.ts.map +1 -0
  171. package/dist/test/unit/mapping/quantity-ir.test.js +144 -0
  172. package/dist/test/unit/mapping/quantity-ir.test.js.map +1 -0
  173. package/dist/test/unit/mapping/quantity-redos-property.test.d.ts +2 -0
  174. package/dist/test/unit/mapping/quantity-redos-property.test.d.ts.map +1 -0
  175. package/dist/test/unit/mapping/quantity-redos-property.test.js +182 -0
  176. package/dist/test/unit/mapping/quantity-redos-property.test.js.map +1 -0
  177. package/dist/test/unit/mapping/redos-budget.test.d.ts +2 -0
  178. package/dist/test/unit/mapping/redos-budget.test.d.ts.map +1 -0
  179. package/dist/test/unit/mapping/redos-budget.test.js +168 -0
  180. package/dist/test/unit/mapping/redos-budget.test.js.map +1 -0
  181. package/dist/test/unit/mapping/source-ir.test.d.ts +2 -0
  182. package/dist/test/unit/mapping/source-ir.test.d.ts.map +1 -0
  183. package/dist/test/unit/mapping/source-ir.test.js +113 -0
  184. package/dist/test/unit/mapping/source-ir.test.js.map +1 -0
  185. package/dist/test/unit/nodeid/change-impact.test.d.ts +2 -0
  186. package/dist/test/unit/nodeid/change-impact.test.d.ts.map +1 -0
  187. package/dist/test/unit/nodeid/change-impact.test.js +152 -0
  188. package/dist/test/unit/nodeid/change-impact.test.js.map +1 -0
  189. package/dist/test/unit/nodeid/rename-declaration.test.d.ts +2 -0
  190. package/dist/test/unit/nodeid/rename-declaration.test.d.ts.map +1 -0
  191. package/dist/test/unit/nodeid/rename-declaration.test.js +75 -0
  192. package/dist/test/unit/nodeid/rename-declaration.test.js.map +1 -0
  193. package/dist/test/unit/parse-type-recursion.test.d.ts +2 -0
  194. package/dist/test/unit/parse-type-recursion.test.d.ts.map +1 -0
  195. package/dist/test/unit/parse-type-recursion.test.js +58 -0
  196. package/dist/test/unit/parse-type-recursion.test.js.map +1 -0
  197. package/dist/test/unit/regex-guard.test.js +64 -0
  198. package/dist/test/unit/regex-guard.test.js.map +1 -1
  199. package/dist/test/unit/strict-int-coercion.test.d.ts +2 -0
  200. package/dist/test/unit/strict-int-coercion.test.d.ts.map +1 -0
  201. package/dist/test/unit/strict-int-coercion.test.js +96 -0
  202. package/dist/test/unit/strict-int-coercion.test.js.map +1 -0
  203. package/dist/test/unit/ufcs-receiver.test.d.ts +2 -0
  204. package/dist/test/unit/ufcs-receiver.test.d.ts.map +1 -0
  205. package/dist/test/unit/ufcs-receiver.test.js +75 -0
  206. package/dist/test/unit/ufcs-receiver.test.js.map +1 -0
  207. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  // 本文件由 scripts/generate_error_codes.ts 自动生成,请勿手动修改。
2
2
  // 源数据: shared/error_codes.json
3
3
  export const ERROR_MESSAGES = {
4
- ["E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */]: "Multiple @entry rules in module: {rules}",
5
4
  ["E001" /* ErrorCode.TYPE_MISMATCH */]: "Type mismatch: expected {expected}, got {actual}",
6
5
  ["E002" /* ErrorCode.TYPE_MISMATCH_ASSIGN */]: "Type mismatch assigning to '{name}': {expected} vs {actual}",
7
6
  ["E003" /* ErrorCode.RETURN_TYPE_MISMATCH */]: "Return type mismatch: expected {expected}, got {actual}",
@@ -21,7 +20,6 @@ export const ERROR_MESSAGES = {
21
20
  ["E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */]: "Non-exhaustive match on Maybe type; missing {missing} case.",
22
21
  ["E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */]: "Non-exhaustive match on {type}; missing: {missing}",
23
22
  ["E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */]: "Ambiguous interop call '{target}': mixing numeric kinds (Int={hasInt}, Long={hasLong}, Double={hasDouble}). Overload resolution may widen/box implicitly.",
24
- ["E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */]: "Cannot combine Decimal and Double in '{operator}'. Double is binary floating-point and would inject rounding error into an exact Decimal. Use Decimal literals (e.g. 1.08m) on both sides, or Int/Long (exact promotion).",
25
23
  ["E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */]: "List literal element type mismatch: expected {expected}, got {actual}",
26
24
  ["E021" /* ErrorCode.OPTIONAL_EXPECTED */]: "Optional value required here: expected Maybe or Option, but got {actual}",
27
25
  ["E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */]: "Compensate block for step '{step}' must return Result<Unit, {expectedErr}>, got {actual}",
@@ -33,11 +31,14 @@ export const ERROR_MESSAGES = {
33
31
  ["E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */]: "Compensate block for step '{step}' in function '{func}' introduces new capability {capability} that does not appear in the main step body.",
34
32
  ["E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */]: "Workflow step '{step}' depends on undefined step '{dependency}'.",
35
33
  ["E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */]: "Workflow contains circular step dependency: {cycle}",
34
+ ["E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */]: "Cannot combine Decimal and Double in '{operator}'. Double is binary floating-point and would inject rounding error into an exact Decimal. Use Decimal literals (e.g. 1.08m) on both sides, or Int/Long (exact promotion).",
35
+ ["E032" /* ErrorCode.CALL_ARITY_MISMATCH */]: "Function '{func}' expects {expected} argument(s), got {actual}.",
36
36
  ["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: "Cannot assign PII data to lower-level target: {source} -> {target}",
37
37
  ["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: "PII level {level} data output to {sinkKind} without sanitization",
38
38
  ["E073" /* ErrorCode.PII_ARG_VIOLATION */]: "PII argument type mismatch: expected {expected}, got {actual}",
39
39
  ["E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */]: "Duplicate import alias '{alias}'.",
40
40
  ["E101" /* ErrorCode.UNDEFINED_VARIABLE */]: "Undefined variable: {name}",
41
+ ["E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */]: "Multiple @entry rules in module: {rules}",
41
42
  ["E103" /* ErrorCode.IMPORT_SYMBOL_CONFLICT */]: "Import symbol conflict: {symbol}",
42
43
  ["E104" /* ErrorCode.DUPLICATE_SYMBOL */]: "Symbol '{name}' is already defined in this scope.",
43
44
  ["E200" /* ErrorCode.EFF_MISSING_IO */]: "Function '{func}' may perform I/O but is missing @io effect.",
@@ -74,86 +75,516 @@ export const ERROR_MESSAGES = {
74
75
  ["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: "Workflow timeout configuration may be unreasonable: {reason}",
75
76
  };
76
77
  export const ERROR_METADATA = {
77
- ["E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */]: { code: "E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */, category: 'scope', severity: 'error', message: "Multiple @entry rules in module: {rules}", help: "Keep at most one Rule annotated with @entry in a module." },
78
- ["E001" /* ErrorCode.TYPE_MISMATCH */]: { code: "E001" /* ErrorCode.TYPE_MISMATCH */, category: 'type', severity: 'error', message: "Type mismatch: expected {expected}, got {actual}", help: "Check that the type annotation matches the inferred expression type." },
79
- ["E002" /* ErrorCode.TYPE_MISMATCH_ASSIGN */]: { code: "E002" /* ErrorCode.TYPE_MISMATCH_ASSIGN */, category: 'type', severity: 'error', message: "Type mismatch assigning to '{name}': {expected} vs {actual}", help: "Ensure the variable's previous binding type matches the current assignment." },
80
- ["E003" /* ErrorCode.RETURN_TYPE_MISMATCH */]: { code: "E003" /* ErrorCode.RETURN_TYPE_MISMATCH */, category: 'type', severity: 'error', message: "Return type mismatch: expected {expected}, got {actual}", help: "Check that the return statement matches the declared return type." },
81
- ["E004" /* ErrorCode.TYPE_VAR_UNDECLARED */]: { code: "E004" /* ErrorCode.TYPE_VAR_UNDECLARED */, category: 'type', severity: 'error', message: "Type variable '{name}' is used in '{func}' but not declared in its type parameters.", help: "Declare used type variables in the function signature's 'of' clause." },
82
- ["E005" /* ErrorCode.TYPE_PARAM_UNUSED */]: { code: "E005" /* ErrorCode.TYPE_PARAM_UNUSED */, category: 'type', severity: 'warning', message: "Type parameter '{name}' on '{func}' is declared but not used.", help: "Remove unused type parameters to avoid confusion." },
83
- ["E006" /* ErrorCode.TYPEVAR_LIKE_UNDECLARED */]: { code: "E006" /* ErrorCode.TYPEVAR_LIKE_UNDECLARED */, category: 'type', severity: 'error', message: "Type variable-like '{name}' is used in '{func}' but not declared; declare it with 'of {name}'.", help: "For names that look like type variables, declare them in the 'of' clause." },
84
- ["E007" /* ErrorCode.TYPEVAR_INCONSISTENT */]: { code: "E007" /* ErrorCode.TYPEVAR_INCONSISTENT */, category: 'type', severity: 'error', message: "Type variable '{name}' inferred inconsistently: {previous} vs {actual}", help: "Ensure all usage sites of a type variable produce the same concrete type." },
85
- ["E008" /* ErrorCode.IF_BRANCH_MISMATCH */]: { code: "E008" /* ErrorCode.IF_BRANCH_MISMATCH */, category: 'type', severity: 'error', message: "If branch type mismatch: then {thenType} vs else {elseType}", help: "Ensure both branches of an if expression return the same type." },
86
- ["E009" /* ErrorCode.MATCH_BRANCH_MISMATCH */]: { code: "E009" /* ErrorCode.MATCH_BRANCH_MISMATCH */, category: 'type', severity: 'error', message: "Match case return types differ: {expected} vs {actual}", help: "Check that all match branches return the same type." },
87
- ["E010" /* ErrorCode.INTEGER_PATTERN_TYPE */]: { code: "E010" /* ErrorCode.INTEGER_PATTERN_TYPE */, category: 'type', severity: 'error', message: "Integer pattern used on non-Int scrutinee ({scrutineeType})", help: "Only use integer patterns on Int-typed match expressions." },
88
- ["E011" /* ErrorCode.UNKNOWN_FIELD */]: { code: "E011" /* ErrorCode.UNKNOWN_FIELD */, category: 'type', severity: 'error', message: "Unknown field '{field}' for {type}", help: "Check that the field name is correct for the data type." },
89
- ["E012" /* ErrorCode.FIELD_TYPE_MISMATCH */]: { code: "E012" /* ErrorCode.FIELD_TYPE_MISMATCH */, category: 'type', severity: 'error', message: "Field '{field}' expects {expected}, got {actual}", help: "Verify the field initializer expression matches the declared type." },
90
- ["E013" /* ErrorCode.MISSING_REQUIRED_FIELD */]: { code: "E013" /* ErrorCode.MISSING_REQUIRED_FIELD */, category: 'type', severity: 'error', message: "Construction of {type} missing required field '{field}'", help: "Provide all required fields declared in the data type." },
91
- ["E014" /* ErrorCode.NOT_CALL_ARITY */]: { code: "E014" /* ErrorCode.NOT_CALL_ARITY */, category: 'type', severity: 'error', message: "not(...) expects 1 argument", help: "Adjust the not() call to have exactly 1 argument." },
92
- ["E015" /* ErrorCode.AWAIT_TYPE */]: { code: "E015" /* ErrorCode.AWAIT_TYPE */, category: 'type', severity: 'warning', message: "await expects Maybe<T> or Result<T,E>, got {type}", help: "Only use await on Maybe or Result types." },
93
- ["E016" /* ErrorCode.DUPLICATE_ENUM_CASE */]: { code: "E016" /* ErrorCode.DUPLICATE_ENUM_CASE */, category: 'type', severity: 'warning', message: "Duplicate enum case '{case}' in match on {type}.", help: "Remove duplicate enum branches to keep the match concise." },
94
- ["E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */]: { code: "E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */, category: 'type', severity: 'warning', message: "Non-exhaustive match on Maybe type; missing {missing} case.", help: "Add both null and non-null branches for Maybe matches." },
95
- ["E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */]: { code: "E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */, category: 'type', severity: 'warning', message: "Non-exhaustive match on {type}; missing: {missing}", help: "Add all uncovered enum branches, or add a wildcard." },
96
- ["E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */]: { code: "E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */, category: 'type', severity: 'warning', message: "Ambiguous interop call '{target}': mixing numeric kinds (Int={hasInt}, Long={hasLong}, Double={hasDouble}). Overload resolution may widen/box implicitly.", help: "Unify numeric argument types in interop calls to avoid implicit boxing and widening." },
97
- ["E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */]: { code: "E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */, category: 'type', severity: 'error', message: "Cannot combine Decimal and Double in '{operator}'. Double is binary floating-point and would inject rounding error into an exact Decimal. Use Decimal literals (e.g. 1.08m) on both sides, or Int/Long (exact promotion).", help: "Make both operands Decimal (suffix m), or use Int/Long which promote exactly to Decimal." },
98
- ["E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */]: { code: "E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */, category: 'type', severity: 'error', message: "List literal element type mismatch: expected {expected}, got {actual}", help: "Ensure all elements in a list literal have the same type." },
99
- ["E021" /* ErrorCode.OPTIONAL_EXPECTED */]: { code: "E021" /* ErrorCode.OPTIONAL_EXPECTED */, category: 'type', severity: 'error', message: "Optional value required here: expected Maybe or Option, but got {actual}", help: "Pass a Maybe/Option type or explicitly wrap the value." },
100
- ["E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */]: { code: "E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */, category: 'type', severity: 'error', message: "Compensate block for step '{step}' must return Result<Unit, {expectedErr}>, got {actual}", help: "Ensure the compensate block returns Result<Unit, E> where E is the step error type." },
101
- ["E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */]: { code: "E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */, category: 'effect', severity: 'warning', message: "Step '{step}' performs side effects but does not define a compensate block.", help: "Provide a compensate block for steps with IO side effects to enable rollback." },
102
- ["E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */]: { code: "E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */, category: 'type', severity: 'error', message: "Workflow retry max attempts must be greater than zero (actual: {maxAttempts}).", help: "Set retry.maxAttempts to a positive integer." },
103
- ["E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */]: { code: "E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */, category: 'type', severity: 'error', message: "Workflow timeout must be greater than zero milliseconds (actual: {milliseconds}).", help: "Set the timeout to a positive value to ensure compensate logic can be triggered." },
104
- ["E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */]: { code: "E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */, category: 'effect', severity: 'error', message: "Workflow '{func}' must declare @io effect before using a 'workflow' block.", help: "Add @io effect declaration to the function header." },
105
- ["E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */]: { code: "E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */, category: 'capability', severity: 'error', message: "Workflow '{func}' step '{step}' uses capability {capability} that is not declared on the function header.", help: "Declare {capability} in the function header or adjust the step code." },
106
- ["E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */]: { code: "E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */, category: 'capability', severity: 'error', message: "Compensate block for step '{step}' in function '{func}' introduces new capability {capability} that does not appear in the main step body.", help: "Compensate blocks can only reuse capabilities from the main step body." },
107
- ["E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */]: { code: "E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */, category: 'scope', severity: 'error', message: "Workflow step '{step}' depends on undefined step '{dependency}'.", help: "Only reference declared step names in the current workflow." },
108
- ["E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */]: { code: "E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */, category: 'type', severity: 'error', message: "Workflow contains circular step dependency: {cycle}", help: "Remove or restructure circular dependencies to enable topological execution." },
109
- // P0-R2 (codex review Medium #10): PII codes 统一分类为 'pii'(原本是
110
- // 'type' 是历史遗留,让 PII_CODES 自动派生不可能正确)
111
- ["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: { code: "E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */, category: 'pii', severity: 'error', message: "Cannot assign PII data to lower-level target: {source} -> {target}", help: "Use a sanitization function or declare a matching @pii level on the target." },
112
- ["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: { code: "E072" /* ErrorCode.PII_SINK_UNSANITIZED */, category: 'pii', severity: 'error', message: "PII level {level} data output to {sinkKind} without sanitization", help: "Call redact() or tokenize() before output to reduce sensitivity." },
113
- ["E073" /* ErrorCode.PII_ARG_VIOLATION */]: { code: "E073" /* ErrorCode.PII_ARG_VIOLATION */, category: 'pii', severity: 'error', message: "PII argument type mismatch: expected {expected}, got {actual}", help: "Check the function signature to ensure PII levels and categories match." },
114
- ["E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */]: { code: "E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */, category: 'scope', severity: 'warning', message: "Duplicate import alias '{alias}'.", help: "Use unique aliases for different imports to avoid shadowing." },
115
- ["E101" /* ErrorCode.UNDEFINED_VARIABLE */]: { code: "E101" /* ErrorCode.UNDEFINED_VARIABLE */, category: 'scope', severity: 'error', message: "Undefined variable: {name}", help: "Declare and initialize the variable before use." },
116
- ["E103" /* ErrorCode.IMPORT_SYMBOL_CONFLICT */]: { code: "E103" /* ErrorCode.IMPORT_SYMBOL_CONFLICT */, category: 'scope', severity: 'warning', message: "Import symbol conflict: {symbol}", help: "Adjust the import alias or the local top-level declaration name to avoid the import symbol conflict." },
117
- ["E104" /* ErrorCode.DUPLICATE_SYMBOL */]: { code: "E104" /* ErrorCode.DUPLICATE_SYMBOL */, category: 'scope', severity: 'error', message: "Symbol '{name}' is already defined in this scope.", help: "Choose a different name or check for unintended duplicate declarations." },
118
- ["E200" /* ErrorCode.EFF_MISSING_IO */]: { code: "E200" /* ErrorCode.EFF_MISSING_IO */, category: 'effect', severity: 'error', message: "Function '{func}' may perform I/O but is missing @io effect.", help: "Declare @io effect for functions that perform I/O." },
119
- ["E201" /* ErrorCode.EFF_MISSING_CPU */]: { code: "E201" /* ErrorCode.EFF_MISSING_CPU */, category: 'effect', severity: 'error', message: "Function '{func}' may perform CPU-bound work but is missing @cpu (or @io) effect.", help: "Declare @cpu or @io effect for CPU-intensive functions." },
120
- ["E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */]: { code: "E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */, category: 'effect', severity: 'info', message: "Function '{func}' declares @io but only CPU-like work found; @io subsumes @cpu and may be unnecessary.", help: "If the function only does CPU work, consider removing the redundant @io declaration." },
121
- ["E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */]: { code: "E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */, category: 'effect', severity: 'warning', message: "Function '{func}' declares @io but no obvious I/O found.", help: "Confirm @io is needed; remove if no I/O behavior exists." },
122
- ["E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */]: { code: "E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */, category: 'effect', severity: 'warning', message: "Function '{func}' declares @cpu but no obvious CPU-bound work found.", help: "Remove the redundant @cpu declaration or add corresponding CPU work." },
123
- ["E205" /* ErrorCode.EFF_INFER_MISSING_IO */]: { code: "E205" /* ErrorCode.EFF_INFER_MISSING_IO */, category: 'effect', severity: 'error', message: "Function '{func}' missing @io effect declaration, inference requires IO.", help: "Add @io effect based on inference results." },
124
- ["E206" /* ErrorCode.EFF_INFER_MISSING_CPU */]: { code: "E206" /* ErrorCode.EFF_INFER_MISSING_CPU */, category: 'effect', severity: 'error', message: "Function '{func}' missing @cpu effect declaration, inference requires CPU (or @io).", help: "Add @cpu or @io effect based on inference results." },
125
- ["E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */]: { code: "E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */, category: 'effect', severity: 'warning', message: "Function '{func}' declares @io but no IO side effects inferred.", help: "Confirm whether to keep the @io declaration." },
126
- ["E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */]: { code: "E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */, category: 'effect', severity: 'warning', message: "Function '{func}' declares @cpu but no CPU side effects inferred.", help: "Remove the @cpu declaration if no CPU side effects exist." },
127
- ["E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */]: { code: "E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */, category: 'effect', severity: 'warning', message: "Function '{func}' declares both @cpu and @io; @cpu is redundant since @io is required.", help: "Keep @io only; remove the redundant @cpu." },
128
- ["E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */]: { code: "E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */, category: 'type', severity: 'error', message: "Effect variable {var} undeclared", help: "Add the effect type parameter to the function signature's effect parameter list." },
129
- ["E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */]: { code: "E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */, category: 'type', severity: 'error', message: "Effect variable {vars} could not be resolved to concrete effects", help: "Provide explicit effects (pure/cpu/io/workflow) or remove unused effect variables." },
130
- ["E212" /* ErrorCode.EFF_INFER_UNKNOWN_BUILTIN */]: { code: "E212" /* ErrorCode.EFF_INFER_UNKNOWN_BUILTIN */, category: 'effect', severity: 'warning', message: "Effect of builtin '{builtin}' called by '{func}' is unknown; it is NOT assumed pure", help: "Declare it via ASTER_EFFECT_CONFIG prefixes, supply an imported effect signature, or use a known stdlib namespace." },
131
- ["E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */]: { code: "E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */, category: 'capability', severity: 'error', message: "Function '{func}' requires {cap} capability but manifest for module '{module}' denies it.", help: "Update the capability manifest or modify the function to comply." },
132
- ["E301" /* ErrorCode.EFF_CAP_MISSING */]: { code: "E301" /* ErrorCode.EFF_CAP_MISSING */, category: 'capability', severity: 'error', message: "Function '{func}' uses {cap} capability but header declares [{declared}].", help: "Declare the actually used capabilities in the function header." },
133
- ["E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */]: { code: "E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */, category: 'capability', severity: 'info', message: "Function '{func}' declares {cap} capability but it is not used.", help: "Remove unused capability declarations for clarity." },
134
- ["E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */]: { code: "E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */, category: 'capability', severity: 'error', message: "Function '{func}' uses IO capabilities [{capabilities}] but is missing @io effect (e.g., {calls}).", help: "Declare @io effect in the function header, or remove related calls to stay pure." },
135
- ["E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */]: { code: "E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */, category: 'capability', severity: 'error', message: "Function '{func}' performs CPU capability calls (e.g., {calls}) but declares neither @cpu nor @io effect.", help: "Add @cpu or @io effect to cover CPU capabilities." },
136
- ["E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */]: { code: "E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */, category: 'pii', severity: 'error', message: "PII data transmitted over HTTP without encryption", help: "Use an encrypted channel (HTTPS) or sanitize before transmitting PII data." },
137
- ["E401" /* ErrorCode.PII_ANNOTATION_MISSING */]: { code: "E401" /* ErrorCode.PII_ANNOTATION_MISSING */, category: 'pii', severity: 'error', message: "PII annotation missing for value flowing into '{sink}'", help: "Add @pii annotation to sensitive data for tracking." },
138
- ["E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */]: { code: "E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */, category: 'pii', severity: 'warning', message: "PII sensitivity mismatch: required {required}, got {actual}", help: "Adjust the data sensitivity level or update the process requirements." },
139
- ["E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */]: { code: "E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */, category: 'pii', severity: 'warning', message: "Function '{func}' processes PII data without consent check (GDPR Art. 6)", help: "Call checkConsent() or add @consent_required annotation before processing PII data." },
140
- ["E404" /* ErrorCode.PII_ANALYZER_FAILED */]: { code: "E404" /* ErrorCode.PII_ANALYZER_FAILED */, category: 'pii', severity: 'error', message: "PII safety analysis failed for this module — the editor cannot verify whether sensitive data is correctly handled. This policy should not be deployed until the analysis succeeds. Internal reason: {reason}", help: "Try saving and reloading the file. If the error persists, contact your administrator or report this issue with the source code attached." },
141
- ["E500" /* ErrorCode.ASYNC_START_NOT_WAITED */]: { code: "E500" /* ErrorCode.ASYNC_START_NOT_WAITED */, category: 'async', severity: 'error', message: "Started async task '{task}' not waited", help: "Call wait on started async tasks to ensure completion." },
142
- ["E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */]: { code: "E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */, category: 'async', severity: 'error', message: "Waiting for async task '{task}' that was never started", help: "Ensure the task name in wait matches a started task." },
143
- ["E502" /* ErrorCode.ASYNC_DUPLICATE_START */]: { code: "E502" /* ErrorCode.ASYNC_DUPLICATE_START */, category: 'async', severity: 'error', message: "Async task '{task}' started multiple times ({count} occurrences)", help: "Avoid starting the same task multiple times; reuse or rename." },
144
- ["E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */]: { code: "E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */, category: 'async', severity: 'warning', message: "Async task '{task}' waited multiple times ({count} occurrences)", help: "Ensure each task is waited on only once, or use a separate synchronization mechanism." },
145
- ["E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */]: { code: "E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */, category: 'async', severity: 'error', message: "Wait for async task '{task}' occurs before any matching start", help: "Execute start before wait, and ensure both are on compatible control paths." },
146
- ["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: { code: "W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */, category: 'pii', severity: 'warning', message: "Implicit PII level escalation detected: {source} -> {target}", help: "Add explicit type annotations for level changes to aid auditing." },
147
- ["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: { code: "W074" /* ErrorCode.PII_SINK_UNKNOWN */, category: 'pii', severity: 'warning', message: "PII data may flow to {sinkKind} without annotation", help: "Add @pii annotation to track sensitive data flow." },
148
- ["W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */]: { code: "W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */, category: 'type', severity: 'warning', message: "Workflow retry configuration may be unreasonable: {reason}", help: "Check the combination of total wait time, maxAttempts, and backoff strategy." },
149
- ["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: { code: "W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */, category: 'type', severity: 'warning', message: "Workflow timeout configuration may be unreasonable: {reason}", help: "Check whether the timeout value is too large or too small." },
78
+ ["E001" /* ErrorCode.TYPE_MISMATCH */]: {
79
+ code: "E001" /* ErrorCode.TYPE_MISMATCH */,
80
+ category: 'type',
81
+ severity: 'error',
82
+ message: "Type mismatch: expected {expected}, got {actual}",
83
+ help: "Check that the type annotation matches the inferred expression type.",
84
+ },
85
+ ["E002" /* ErrorCode.TYPE_MISMATCH_ASSIGN */]: {
86
+ code: "E002" /* ErrorCode.TYPE_MISMATCH_ASSIGN */,
87
+ category: 'type',
88
+ severity: 'error',
89
+ message: "Type mismatch assigning to '{name}': {expected} vs {actual}",
90
+ help: "Ensure the variable's previous binding type matches the current assignment.",
91
+ },
92
+ ["E003" /* ErrorCode.RETURN_TYPE_MISMATCH */]: {
93
+ code: "E003" /* ErrorCode.RETURN_TYPE_MISMATCH */,
94
+ category: 'type',
95
+ severity: 'error',
96
+ message: "Return type mismatch: expected {expected}, got {actual}",
97
+ help: "Check that the return statement matches the declared return type.",
98
+ },
99
+ ["E004" /* ErrorCode.TYPE_VAR_UNDECLARED */]: {
100
+ code: "E004" /* ErrorCode.TYPE_VAR_UNDECLARED */,
101
+ category: 'type',
102
+ severity: 'error',
103
+ message: "Type variable '{name}' is used in '{func}' but not declared in its type parameters.",
104
+ help: "Declare used type variables in the function signature's 'of' clause.",
105
+ },
106
+ ["E005" /* ErrorCode.TYPE_PARAM_UNUSED */]: {
107
+ code: "E005" /* ErrorCode.TYPE_PARAM_UNUSED */,
108
+ category: 'type',
109
+ severity: 'warning',
110
+ message: "Type parameter '{name}' on '{func}' is declared but not used.",
111
+ help: "Remove unused type parameters to avoid confusion.",
112
+ },
113
+ ["E006" /* ErrorCode.TYPEVAR_LIKE_UNDECLARED */]: {
114
+ code: "E006" /* ErrorCode.TYPEVAR_LIKE_UNDECLARED */,
115
+ category: 'type',
116
+ severity: 'error',
117
+ message: "Type variable-like '{name}' is used in '{func}' but not declared; declare it with 'of {name}'.",
118
+ help: "For names that look like type variables, declare them in the 'of' clause.",
119
+ },
120
+ ["E007" /* ErrorCode.TYPEVAR_INCONSISTENT */]: {
121
+ code: "E007" /* ErrorCode.TYPEVAR_INCONSISTENT */,
122
+ category: 'type',
123
+ severity: 'error',
124
+ message: "Type variable '{name}' inferred inconsistently: {previous} vs {actual}",
125
+ help: "Ensure all usage sites of a type variable produce the same concrete type.",
126
+ },
127
+ ["E008" /* ErrorCode.IF_BRANCH_MISMATCH */]: {
128
+ code: "E008" /* ErrorCode.IF_BRANCH_MISMATCH */,
129
+ category: 'type',
130
+ severity: 'error',
131
+ message: "If branch type mismatch: then {thenType} vs else {elseType}",
132
+ help: "Ensure both branches of an if expression return the same type.",
133
+ },
134
+ ["E009" /* ErrorCode.MATCH_BRANCH_MISMATCH */]: {
135
+ code: "E009" /* ErrorCode.MATCH_BRANCH_MISMATCH */,
136
+ category: 'type',
137
+ severity: 'error',
138
+ message: "Match case return types differ: {expected} vs {actual}",
139
+ help: "Check that all match branches return the same type.",
140
+ },
141
+ ["E010" /* ErrorCode.INTEGER_PATTERN_TYPE */]: {
142
+ code: "E010" /* ErrorCode.INTEGER_PATTERN_TYPE */,
143
+ category: 'type',
144
+ severity: 'error',
145
+ message: "Integer pattern used on non-Int scrutinee ({scrutineeType})",
146
+ help: "Only use integer patterns on Int-typed match expressions.",
147
+ },
148
+ ["E011" /* ErrorCode.UNKNOWN_FIELD */]: {
149
+ code: "E011" /* ErrorCode.UNKNOWN_FIELD */,
150
+ category: 'type',
151
+ severity: 'error',
152
+ message: "Unknown field '{field}' for {type}",
153
+ help: "Check that the field name is correct for the data type.",
154
+ },
155
+ ["E012" /* ErrorCode.FIELD_TYPE_MISMATCH */]: {
156
+ code: "E012" /* ErrorCode.FIELD_TYPE_MISMATCH */,
157
+ category: 'type',
158
+ severity: 'error',
159
+ message: "Field '{field}' expects {expected}, got {actual}",
160
+ help: "Verify the field initializer expression matches the declared type.",
161
+ },
162
+ ["E013" /* ErrorCode.MISSING_REQUIRED_FIELD */]: {
163
+ code: "E013" /* ErrorCode.MISSING_REQUIRED_FIELD */,
164
+ category: 'type',
165
+ severity: 'error',
166
+ message: "Construction of {type} missing required field '{field}'",
167
+ help: "Provide all required fields declared in the data type.",
168
+ },
169
+ ["E014" /* ErrorCode.NOT_CALL_ARITY */]: {
170
+ code: "E014" /* ErrorCode.NOT_CALL_ARITY */,
171
+ category: 'type',
172
+ severity: 'error',
173
+ message: "not(...) expects 1 argument",
174
+ help: "Adjust the not() call to have exactly 1 argument.",
175
+ },
176
+ ["E015" /* ErrorCode.AWAIT_TYPE */]: {
177
+ code: "E015" /* ErrorCode.AWAIT_TYPE */,
178
+ category: 'type',
179
+ severity: 'warning',
180
+ message: "await expects Maybe<T> or Result<T,E>, got {type}",
181
+ help: "Only use await on Maybe or Result types.",
182
+ },
183
+ ["E016" /* ErrorCode.DUPLICATE_ENUM_CASE */]: {
184
+ code: "E016" /* ErrorCode.DUPLICATE_ENUM_CASE */,
185
+ category: 'type',
186
+ severity: 'warning',
187
+ message: "Duplicate enum case '{case}' in match on {type}.",
188
+ help: "Remove duplicate enum branches to keep the match concise.",
189
+ },
190
+ ["E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */]: {
191
+ code: "E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */,
192
+ category: 'type',
193
+ severity: 'warning',
194
+ message: "Non-exhaustive match on Maybe type; missing {missing} case.",
195
+ help: "Add both null and non-null branches for Maybe matches.",
196
+ },
197
+ ["E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */]: {
198
+ code: "E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */,
199
+ category: 'type',
200
+ severity: 'warning',
201
+ message: "Non-exhaustive match on {type}; missing: {missing}",
202
+ help: "Add all uncovered enum branches, or add a wildcard.",
203
+ },
204
+ ["E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */]: {
205
+ code: "E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */,
206
+ category: 'type',
207
+ severity: 'warning',
208
+ message: "Ambiguous interop call '{target}': mixing numeric kinds (Int={hasInt}, Long={hasLong}, Double={hasDouble}). Overload resolution may widen/box implicitly.",
209
+ help: "Unify numeric argument types in interop calls to avoid implicit boxing and widening.",
210
+ },
211
+ ["E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */]: {
212
+ code: "E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */,
213
+ category: 'type',
214
+ severity: 'error',
215
+ message: "List literal element type mismatch: expected {expected}, got {actual}",
216
+ help: "Ensure all elements in a list literal have the same type.",
217
+ },
218
+ ["E021" /* ErrorCode.OPTIONAL_EXPECTED */]: {
219
+ code: "E021" /* ErrorCode.OPTIONAL_EXPECTED */,
220
+ category: 'type',
221
+ severity: 'error',
222
+ message: "Optional value required here: expected Maybe or Option, but got {actual}",
223
+ help: "Pass a Maybe/Option type or explicitly wrap the value.",
224
+ },
225
+ ["E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */]: {
226
+ code: "E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */,
227
+ category: 'type',
228
+ severity: 'error',
229
+ message: "Compensate block for step '{step}' must return Result<Unit, {expectedErr}>, got {actual}",
230
+ help: "Ensure the compensate block returns Result<Unit, E> where E is the step error type.",
231
+ },
232
+ ["E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */]: {
233
+ code: "E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */,
234
+ category: 'effect',
235
+ severity: 'warning',
236
+ message: "Step '{step}' performs side effects but does not define a compensate block.",
237
+ help: "Provide a compensate block for steps with IO side effects to enable rollback.",
238
+ },
239
+ ["E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */]: {
240
+ code: "E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */,
241
+ category: 'type',
242
+ severity: 'error',
243
+ message: "Workflow retry max attempts must be greater than zero (actual: {maxAttempts}).",
244
+ help: "Set retry.maxAttempts to a positive integer.",
245
+ },
246
+ ["E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */]: {
247
+ code: "E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */,
248
+ category: 'type',
249
+ severity: 'error',
250
+ message: "Workflow timeout must be greater than zero milliseconds (actual: {milliseconds}).",
251
+ help: "Set the timeout to a positive value to ensure compensate logic can be triggered.",
252
+ },
253
+ ["E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */]: {
254
+ code: "E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */,
255
+ category: 'effect',
256
+ severity: 'error',
257
+ message: "Workflow '{func}' must declare @io effect before using a 'workflow' block.",
258
+ help: "Add @io effect declaration to the function header.",
259
+ },
260
+ ["E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */]: {
261
+ code: "E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */,
262
+ category: 'capability',
263
+ severity: 'error',
264
+ message: "Workflow '{func}' step '{step}' uses capability {capability} that is not declared on the function header.",
265
+ help: "Declare {capability} in the function header or adjust the step code.",
266
+ },
267
+ ["E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */]: {
268
+ code: "E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */,
269
+ category: 'capability',
270
+ severity: 'error',
271
+ message: "Compensate block for step '{step}' in function '{func}' introduces new capability {capability} that does not appear in the main step body.",
272
+ help: "Compensate blocks can only reuse capabilities from the main step body.",
273
+ },
274
+ ["E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */]: {
275
+ code: "E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */,
276
+ category: 'scope',
277
+ severity: 'error',
278
+ message: "Workflow step '{step}' depends on undefined step '{dependency}'.",
279
+ help: "Only reference declared step names in the current workflow.",
280
+ },
281
+ ["E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */]: {
282
+ code: "E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */,
283
+ category: 'type',
284
+ severity: 'error',
285
+ message: "Workflow contains circular step dependency: {cycle}",
286
+ help: "Remove or restructure circular dependencies to enable topological execution.",
287
+ },
288
+ ["E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */]: {
289
+ code: "E031" /* ErrorCode.DECIMAL_DOUBLE_MIXING */,
290
+ category: 'type',
291
+ severity: 'error',
292
+ message: "Cannot combine Decimal and Double in '{operator}'. Double is binary floating-point and would inject rounding error into an exact Decimal. Use Decimal literals (e.g. 1.08m) on both sides, or Int/Long (exact promotion).",
293
+ help: "Make both operands Decimal (suffix m), or use Int/Long which promote exactly to Decimal.",
294
+ },
295
+ ["E032" /* ErrorCode.CALL_ARITY_MISMATCH */]: {
296
+ code: "E032" /* ErrorCode.CALL_ARITY_MISMATCH */,
297
+ category: 'type',
298
+ severity: 'error',
299
+ message: "Function '{func}' expects {expected} argument(s), got {actual}.",
300
+ help: "Adjust the call to pass exactly the declared number of arguments.",
301
+ },
302
+ ["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: {
303
+ code: "E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */,
304
+ category: 'pii',
305
+ severity: 'error',
306
+ message: "Cannot assign PII data to lower-level target: {source} -> {target}",
307
+ help: "Use a sanitization function or declare a matching @pii level on the target.",
308
+ },
309
+ ["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: {
310
+ code: "E072" /* ErrorCode.PII_SINK_UNSANITIZED */,
311
+ category: 'pii',
312
+ severity: 'error',
313
+ message: "PII level {level} data output to {sinkKind} without sanitization",
314
+ help: "Call redact() or tokenize() before output to reduce sensitivity.",
315
+ },
316
+ ["E073" /* ErrorCode.PII_ARG_VIOLATION */]: {
317
+ code: "E073" /* ErrorCode.PII_ARG_VIOLATION */,
318
+ category: 'pii',
319
+ severity: 'error',
320
+ message: "PII argument type mismatch: expected {expected}, got {actual}",
321
+ help: "Check the function signature to ensure PII levels and categories match.",
322
+ },
323
+ ["E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */]: {
324
+ code: "E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */,
325
+ category: 'scope',
326
+ severity: 'warning',
327
+ message: "Duplicate import alias '{alias}'.",
328
+ help: "Use unique aliases for different imports to avoid shadowing.",
329
+ },
330
+ ["E101" /* ErrorCode.UNDEFINED_VARIABLE */]: {
331
+ code: "E101" /* ErrorCode.UNDEFINED_VARIABLE */,
332
+ category: 'scope',
333
+ severity: 'error',
334
+ message: "Undefined variable: {name}",
335
+ help: "Declare and initialize the variable before use.",
336
+ },
337
+ ["E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */]: {
338
+ code: "E102" /* ErrorCode.MULTIPLE_ENTRY_RULES */,
339
+ category: 'scope',
340
+ severity: 'error',
341
+ message: "Multiple @entry rules in module: {rules}",
342
+ help: "Keep at most one Rule annotated with @entry in a module.",
343
+ },
344
+ ["E103" /* ErrorCode.IMPORT_SYMBOL_CONFLICT */]: {
345
+ code: "E103" /* ErrorCode.IMPORT_SYMBOL_CONFLICT */,
346
+ category: 'scope',
347
+ severity: 'warning',
348
+ message: "Import symbol conflict: {symbol}",
349
+ help: "Adjust the import alias or the local top-level declaration name to avoid the import symbol conflict.",
350
+ },
351
+ ["E104" /* ErrorCode.DUPLICATE_SYMBOL */]: {
352
+ code: "E104" /* ErrorCode.DUPLICATE_SYMBOL */,
353
+ category: 'scope',
354
+ severity: 'error',
355
+ message: "Symbol '{name}' is already defined in this scope.",
356
+ help: "Choose a different name or check for unintended duplicate declarations.",
357
+ },
358
+ ["E200" /* ErrorCode.EFF_MISSING_IO */]: {
359
+ code: "E200" /* ErrorCode.EFF_MISSING_IO */,
360
+ category: 'effect',
361
+ severity: 'error',
362
+ message: "Function '{func}' may perform I/O but is missing @io effect.",
363
+ help: "Declare @io effect for functions that perform I/O.",
364
+ },
365
+ ["E201" /* ErrorCode.EFF_MISSING_CPU */]: {
366
+ code: "E201" /* ErrorCode.EFF_MISSING_CPU */,
367
+ category: 'effect',
368
+ severity: 'error',
369
+ message: "Function '{func}' may perform CPU-bound work but is missing @cpu (or @io) effect.",
370
+ help: "Declare @cpu or @io effect for CPU-intensive functions.",
371
+ },
372
+ ["E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */]: {
373
+ code: "E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */,
374
+ category: 'effect',
375
+ severity: 'info',
376
+ message: "Function '{func}' declares @io but only CPU-like work found; @io subsumes @cpu and may be unnecessary.",
377
+ help: "If the function only does CPU work, consider removing the redundant @io declaration.",
378
+ },
379
+ ["E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */]: {
380
+ code: "E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */,
381
+ category: 'effect',
382
+ severity: 'warning',
383
+ message: "Function '{func}' declares @io but no obvious I/O found.",
384
+ help: "Confirm @io is needed; remove if no I/O behavior exists.",
385
+ },
386
+ ["E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */]: {
387
+ code: "E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */,
388
+ category: 'effect',
389
+ severity: 'warning',
390
+ message: "Function '{func}' declares @cpu but no obvious CPU-bound work found.",
391
+ help: "Remove the redundant @cpu declaration or add corresponding CPU work.",
392
+ },
393
+ ["E205" /* ErrorCode.EFF_INFER_MISSING_IO */]: {
394
+ code: "E205" /* ErrorCode.EFF_INFER_MISSING_IO */,
395
+ category: 'effect',
396
+ severity: 'error',
397
+ message: "Function '{func}' missing @io effect declaration, inference requires IO.",
398
+ help: "Add @io effect based on inference results.",
399
+ },
400
+ ["E206" /* ErrorCode.EFF_INFER_MISSING_CPU */]: {
401
+ code: "E206" /* ErrorCode.EFF_INFER_MISSING_CPU */,
402
+ category: 'effect',
403
+ severity: 'error',
404
+ message: "Function '{func}' missing @cpu effect declaration, inference requires CPU (or @io).",
405
+ help: "Add @cpu or @io effect based on inference results.",
406
+ },
407
+ ["E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */]: {
408
+ code: "E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */,
409
+ category: 'effect',
410
+ severity: 'warning',
411
+ message: "Function '{func}' declares @io but no IO side effects inferred.",
412
+ help: "Confirm whether to keep the @io declaration.",
413
+ },
414
+ ["E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */]: {
415
+ code: "E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */,
416
+ category: 'effect',
417
+ severity: 'warning',
418
+ message: "Function '{func}' declares @cpu but no CPU side effects inferred.",
419
+ help: "Remove the @cpu declaration if no CPU side effects exist.",
420
+ },
421
+ ["E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */]: {
422
+ code: "E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */,
423
+ category: 'effect',
424
+ severity: 'warning',
425
+ message: "Function '{func}' declares both @cpu and @io; @cpu is redundant since @io is required.",
426
+ help: "Keep @io only; remove the redundant @cpu.",
427
+ },
428
+ ["E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */]: {
429
+ code: "E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */,
430
+ category: 'type',
431
+ severity: 'error',
432
+ message: "Effect variable {var} undeclared",
433
+ help: "Add the effect type parameter to the function signature's effect parameter list.",
434
+ },
435
+ ["E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */]: {
436
+ code: "E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */,
437
+ category: 'type',
438
+ severity: 'error',
439
+ message: "Effect variable {vars} could not be resolved to concrete effects",
440
+ help: "Provide explicit effects (pure/cpu/io/workflow) or remove unused effect variables.",
441
+ },
442
+ ["E212" /* ErrorCode.EFF_INFER_UNKNOWN_BUILTIN */]: {
443
+ code: "E212" /* ErrorCode.EFF_INFER_UNKNOWN_BUILTIN */,
444
+ category: 'effect',
445
+ severity: 'warning',
446
+ message: "Effect of builtin '{builtin}' called by '{func}' is unknown; it is NOT assumed pure",
447
+ help: "Declare it via ASTER_EFFECT_CONFIG prefixes, supply an imported effect signature, or use a known stdlib namespace.",
448
+ },
449
+ ["E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */]: {
450
+ code: "E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */,
451
+ category: 'capability',
452
+ severity: 'error',
453
+ message: "Function '{func}' requires {cap} capability but manifest for module '{module}' denies it.",
454
+ help: "Update the capability manifest or modify the function to comply.",
455
+ },
456
+ ["E301" /* ErrorCode.EFF_CAP_MISSING */]: {
457
+ code: "E301" /* ErrorCode.EFF_CAP_MISSING */,
458
+ category: 'capability',
459
+ severity: 'error',
460
+ message: "Function '{func}' uses {cap} capability but header declares [{declared}].",
461
+ help: "Declare the actually used capabilities in the function header.",
462
+ },
463
+ ["E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */]: {
464
+ code: "E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */,
465
+ category: 'capability',
466
+ severity: 'info',
467
+ message: "Function '{func}' declares {cap} capability but it is not used.",
468
+ help: "Remove unused capability declarations for clarity.",
469
+ },
470
+ ["E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */]: {
471
+ code: "E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */,
472
+ category: 'capability',
473
+ severity: 'error',
474
+ message: "Function '{func}' uses IO capabilities [{capabilities}] but is missing @io effect (e.g., {calls}).",
475
+ help: "Declare @io effect in the function header, or remove related calls to stay pure.",
476
+ },
477
+ ["E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */]: {
478
+ code: "E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */,
479
+ category: 'capability',
480
+ severity: 'error',
481
+ message: "Function '{func}' performs CPU capability calls (e.g., {calls}) but declares neither @cpu nor @io effect.",
482
+ help: "Add @cpu or @io effect to cover CPU capabilities.",
483
+ },
484
+ ["E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */]: {
485
+ code: "E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */,
486
+ category: 'pii',
487
+ severity: 'error',
488
+ message: "PII data transmitted over HTTP without encryption",
489
+ help: "Use an encrypted channel (HTTPS) or sanitize before transmitting PII data.",
490
+ },
491
+ ["E401" /* ErrorCode.PII_ANNOTATION_MISSING */]: {
492
+ code: "E401" /* ErrorCode.PII_ANNOTATION_MISSING */,
493
+ category: 'pii',
494
+ severity: 'error',
495
+ message: "PII annotation missing for value flowing into '{sink}'",
496
+ help: "Add @pii annotation to sensitive data for tracking.",
497
+ },
498
+ ["E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */]: {
499
+ code: "E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */,
500
+ category: 'pii',
501
+ severity: 'warning',
502
+ message: "PII sensitivity mismatch: required {required}, got {actual}",
503
+ help: "Adjust the data sensitivity level or update the process requirements.",
504
+ },
505
+ ["E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */]: {
506
+ code: "E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */,
507
+ category: 'pii',
508
+ severity: 'warning',
509
+ message: "Function '{func}' processes PII data without consent check (GDPR Art. 6)",
510
+ help: "Call checkConsent() or add @consent_required annotation before processing PII data.",
511
+ },
512
+ ["E404" /* ErrorCode.PII_ANALYZER_FAILED */]: {
513
+ code: "E404" /* ErrorCode.PII_ANALYZER_FAILED */,
514
+ category: 'pii',
515
+ severity: 'error',
516
+ message: "PII safety analysis failed for this module — the editor cannot verify whether sensitive data is correctly handled. This policy should not be deployed until the analysis succeeds. Internal reason: {reason}",
517
+ help: "Try saving and reloading the file. If the error persists, contact your administrator or report this issue with the source code attached.",
518
+ },
519
+ ["E500" /* ErrorCode.ASYNC_START_NOT_WAITED */]: {
520
+ code: "E500" /* ErrorCode.ASYNC_START_NOT_WAITED */,
521
+ category: 'async',
522
+ severity: 'error',
523
+ message: "Started async task '{task}' not waited",
524
+ help: "Call wait on started async tasks to ensure completion.",
525
+ },
526
+ ["E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */]: {
527
+ code: "E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */,
528
+ category: 'async',
529
+ severity: 'error',
530
+ message: "Waiting for async task '{task}' that was never started",
531
+ help: "Ensure the task name in wait matches a started task.",
532
+ },
533
+ ["E502" /* ErrorCode.ASYNC_DUPLICATE_START */]: {
534
+ code: "E502" /* ErrorCode.ASYNC_DUPLICATE_START */,
535
+ category: 'async',
536
+ severity: 'error',
537
+ message: "Async task '{task}' started multiple times ({count} occurrences)",
538
+ help: "Avoid starting the same task multiple times; reuse or rename.",
539
+ },
540
+ ["E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */]: {
541
+ code: "E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */,
542
+ category: 'async',
543
+ severity: 'warning',
544
+ message: "Async task '{task}' waited multiple times ({count} occurrences)",
545
+ help: "Ensure each task is waited on only once, or use a separate synchronization mechanism.",
546
+ },
547
+ ["E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */]: {
548
+ code: "E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */,
549
+ category: 'async',
550
+ severity: 'error',
551
+ message: "Wait for async task '{task}' occurs before any matching start",
552
+ help: "Execute start before wait, and ensure both are on compatible control paths.",
553
+ },
554
+ ["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: {
555
+ code: "W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */,
556
+ category: 'pii',
557
+ severity: 'warning',
558
+ message: "Implicit PII level escalation detected: {source} -> {target}",
559
+ help: "Add explicit type annotations for level changes to aid auditing.",
560
+ },
561
+ ["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: {
562
+ code: "W074" /* ErrorCode.PII_SINK_UNKNOWN */,
563
+ category: 'pii',
564
+ severity: 'warning',
565
+ message: "PII data may flow to {sinkKind} without annotation",
566
+ help: "Add @pii annotation to track sensitive data flow.",
567
+ },
568
+ ["W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */]: {
569
+ code: "W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */,
570
+ category: 'type',
571
+ severity: 'warning',
572
+ message: "Workflow retry configuration may be unreasonable: {reason}",
573
+ help: "Check the combination of total wait time, maxAttempts, and backoff strategy.",
574
+ },
575
+ ["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: {
576
+ code: "W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */,
577
+ category: 'type',
578
+ severity: 'warning',
579
+ message: "Workflow timeout configuration may be unreasonable: {reason}",
580
+ help: "Check whether the timeout value is too large or too small.",
581
+ },
150
582
  };
151
583
  /**
152
584
  * 使用命名参数填充错误消息模板。
153
- * 可选传入 lexicon 以获取本地化翻译。
154
585
  */
155
- export function formatErrorMessage(code, params, diagnosticMessages) {
156
- const template = diagnosticMessages?.[code] ?? ERROR_MESSAGES[code] ?? "";
586
+ export function formatErrorMessage(code, params) {
587
+ const template = ERROR_MESSAGES[code] ?? "";
157
588
  return template.replace(/\{(\w+)\}/g, (_, key) => {
158
589
  const value = params[key];
159
590
  return value === undefined ? `{${key}}` : String(value);