@aster-cloud/aster-lang-ts 0.0.32 → 0.1.1
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/CHANGELOG.md +46 -0
- package/README.md +4 -4
- package/dist/peg/headers-parser.js +233 -468
- package/dist/scripts/aster.js +5 -5
- package/dist/scripts/aster.js.map +1 -1
- package/dist/scripts/cleanup-examples.js +1 -1
- package/dist/scripts/cleanup-examples.js.map +1 -1
- package/dist/scripts/emit-classfiles.js +1 -50
- package/dist/scripts/emit-classfiles.js.map +1 -1
- package/dist/scripts/emit-core.js +1 -1
- package/dist/scripts/emit-core.js.map +1 -1
- package/dist/scripts/golden.js +5 -8
- package/dist/scripts/golden.js.map +1 -1
- package/dist/scripts/lsp-build-index.js +1 -1
- package/dist/scripts/lsp-build-index.js.map +1 -1
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.js +2 -2
- package/dist/scripts/lsp-capmanifest-codeaction-smoke.js.map +1 -1
- package/dist/scripts/lsp-codeaction-smoke.js +2 -2
- package/dist/scripts/lsp-codeaction-smoke.js.map +1 -1
- package/dist/scripts/lsp-health-smoke.js +1 -1
- package/dist/scripts/lsp-health-smoke.js.map +1 -1
- package/dist/scripts/lsp-missing-header-codeaction-smoke.js +1 -1
- package/dist/scripts/lsp-missing-header-codeaction-smoke.js.map +1 -1
- package/dist/scripts/lsp-multi-rename.test.js +1 -1
- package/dist/scripts/lsp-multi-rename.test.js.map +1 -1
- package/dist/scripts/lsp-punct-codeaction-smoke.js +1 -1
- package/dist/scripts/lsp-punct-codeaction-smoke.js.map +1 -1
- package/dist/scripts/lsp-streaming-progress-smoke.js +2 -2
- package/dist/scripts/lsp-streaming-progress-smoke.js.map +1 -1
- package/dist/scripts/perf-benchmark.js +1 -1
- package/dist/scripts/perf-benchmark.js.map +1 -1
- package/dist/scripts/perf-diagnostics.js +1 -1
- package/dist/scripts/perf-diagnostics.js.map +1 -1
- package/dist/scripts/profile-medium-project.js +1 -1
- package/dist/scripts/profile-medium-project.js.map +1 -1
- package/dist/scripts/repl.js +1 -1
- package/dist/scripts/repl.js.map +1 -1
- package/dist/scripts/typecheck-cli.js +1 -1
- package/dist/scripts/typecheck-cli.js.map +1 -1
- package/dist/scripts/update-eff-violation-expected.js +1 -1
- package/dist/scripts/update-eff-violation-expected.js.map +1 -1
- package/dist/scripts/verify-capabilities.js +1 -1
- package/dist/scripts/verify-capabilities.js.map +1 -1
- package/dist/src/ai/validator.d.ts.map +1 -1
- package/dist/src/ai/validator.js +13 -1
- package/dist/src/ai/validator.js.map +1 -1
- package/dist/src/ast/ast.js +1 -1
- package/dist/src/ast/ast.js.map +1 -1
- package/dist/src/browser.d.ts +10 -18
- package/dist/src/browser.d.ts.map +1 -1
- package/dist/src/browser.js +36 -33
- package/dist/src/browser.js.map +1 -1
- package/dist/src/cli/policy-converter.js +1 -1
- package/dist/src/cli/policy-converter.js.map +1 -1
- package/dist/src/config/lexicons/diagnostic-messages.d.ts +23 -0
- package/dist/src/config/lexicons/diagnostic-messages.d.ts.map +1 -0
- package/dist/src/config/lexicons/diagnostic-messages.js +130 -0
- package/dist/src/config/lexicons/diagnostic-messages.js.map +1 -0
- package/dist/src/config/lexicons/input-generation-rules.d.ts +22 -0
- package/dist/src/config/lexicons/input-generation-rules.d.ts.map +1 -0
- package/dist/src/config/lexicons/input-generation-rules.js +142 -0
- package/dist/src/config/lexicons/input-generation-rules.js.map +1 -0
- package/dist/src/config/lexicons/lsp-ui-texts.d.ts +42 -0
- package/dist/src/config/lexicons/lsp-ui-texts.d.ts.map +1 -0
- package/dist/src/config/lexicons/lsp-ui-texts.js +75 -0
- package/dist/src/config/lexicons/lsp-ui-texts.js.map +1 -0
- package/dist/src/config/lexicons/overlay-loader.d.ts +55 -0
- package/dist/src/config/lexicons/overlay-loader.d.ts.map +1 -0
- package/dist/src/config/lexicons/overlay-loader.js +30 -0
- package/dist/src/config/lexicons/overlay-loader.js.map +1 -0
- package/dist/src/config/lexicons/type-inference-rules.d.ts +19 -0
- package/dist/src/config/lexicons/type-inference-rules.d.ts.map +1 -0
- package/dist/src/config/lexicons/type-inference-rules.js +56 -0
- package/dist/src/config/lexicons/type-inference-rules.js.map +1 -0
- package/dist/src/config/lexicons/types.d.ts +10 -0
- package/dist/src/config/lexicons/types.d.ts.map +1 -1
- package/dist/src/config/lexicons/types.js.map +1 -1
- package/dist/src/config/semantic.d.ts +0 -8
- package/dist/src/config/semantic.d.ts.map +1 -1
- package/dist/src/config/semantic.js +0 -16
- package/dist/src/config/semantic.js.map +1 -1
- package/dist/src/core/index.d.ts +2 -0
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/index.js +1 -0
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/core/interpreter.d.ts +37 -0
- package/dist/src/core/interpreter.d.ts.map +1 -0
- package/dist/src/core/interpreter.js +454 -0
- package/dist/src/core/interpreter.js.map +1 -0
- package/dist/src/diagnostics/diagnostics.d.ts +6 -7
- package/dist/src/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics/diagnostics.js +15 -9
- package/dist/src/diagnostics/diagnostics.js.map +1 -1
- package/dist/src/diagnostics/error_codes.d.ts +2 -1
- package/dist/src/diagnostics/error_codes.d.ts.map +1 -1
- package/dist/src/diagnostics/error_codes.js +85 -480
- package/dist/src/diagnostics/error_codes.js.map +1 -1
- package/dist/src/formatter.js +9 -24
- package/dist/src/formatter.js.map +1 -1
- package/dist/src/frontend/lexer.d.ts +1 -1
- package/dist/src/frontend/lexer.js +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/jvm/emitter.js +3 -3
- package/dist/src/jvm/emitter.js.map +1 -1
- package/dist/src/lower_to_core.d.ts +3 -3
- package/dist/src/lower_to_core.js +3 -3
- package/dist/src/lsp/codeaction.d.ts +2 -1
- package/dist/src/lsp/codeaction.d.ts.map +1 -1
- package/dist/src/lsp/codeaction.js +17 -14
- package/dist/src/lsp/codeaction.js.map +1 -1
- package/dist/src/lsp/completion.d.ts +4 -51
- package/dist/src/lsp/completion.d.ts.map +1 -1
- package/dist/src/lsp/completion.js +16 -84
- package/dist/src/lsp/completion.js.map +1 -1
- package/dist/src/lsp/diagnostics.d.ts +3 -2
- package/dist/src/lsp/diagnostics.d.ts.map +1 -1
- package/dist/src/lsp/diagnostics.js +14 -7
- package/dist/src/lsp/diagnostics.js.map +1 -1
- package/dist/src/lsp/navigation/definition.js +1 -1
- package/dist/src/lsp/navigation/definition.js.map +1 -1
- package/dist/src/lsp/navigation/document-symbol.js +1 -1
- package/dist/src/lsp/navigation/document-symbol.js.map +1 -1
- package/dist/src/lsp/navigation/hover.d.ts +2 -1
- package/dist/src/lsp/navigation/hover.d.ts.map +1 -1
- package/dist/src/lsp/navigation/hover.js +23 -36
- package/dist/src/lsp/navigation/hover.js.map +1 -1
- package/dist/src/lsp/navigation.d.ts +1 -1
- package/dist/src/lsp/navigation.d.ts.map +1 -1
- package/dist/src/lsp/navigation.js +2 -2
- package/dist/src/lsp/navigation.js.map +1 -1
- package/dist/src/lsp/pii_diagnostics.js +3 -13
- package/dist/src/lsp/pii_diagnostics.js.map +1 -1
- package/dist/src/lsp/server.js +35 -8
- package/dist/src/lsp/server.js.map +1 -1
- package/dist/src/lsp/tokens.js +2 -2
- package/dist/src/lsp/tokens.js.map +1 -1
- package/dist/src/lsp/workspace/document-indexer.js +2 -2
- package/dist/src/lsp/workspace/document-indexer.js.map +1 -1
- package/dist/src/package/resolver.js +6 -6
- package/dist/src/package/resolver.js.map +1 -1
- package/dist/src/parser/constraint-parser.d.ts +1 -10
- package/dist/src/parser/constraint-parser.d.ts.map +1 -1
- package/dist/src/parser/constraint-parser.js +0 -30
- package/dist/src/parser/constraint-parser.js.map +1 -1
- package/dist/src/parser/context.d.ts +3 -1
- package/dist/src/parser/context.d.ts.map +1 -1
- package/dist/src/parser/context.js +2 -1
- package/dist/src/parser/context.js.map +1 -1
- package/dist/src/parser/decl-parser.d.ts +6 -10
- package/dist/src/parser/decl-parser.d.ts.map +1 -1
- package/dist/src/parser/decl-parser.js +86 -58
- package/dist/src/parser/decl-parser.js.map +1 -1
- package/dist/src/parser/expr-stmt-parser.js +3 -3
- package/dist/src/parser/expr-stmt-parser.js.map +1 -1
- package/dist/src/parser/field-variant-parser.js +1 -1
- package/dist/src/parser/field-variant-parser.js.map +1 -1
- package/dist/src/parser/import-parser.d.ts +1 -1
- package/dist/src/parser/import-parser.js +2 -2
- package/dist/src/parser/import-parser.js.map +1 -1
- package/dist/src/parser/input-generator.d.ts +20 -6
- package/dist/src/parser/input-generator.d.ts.map +1 -1
- package/dist/src/parser/input-generator.js +20 -403
- package/dist/src/parser/input-generator.js.map +1 -1
- package/dist/src/parser/type-inference.d.ts +10 -16
- package/dist/src/parser/type-inference.d.ts.map +1 -1
- package/dist/src/parser/type-inference.js +36 -127
- package/dist/src/parser/type-inference.js.map +1 -1
- package/dist/src/parser.d.ts +18 -5
- package/dist/src/parser.d.ts.map +1 -1
- package/dist/src/parser.js +11 -8
- package/dist/src/parser.js.map +1 -1
- package/dist/src/typecheck/context.d.ts +2 -0
- package/dist/src/typecheck/context.d.ts.map +1 -1
- package/dist/src/typecheck/context.js.map +1 -1
- package/dist/src/typecheck/diagnostics.d.ts +6 -0
- package/dist/src/typecheck/diagnostics.d.ts.map +1 -1
- package/dist/src/typecheck/diagnostics.js +11 -3
- package/dist/src/typecheck/diagnostics.js.map +1 -1
- package/dist/src/typecheck/module.d.ts.map +1 -1
- package/dist/src/typecheck/module.js +8 -2
- package/dist/src/typecheck/module.js.map +1 -1
- package/dist/src/typecheck/workflow.js +10 -10
- package/dist/src/typecheck/workflow.js.map +1 -1
- package/dist/src/types/type-inference.d.ts +20 -0
- package/dist/src/types/type-inference.d.ts.map +1 -0
- package/dist/src/types/type-inference.js +8 -0
- package/dist/src/types/type-inference.js.map +1 -0
- package/dist/src/types.d.ts +0 -21
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/test/benchmark.js +8 -8
- package/dist/test/benchmark.js.map +1 -1
- package/dist/test/compiler/depends-on.test.js +1 -1
- package/dist/test/compiler/depends-on.test.js.map +1 -1
- package/dist/test/compiler/workflow-emitter-helpers.js +1 -1
- package/dist/test/compiler/workflow-emitter-helpers.js.map +1 -1
- package/dist/test/e2e/runner/golden-runner.js +3 -3
- package/dist/test/e2e/runner/golden-runner.js.map +1 -1
- package/dist/test/fuzz/formatter-fuzz.test.js +5 -1
- package/dist/test/fuzz/formatter-fuzz.test.js.map +1 -1
- package/dist/test/integration/compliance/compliance-smoke.test.js +4 -1
- package/dist/test/integration/compliance/compliance-smoke.test.js.map +1 -1
- package/dist/test/integration/lsp/lsp-completion.test.js +1 -1
- package/dist/test/integration/lsp/lsp-completion.test.js.map +1 -1
- package/dist/test/integration/lsp/lsp-diagnostics.test.js +1 -1
- package/dist/test/integration/lsp/lsp-diagnostics.test.js.map +1 -1
- package/dist/test/integration/lsp/lsp-modules.test.js +1 -1
- package/dist/test/integration/lsp/lsp-modules.test.js.map +1 -1
- package/dist/test/integration/lsp/lsp-navigation.test.js +1 -1
- package/dist/test/integration/lsp/lsp-navigation.test.js.map +1 -1
- package/dist/test/integration/pipeline/pipeline.test.js +4 -4
- package/dist/test/integration/pipeline/pipeline.test.js.map +1 -1
- package/dist/test/property/lsp-props.test.js +2 -2
- package/dist/test/property/lsp-props.test.js.map +1 -1
- package/dist/test/property/property.test.js +15 -15
- package/dist/test/property/property.test.js.map +1 -1
- package/dist/test/regression/type-checker-golden.test.js +1 -1
- package/dist/test/regression/type-checker-golden.test.js.map +1 -1
- package/dist/test/type-checker/cross-module-packages.test.js +1 -1
- package/dist/test/type-checker/cross-module-packages.test.js.map +1 -1
- package/dist/test/type-checker/pii-propagation.test.js +1 -2
- package/dist/test/type-checker/pii-propagation.test.js.map +1 -1
- package/dist/test/unit/async/async-discipline.test.js +1 -1
- package/dist/test/unit/async/async-discipline.test.js.map +1 -1
- package/dist/test/unit/async/async-schedule.test.js +1 -1
- package/dist/test/unit/async/async-schedule.test.js.map +1 -1
- package/dist/test/unit/browser/extract-schema.test.d.ts +2 -0
- package/dist/test/unit/browser/extract-schema.test.d.ts.map +1 -0
- package/dist/test/unit/browser/extract-schema.test.js +117 -0
- package/dist/test/unit/browser/extract-schema.test.js.map +1 -0
- package/dist/test/unit/emitter/emitter.test.js +30 -35
- package/dist/test/unit/emitter/emitter.test.js.map +1 -1
- package/dist/test/unit/interpreter/interpreter.test.d.ts +2 -0
- package/dist/test/unit/interpreter/interpreter.test.d.ts.map +1 -0
- package/dist/test/unit/interpreter/interpreter.test.js +507 -0
- package/dist/test/unit/interpreter/interpreter.test.js.map +1 -0
- package/dist/test/unit/keyword-translator.test.js +4 -4
- package/dist/test/unit/keyword-translator.test.js.map +1 -1
- package/dist/test/unit/lowering/lowering.test.js +2 -2
- package/dist/test/unit/lowering/lowering.test.js.map +1 -1
- package/dist/test/unit/lsp/pii-diagnostics.test.js +5 -5
- package/dist/test/unit/lsp/pii-diagnostics.test.js.map +1 -1
- package/dist/test/unit/parser/parser.test.js +39 -37
- package/dist/test/unit/parser/parser.test.js.map +1 -1
- package/dist/test/unit/parser/type-inference.test.js +50 -32
- package/dist/test/unit/parser/type-inference.test.js.map +1 -1
- package/dist/test/unit/typecheck/async-discipline-extended.test.js +1 -1
- package/dist/test/unit/typecheck/async-discipline-extended.test.js.map +1 -1
- package/dist/test/unit/typecheck/effects-and-capabilities.test.js +4 -4
- package/dist/test/unit/typecheck/effects-and-capabilities.test.js.map +1 -1
- package/dist/test/unit/typecheck/regression-fixes.test.js +12 -12
- package/dist/test/unit/typecheck/regression-fixes.test.js.map +1 -1
- package/dist/test/unit/typecheck/type-inference.test.js +1 -1
- package/dist/test/unit/typecheck/type-inference.test.js.map +1 -1
- package/dist/test/unit/typecheck/type-system.test.js +2 -2
- package/dist/test/unit/typecheck/type-system.test.js.map +1 -1
- package/dist/test/unit/typecheck/typecheck-advanced.test.js +3 -3
- package/dist/test/unit/typecheck/typecheck-advanced.test.js.map +1 -1
- package/package.json +6 -3
|
@@ -8,12 +8,12 @@ export const ERROR_MESSAGES = {
|
|
|
8
8
|
["E005" /* ErrorCode.TYPE_PARAM_UNUSED */]: "Type parameter '{name}' on '{func}' is declared but not used.",
|
|
9
9
|
["E006" /* ErrorCode.TYPEVAR_LIKE_UNDECLARED */]: "Type variable-like '{name}' is used in '{func}' but not declared; declare it with 'of {name}'.",
|
|
10
10
|
["E007" /* ErrorCode.TYPEVAR_INCONSISTENT */]: "Type variable '{name}' inferred inconsistently: {previous} vs {actual}",
|
|
11
|
-
["E008" /* ErrorCode.IF_BRANCH_MISMATCH */]: "If
|
|
11
|
+
["E008" /* ErrorCode.IF_BRANCH_MISMATCH */]: "If branch type mismatch: then {thenType} vs else {elseType}",
|
|
12
12
|
["E009" /* ErrorCode.MATCH_BRANCH_MISMATCH */]: "Match case return types differ: {expected} vs {actual}",
|
|
13
13
|
["E010" /* ErrorCode.INTEGER_PATTERN_TYPE */]: "Integer pattern used on non-Int scrutinee ({scrutineeType})",
|
|
14
14
|
["E011" /* ErrorCode.UNKNOWN_FIELD */]: "Unknown field '{field}' for {type}",
|
|
15
15
|
["E012" /* ErrorCode.FIELD_TYPE_MISMATCH */]: "Field '{field}' expects {expected}, got {actual}",
|
|
16
|
-
["E013" /* ErrorCode.MISSING_REQUIRED_FIELD */]: "
|
|
16
|
+
["E013" /* ErrorCode.MISSING_REQUIRED_FIELD */]: "Construction of {type} missing required field '{field}'",
|
|
17
17
|
["E014" /* ErrorCode.NOT_CALL_ARITY */]: "not(...) expects 1 argument",
|
|
18
18
|
["E015" /* ErrorCode.AWAIT_TYPE */]: "await expects Maybe<T> or Result<T,E>, got {type}",
|
|
19
19
|
["E016" /* ErrorCode.DUPLICATE_ENUM_CASE */]: "Duplicate enum case '{case}' in match on {type}.",
|
|
@@ -31,9 +31,9 @@ export const ERROR_MESSAGES = {
|
|
|
31
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.",
|
|
32
32
|
["E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */]: "Workflow step '{step}' depends on undefined step '{dependency}'.",
|
|
33
33
|
["E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */]: "Workflow contains circular step dependency: {cycle}",
|
|
34
|
-
["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: "
|
|
35
|
-
["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: "PII
|
|
36
|
-
["E073" /* ErrorCode.PII_ARG_VIOLATION */]: "PII
|
|
34
|
+
["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: "Cannot assign PII data to lower-level target: {source} -> {target}",
|
|
35
|
+
["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: "PII level {level} data output to {sinkKind} without sanitization",
|
|
36
|
+
["E073" /* ErrorCode.PII_ARG_VIOLATION */]: "PII argument type mismatch: expected {expected}, got {actual}",
|
|
37
37
|
["E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */]: "Duplicate import alias '{alias}'.",
|
|
38
38
|
["E101" /* ErrorCode.UNDEFINED_VARIABLE */]: "Undefined variable: {name}",
|
|
39
39
|
["E102" /* ErrorCode.DUPLICATE_SYMBOL */]: "Symbol '{name}' is already defined in this scope.",
|
|
@@ -42,13 +42,13 @@ export const ERROR_MESSAGES = {
|
|
|
42
42
|
["E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */]: "Function '{func}' declares @io but only CPU-like work found; @io subsumes @cpu and may be unnecessary.",
|
|
43
43
|
["E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */]: "Function '{func}' declares @io but no obvious I/O found.",
|
|
44
44
|
["E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */]: "Function '{func}' declares @cpu but no obvious CPU-bound work found.",
|
|
45
|
-
["E205" /* ErrorCode.EFF_INFER_MISSING_IO */]: "
|
|
46
|
-
["E206" /* ErrorCode.EFF_INFER_MISSING_CPU */]: "
|
|
47
|
-
["E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */]: "
|
|
48
|
-
["E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */]: "
|
|
49
|
-
["E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */]: "
|
|
50
|
-
["E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */]: "
|
|
51
|
-
["E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */]: "
|
|
45
|
+
["E205" /* ErrorCode.EFF_INFER_MISSING_IO */]: "Function '{func}' missing @io effect declaration, inference requires IO.",
|
|
46
|
+
["E206" /* ErrorCode.EFF_INFER_MISSING_CPU */]: "Function '{func}' missing @cpu effect declaration, inference requires CPU (or @io).",
|
|
47
|
+
["E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */]: "Function '{func}' declares @io but no IO side effects inferred.",
|
|
48
|
+
["E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */]: "Function '{func}' declares @cpu but no CPU side effects inferred.",
|
|
49
|
+
["E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */]: "Function '{func}' declares both @cpu and @io; @cpu is redundant since @io is required.",
|
|
50
|
+
["E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */]: "Effect variable {var} undeclared",
|
|
51
|
+
["E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */]: "Effect variable {vars} could not be resolved to concrete effects",
|
|
52
52
|
["E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */]: "Function '{func}' requires {cap} capability but manifest for module '{module}' denies it.",
|
|
53
53
|
["E301" /* ErrorCode.EFF_CAP_MISSING */]: "Function '{func}' uses {cap} capability but header declares [{declared}].",
|
|
54
54
|
["E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */]: "Function '{func}' declares {cap} capability but it is not used.",
|
|
@@ -63,480 +63,85 @@ export const ERROR_MESSAGES = {
|
|
|
63
63
|
["E502" /* ErrorCode.ASYNC_DUPLICATE_START */]: "Async task '{task}' started multiple times ({count} occurrences)",
|
|
64
64
|
["E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */]: "Async task '{task}' waited multiple times ({count} occurrences)",
|
|
65
65
|
["E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */]: "Wait for async task '{task}' occurs before any matching start",
|
|
66
|
-
["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: "
|
|
67
|
-
["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: "
|
|
68
|
-
["W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */]: "Workflow retry
|
|
69
|
-
["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: "Workflow timeout
|
|
66
|
+
["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: "Implicit PII level escalation detected: {source} -> {target}",
|
|
67
|
+
["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: "PII data may flow to {sinkKind} without annotation",
|
|
68
|
+
["W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */]: "Workflow retry configuration may be unreasonable: {reason}",
|
|
69
|
+
["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: "Workflow timeout configuration may be unreasonable: {reason}",
|
|
70
70
|
};
|
|
71
71
|
export const ERROR_METADATA = {
|
|
72
|
-
["E001" /* ErrorCode.TYPE_MISMATCH */]: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
["
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
["
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
["
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
["
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
["
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
["
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
["
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
["
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
["
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
severity: 'error',
|
|
139
|
-
message: "Integer pattern used on non-Int scrutinee ({scrutineeType})",
|
|
140
|
-
help: "仅在 Int 类型的匹配表达式中使用整数模式。",
|
|
141
|
-
},
|
|
142
|
-
["E011" /* ErrorCode.UNKNOWN_FIELD */]: {
|
|
143
|
-
code: "E011" /* ErrorCode.UNKNOWN_FIELD */,
|
|
144
|
-
category: 'type',
|
|
145
|
-
severity: 'error',
|
|
146
|
-
message: "Unknown field '{field}' for {type}",
|
|
147
|
-
help: "检查构造体或数据类型的字段名称是否正确。",
|
|
148
|
-
},
|
|
149
|
-
["E012" /* ErrorCode.FIELD_TYPE_MISMATCH */]: {
|
|
150
|
-
code: "E012" /* ErrorCode.FIELD_TYPE_MISMATCH */,
|
|
151
|
-
category: 'type',
|
|
152
|
-
severity: 'error',
|
|
153
|
-
message: "Field '{field}' expects {expected}, got {actual}",
|
|
154
|
-
help: "校验字段初始化表达式的类型是否匹配声明。",
|
|
155
|
-
},
|
|
156
|
-
["E013" /* ErrorCode.MISSING_REQUIRED_FIELD */]: {
|
|
157
|
-
code: "E013" /* ErrorCode.MISSING_REQUIRED_FIELD */,
|
|
158
|
-
category: 'type',
|
|
159
|
-
severity: 'error',
|
|
160
|
-
message: "构造 {type} 缺少必需字段 '{field}'",
|
|
161
|
-
help: "为数据构造提供声明中的所有必需字段。",
|
|
162
|
-
},
|
|
163
|
-
["E014" /* ErrorCode.NOT_CALL_ARITY */]: {
|
|
164
|
-
code: "E014" /* ErrorCode.NOT_CALL_ARITY */,
|
|
165
|
-
category: 'type',
|
|
166
|
-
severity: 'error',
|
|
167
|
-
message: "not(...) expects 1 argument",
|
|
168
|
-
help: "调整 not 调用的参数数量为 1。",
|
|
169
|
-
},
|
|
170
|
-
["E015" /* ErrorCode.AWAIT_TYPE */]: {
|
|
171
|
-
code: "E015" /* ErrorCode.AWAIT_TYPE */,
|
|
172
|
-
category: 'type',
|
|
173
|
-
severity: 'warning',
|
|
174
|
-
message: "await expects Maybe<T> or Result<T,E>, got {type}",
|
|
175
|
-
help: "仅对 Maybe 或 Result 类型调用 await。",
|
|
176
|
-
},
|
|
177
|
-
["E016" /* ErrorCode.DUPLICATE_ENUM_CASE */]: {
|
|
178
|
-
code: "E016" /* ErrorCode.DUPLICATE_ENUM_CASE */,
|
|
179
|
-
category: 'type',
|
|
180
|
-
severity: 'warning',
|
|
181
|
-
message: "Duplicate enum case '{case}' in match on {type}.",
|
|
182
|
-
help: "移除重复的枚举分支,保持匹配语句简洁。",
|
|
183
|
-
},
|
|
184
|
-
["E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */]: {
|
|
185
|
-
code: "E017" /* ErrorCode.NON_EXHAUSTIVE_MAYBE */,
|
|
186
|
-
category: 'type',
|
|
187
|
-
severity: 'warning',
|
|
188
|
-
message: "Non-exhaustive match on Maybe type; missing {missing} case.",
|
|
189
|
-
help: "为 Maybe 匹配补齐 null 与非 null 分支。",
|
|
190
|
-
},
|
|
191
|
-
["E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */]: {
|
|
192
|
-
code: "E018" /* ErrorCode.NON_EXHAUSTIVE_ENUM */,
|
|
193
|
-
category: 'type',
|
|
194
|
-
severity: 'warning',
|
|
195
|
-
message: "Non-exhaustive match on {type}; missing: {missing}",
|
|
196
|
-
help: "补充所有未覆盖的枚举分支,或添加通配符。",
|
|
197
|
-
},
|
|
198
|
-
["E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */]: {
|
|
199
|
-
code: "E019" /* ErrorCode.AMBIGUOUS_INTEROP_NUMERIC */,
|
|
200
|
-
category: 'type',
|
|
201
|
-
severity: 'warning',
|
|
202
|
-
message: "Ambiguous interop call '{target}': mixing numeric kinds (Int={hasInt}, Long={hasLong}, Double={hasDouble}). Overload resolution may widen/box implicitly.",
|
|
203
|
-
help: "统一互操作调用的参数数值类型,避免隐式装箱与拓宽。",
|
|
204
|
-
},
|
|
205
|
-
["E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */]: {
|
|
206
|
-
code: "E020" /* ErrorCode.LIST_ELEMENT_TYPE_MISMATCH */,
|
|
207
|
-
category: 'type',
|
|
208
|
-
severity: 'error',
|
|
209
|
-
message: "List literal element type mismatch: expected {expected}, got {actual}",
|
|
210
|
-
help: "确保列表字面量中的所有元素类型一致。",
|
|
211
|
-
},
|
|
212
|
-
["E021" /* ErrorCode.OPTIONAL_EXPECTED */]: {
|
|
213
|
-
code: "E021" /* ErrorCode.OPTIONAL_EXPECTED */,
|
|
214
|
-
category: 'type',
|
|
215
|
-
severity: 'error',
|
|
216
|
-
message: "Optional value required here: expected Maybe or Option, but got {actual}",
|
|
217
|
-
help: "传入 Maybe/Option 类型或显式包装值。",
|
|
218
|
-
},
|
|
219
|
-
["E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */]: {
|
|
220
|
-
code: "E022" /* ErrorCode.WORKFLOW_COMPENSATE_TYPE */,
|
|
221
|
-
category: 'type',
|
|
222
|
-
severity: 'error',
|
|
223
|
-
message: "Compensate block for step '{step}' must return Result<Unit, {expectedErr}>, got {actual}",
|
|
224
|
-
help: "确保补偿块返回 Result<Unit, E>,其中 E 为 step 错误类型。",
|
|
225
|
-
},
|
|
226
|
-
["E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */]: {
|
|
227
|
-
code: "E023" /* ErrorCode.WORKFLOW_COMPENSATE_MISSING */,
|
|
228
|
-
category: 'effect',
|
|
229
|
-
severity: 'warning',
|
|
230
|
-
message: "Step '{step}' performs side effects but does not define a compensate block.",
|
|
231
|
-
help: "为包含 IO 副作用的 step 提供 compensate 块以便回滚。",
|
|
232
|
-
},
|
|
233
|
-
["E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */]: {
|
|
234
|
-
code: "E024" /* ErrorCode.WORKFLOW_RETRY_INVALID */,
|
|
235
|
-
category: 'type',
|
|
236
|
-
severity: 'error',
|
|
237
|
-
message: "Workflow retry max attempts must be greater than zero (actual: {maxAttempts}).",
|
|
238
|
-
help: "设置 retry.maxAttempts 为正整数。",
|
|
239
|
-
},
|
|
240
|
-
["E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */]: {
|
|
241
|
-
code: "E025" /* ErrorCode.WORKFLOW_TIMEOUT_INVALID */,
|
|
242
|
-
category: 'type',
|
|
243
|
-
severity: 'error',
|
|
244
|
-
message: "Workflow timeout must be greater than zero milliseconds (actual: {milliseconds}).",
|
|
245
|
-
help: "配置 timeout 秒数为正值,确保补偿逻辑可被触发。",
|
|
246
|
-
},
|
|
247
|
-
["E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */]: {
|
|
248
|
-
code: "E026" /* ErrorCode.WORKFLOW_MISSING_IO_EFFECT */,
|
|
249
|
-
category: 'effect',
|
|
250
|
-
severity: 'error',
|
|
251
|
-
message: "Workflow '{func}' must declare @io effect before using a 'workflow' block.",
|
|
252
|
-
help: "在函数 '{func}' 的头部添加 `It performs io ...`(可同时声明 capability),否则编译器拒绝 workflow 语句。",
|
|
253
|
-
},
|
|
254
|
-
["E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */]: {
|
|
255
|
-
code: "E027" /* ErrorCode.WORKFLOW_UNDECLARED_CAPABILITY */,
|
|
256
|
-
category: 'capability',
|
|
257
|
-
severity: 'error',
|
|
258
|
-
message: "Workflow '{func}' step '{step}' uses capability {capability} that is not declared on the function header.",
|
|
259
|
-
help: "在 `It performs io with ...` 中列出 {capability}(例如 Http、Sql、Secrets),或调整 step 代码避免调用未授权能力。",
|
|
260
|
-
},
|
|
261
|
-
["E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */]: {
|
|
262
|
-
code: "E028" /* ErrorCode.COMPENSATE_NEW_CAPABILITY */,
|
|
263
|
-
category: 'capability',
|
|
264
|
-
severity: 'error',
|
|
265
|
-
message: "Compensate block for step '{step}' in function '{func}' introduces new capability {capability} that does not appear in the main step body.",
|
|
266
|
-
help: "Compensate 只能重复主体已使用的能力;如需额外调用,请将相同行为移至主体或在主体中声明该 capability。",
|
|
267
|
-
},
|
|
268
|
-
["E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */]: {
|
|
269
|
-
code: "E029" /* ErrorCode.WORKFLOW_UNKNOWN_STEP_DEPENDENCY */,
|
|
270
|
-
category: 'scope',
|
|
271
|
-
severity: 'error',
|
|
272
|
-
message: "Workflow step '{step}' depends on undefined step '{dependency}'.",
|
|
273
|
-
help: "仅引用当前 workflow 中已声明的步骤名称,或修正依赖拼写。",
|
|
274
|
-
},
|
|
275
|
-
["E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */]: {
|
|
276
|
-
code: "E030" /* ErrorCode.WORKFLOW_CIRCULAR_DEPENDENCY */,
|
|
277
|
-
category: 'type',
|
|
278
|
-
severity: 'error',
|
|
279
|
-
message: "Workflow contains circular step dependency: {cycle}",
|
|
280
|
-
help: "移除或重构循环依赖,确保步骤可拓扑排序执行。",
|
|
281
|
-
},
|
|
282
|
-
["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: {
|
|
283
|
-
code: "E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */,
|
|
284
|
-
category: 'type',
|
|
285
|
-
severity: 'error',
|
|
286
|
-
message: "禁止将 PII 数据赋给较低等级目标: {source} -> {target}",
|
|
287
|
-
help: "使用脱敏函数或为目标变量声明匹配的 @pii 等级。",
|
|
288
|
-
},
|
|
289
|
-
["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: {
|
|
290
|
-
code: "E072" /* ErrorCode.PII_SINK_UNSANITIZED */,
|
|
291
|
-
category: 'type',
|
|
292
|
-
severity: 'error',
|
|
293
|
-
message: "PII 等级 {level} 数据未脱敏即输出到 {sinkKind}",
|
|
294
|
-
help: "在输出前调用 redact() 或 tokenize() 以降低敏感度。",
|
|
295
|
-
},
|
|
296
|
-
["E073" /* ErrorCode.PII_ARG_VIOLATION */]: {
|
|
297
|
-
code: "E073" /* ErrorCode.PII_ARG_VIOLATION */,
|
|
298
|
-
category: 'type',
|
|
299
|
-
severity: 'error',
|
|
300
|
-
message: "PII 参数类型不匹配: 期望 {expected}, 实际 {actual}",
|
|
301
|
-
help: "检查函数签名,确保 PII 等级与类别一致。",
|
|
302
|
-
},
|
|
303
|
-
["E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */]: {
|
|
304
|
-
code: "E100" /* ErrorCode.DUPLICATE_IMPORT_ALIAS */,
|
|
305
|
-
category: 'scope',
|
|
306
|
-
severity: 'warning',
|
|
307
|
-
message: "Duplicate import alias '{alias}'.",
|
|
308
|
-
help: "为不同的导入使用唯一别名,避免覆盖。",
|
|
309
|
-
},
|
|
310
|
-
["E101" /* ErrorCode.UNDEFINED_VARIABLE */]: {
|
|
311
|
-
code: "E101" /* ErrorCode.UNDEFINED_VARIABLE */,
|
|
312
|
-
category: 'scope',
|
|
313
|
-
severity: 'error',
|
|
314
|
-
message: "Undefined variable: {name}",
|
|
315
|
-
help: "在使用变量前先声明并初始化。",
|
|
316
|
-
},
|
|
317
|
-
["E102" /* ErrorCode.DUPLICATE_SYMBOL */]: {
|
|
318
|
-
code: "E102" /* ErrorCode.DUPLICATE_SYMBOL */,
|
|
319
|
-
category: 'scope',
|
|
320
|
-
severity: 'error',
|
|
321
|
-
message: "Symbol '{name}' is already defined in this scope.",
|
|
322
|
-
help: "选择不同的名称或检查是否存在意外的重复声明。",
|
|
323
|
-
},
|
|
324
|
-
["E200" /* ErrorCode.EFF_MISSING_IO */]: {
|
|
325
|
-
code: "E200" /* ErrorCode.EFF_MISSING_IO */,
|
|
326
|
-
category: 'effect',
|
|
327
|
-
severity: 'error',
|
|
328
|
-
message: "Function '{func}' may perform I/O but is missing @io effect.",
|
|
329
|
-
help: "为具有 IO 行为的函数声明 @io 效果。",
|
|
330
|
-
},
|
|
331
|
-
["E201" /* ErrorCode.EFF_MISSING_CPU */]: {
|
|
332
|
-
code: "E201" /* ErrorCode.EFF_MISSING_CPU */,
|
|
333
|
-
category: 'effect',
|
|
334
|
-
severity: 'error',
|
|
335
|
-
message: "Function '{func}' may perform CPU-bound work but is missing @cpu (or @io) effect.",
|
|
336
|
-
help: "为 CPU 密集型函数声明 @cpu 或 @io 效果。",
|
|
337
|
-
},
|
|
338
|
-
["E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */]: {
|
|
339
|
-
code: "E202" /* ErrorCode.EFF_SUPERFLUOUS_IO_CPU_ONLY */,
|
|
340
|
-
category: 'effect',
|
|
341
|
-
severity: 'info',
|
|
342
|
-
message: "Function '{func}' declares @io but only CPU-like work found; @io subsumes @cpu and may be unnecessary.",
|
|
343
|
-
help: "若函数仅执行 CPU 工作,可移除多余的 @io 声明。",
|
|
344
|
-
},
|
|
345
|
-
["E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */]: {
|
|
346
|
-
code: "E203" /* ErrorCode.EFF_SUPERFLUOUS_IO */,
|
|
347
|
-
category: 'effect',
|
|
348
|
-
severity: 'warning',
|
|
349
|
-
message: "Function '{func}' declares @io but no obvious I/O found.",
|
|
350
|
-
help: "确认是否需要 @io;若无 IO 行为可移除。",
|
|
351
|
-
},
|
|
352
|
-
["E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */]: {
|
|
353
|
-
code: "E204" /* ErrorCode.EFF_SUPERFLUOUS_CPU */,
|
|
354
|
-
category: 'effect',
|
|
355
|
-
severity: 'warning',
|
|
356
|
-
message: "Function '{func}' declares @cpu but no obvious CPU-bound work found.",
|
|
357
|
-
help: "移除多余的 @cpu 声明或增加相应的 CPU 工作。",
|
|
358
|
-
},
|
|
359
|
-
["E205" /* ErrorCode.EFF_INFER_MISSING_IO */]: {
|
|
360
|
-
code: "E205" /* ErrorCode.EFF_INFER_MISSING_IO */,
|
|
361
|
-
category: 'effect',
|
|
362
|
-
severity: 'error',
|
|
363
|
-
message: "函数 '{func}' 缺少 @io 效果声明,推断要求 IO。",
|
|
364
|
-
help: "根据推断结果为函数添加 @io 效果。",
|
|
365
|
-
},
|
|
366
|
-
["E206" /* ErrorCode.EFF_INFER_MISSING_CPU */]: {
|
|
367
|
-
code: "E206" /* ErrorCode.EFF_INFER_MISSING_CPU */,
|
|
368
|
-
category: 'effect',
|
|
369
|
-
severity: 'error',
|
|
370
|
-
message: "函数 '{func}' 缺少 @cpu 效果声明,推断要求 CPU(或 @io)。",
|
|
371
|
-
help: "根据推断结果补齐 @cpu 或 @io 效果。",
|
|
372
|
-
},
|
|
373
|
-
["E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */]: {
|
|
374
|
-
code: "E207" /* ErrorCode.EFF_INFER_REDUNDANT_IO */,
|
|
375
|
-
category: 'effect',
|
|
376
|
-
severity: 'warning',
|
|
377
|
-
message: "函数 '{func}' 声明了 @io,但推断未发现 IO 副作用。",
|
|
378
|
-
help: "确认是否需要保留 @io 声明。",
|
|
379
|
-
},
|
|
380
|
-
["E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */]: {
|
|
381
|
-
code: "E208" /* ErrorCode.EFF_INFER_REDUNDANT_CPU */,
|
|
382
|
-
category: 'effect',
|
|
383
|
-
severity: 'warning',
|
|
384
|
-
message: "函数 '{func}' 声明了 @cpu,但推断未发现 CPU 副作用。",
|
|
385
|
-
help: "若无 CPU 副作用,可删除 @cpu 声明。",
|
|
386
|
-
},
|
|
387
|
-
["E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */]: {
|
|
388
|
-
code: "E209" /* ErrorCode.EFF_INFER_REDUNDANT_CPU_WITH_IO */,
|
|
389
|
-
category: 'effect',
|
|
390
|
-
severity: 'warning',
|
|
391
|
-
message: "函数 '{func}' 同时声明 @cpu 和 @io;由于需要 @io,@cpu 可移除。",
|
|
392
|
-
help: "保留 @io 即可满足需求,移除多余的 @cpu。",
|
|
393
|
-
},
|
|
394
|
-
["E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */]: {
|
|
395
|
-
code: "E210" /* ErrorCode.EFFECT_VAR_UNDECLARED */,
|
|
396
|
-
category: 'type',
|
|
397
|
-
severity: 'error',
|
|
398
|
-
message: '效应变量 {var} 未声明',
|
|
399
|
-
help: "在函数签名的效果参数列表中添加效应类型参数,例如:fn foo<E>(...) with E",
|
|
400
|
-
},
|
|
401
|
-
["E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */]: {
|
|
402
|
-
code: "E211" /* ErrorCode.EFFECT_VAR_UNRESOLVED */,
|
|
403
|
-
category: 'type',
|
|
404
|
-
severity: 'error',
|
|
405
|
-
message: '效应变量 {vars} 无法推断出具体效果',
|
|
406
|
-
help: '参考调用或声明补充明确的效果(pure/cpu/io/workflow),或移除未使用的效应变量。',
|
|
407
|
-
},
|
|
408
|
-
["E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */]: {
|
|
409
|
-
code: "E300" /* ErrorCode.CAPABILITY_NOT_ALLOWED */,
|
|
410
|
-
category: 'capability',
|
|
411
|
-
severity: 'error',
|
|
412
|
-
message: "Function '{func}' requires {cap} capability but manifest for module '{module}' denies it.",
|
|
413
|
-
help: "更新能力清单或修改函数实现以符合限制。",
|
|
414
|
-
},
|
|
415
|
-
["E301" /* ErrorCode.EFF_CAP_MISSING */]: {
|
|
416
|
-
code: "E301" /* ErrorCode.EFF_CAP_MISSING */,
|
|
417
|
-
category: 'capability',
|
|
418
|
-
severity: 'error',
|
|
419
|
-
message: "Function '{func}' uses {cap} capability but header declares [{declared}].",
|
|
420
|
-
help: "在函数头部声明实际使用到的能力。",
|
|
421
|
-
},
|
|
422
|
-
["E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */]: {
|
|
423
|
-
code: "E302" /* ErrorCode.EFF_CAP_SUPERFLUOUS */,
|
|
424
|
-
category: 'capability',
|
|
425
|
-
severity: 'info',
|
|
426
|
-
message: "Function '{func}' declares {cap} capability but it is not used.",
|
|
427
|
-
help: "移除未使用的能力声明以保持清晰。",
|
|
428
|
-
},
|
|
429
|
-
["E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */]: {
|
|
430
|
-
code: "E303" /* ErrorCode.CAPABILITY_INFER_MISSING_IO */,
|
|
431
|
-
category: 'capability',
|
|
432
|
-
severity: 'error',
|
|
433
|
-
message: "Function '{func}' uses IO capabilities [{capabilities}] but is missing @io effect (e.g., {calls}).",
|
|
434
|
-
help: "在函数头部声明 `It performs io ...`,或移除相关调用保持纯度。",
|
|
435
|
-
},
|
|
436
|
-
["E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */]: {
|
|
437
|
-
code: "E304" /* ErrorCode.CAPABILITY_INFER_MISSING_CPU */,
|
|
438
|
-
category: 'capability',
|
|
439
|
-
severity: 'error',
|
|
440
|
-
message: "Function '{func}' performs CPU capability calls (e.g., {calls}) but declares neither @cpu nor @io effect.",
|
|
441
|
-
help: "为函数添加 @cpu 或 @io 效果以覆盖 CPU 能力。",
|
|
442
|
-
},
|
|
443
|
-
["E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */]: {
|
|
444
|
-
code: "E400" /* ErrorCode.PII_HTTP_UNENCRYPTED */,
|
|
445
|
-
category: 'pii',
|
|
446
|
-
severity: 'error',
|
|
447
|
-
message: "PII data transmitted over HTTP without encryption",
|
|
448
|
-
help: "使用加密通道(HTTPS)或脱敏处理后再传输 PII 数据。",
|
|
449
|
-
},
|
|
450
|
-
["E401" /* ErrorCode.PII_ANNOTATION_MISSING */]: {
|
|
451
|
-
code: "E401" /* ErrorCode.PII_ANNOTATION_MISSING */,
|
|
452
|
-
category: 'pii',
|
|
453
|
-
severity: 'error',
|
|
454
|
-
message: "PII annotation missing for value flowing into '{sink}'",
|
|
455
|
-
help: "为敏感数据添加 @pii 标注以便跟踪。",
|
|
456
|
-
},
|
|
457
|
-
["E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */]: {
|
|
458
|
-
code: "E402" /* ErrorCode.PII_SENSITIVITY_MISMATCH */,
|
|
459
|
-
category: 'pii',
|
|
460
|
-
severity: 'warning',
|
|
461
|
-
message: "PII sensitivity mismatch: required {required}, got {actual}",
|
|
462
|
-
help: "调整数据的敏感级别或更新流程要求。",
|
|
463
|
-
},
|
|
464
|
-
["E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */]: {
|
|
465
|
-
code: "E403" /* ErrorCode.PII_MISSING_CONSENT_CHECK */,
|
|
466
|
-
category: 'pii',
|
|
467
|
-
severity: 'warning',
|
|
468
|
-
message: "Function '{func}' processes PII data without consent check (GDPR Art. 6)",
|
|
469
|
-
help: "在处理 PII 数据前调用 checkConsent() 或添加 @consent_required 注解。",
|
|
470
|
-
},
|
|
471
|
-
["E500" /* ErrorCode.ASYNC_START_NOT_WAITED */]: {
|
|
472
|
-
code: "E500" /* ErrorCode.ASYNC_START_NOT_WAITED */,
|
|
473
|
-
category: 'async',
|
|
474
|
-
severity: 'error',
|
|
475
|
-
message: "Started async task '{task}' not waited",
|
|
476
|
-
help: "对启动的异步任务调用 wait,确保执行完毕。",
|
|
477
|
-
},
|
|
478
|
-
["E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */]: {
|
|
479
|
-
code: "E501" /* ErrorCode.ASYNC_WAIT_NOT_STARTED */,
|
|
480
|
-
category: 'async',
|
|
481
|
-
severity: 'error',
|
|
482
|
-
message: "Waiting for async task '{task}' that was never started",
|
|
483
|
-
help: "确认 wait 的任务名称在 Start 中正确出现。",
|
|
484
|
-
},
|
|
485
|
-
["E502" /* ErrorCode.ASYNC_DUPLICATE_START */]: {
|
|
486
|
-
code: "E502" /* ErrorCode.ASYNC_DUPLICATE_START */,
|
|
487
|
-
category: 'async',
|
|
488
|
-
severity: 'error',
|
|
489
|
-
message: "Async task '{task}' started multiple times ({count} occurrences)",
|
|
490
|
-
help: "避免重复启动同名任务,可复用已有任务或改用新名称。",
|
|
491
|
-
},
|
|
492
|
-
["E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */]: {
|
|
493
|
-
code: "E503" /* ErrorCode.ASYNC_DUPLICATE_WAIT */,
|
|
494
|
-
category: 'async',
|
|
495
|
-
severity: 'warning',
|
|
496
|
-
message: "Async task '{task}' waited multiple times ({count} occurrences)",
|
|
497
|
-
help: "确保每个任务仅等待一次,或使用单独的同步机制。",
|
|
498
|
-
},
|
|
499
|
-
["E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */]: {
|
|
500
|
-
code: "E504" /* ErrorCode.ASYNC_WAIT_BEFORE_START */,
|
|
501
|
-
category: 'async',
|
|
502
|
-
severity: 'error',
|
|
503
|
-
message: "Wait for async task '{task}' occurs before any matching start",
|
|
504
|
-
help: "在 wait for 之前先执行 start,并确保两者位于兼容的控制路径。",
|
|
505
|
-
},
|
|
506
|
-
["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: {
|
|
507
|
-
code: "W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */,
|
|
508
|
-
category: 'type',
|
|
509
|
-
severity: 'warning',
|
|
510
|
-
message: "检测到隐式 PII 等级提升: {source} -> {target}",
|
|
511
|
-
help: "为等级变化添加显式类型注解以便审计。",
|
|
512
|
-
},
|
|
513
|
-
["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: {
|
|
514
|
-
code: "W074" /* ErrorCode.PII_SINK_UNKNOWN */,
|
|
515
|
-
category: 'type',
|
|
516
|
-
severity: 'warning',
|
|
517
|
-
message: "可能有 PII 数据流向 {sinkKind} 但缺少注解",
|
|
518
|
-
help: "为数据增加 @pii 注解以追踪敏感数据流。",
|
|
519
|
-
},
|
|
520
|
-
["W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */]: {
|
|
521
|
-
code: "W105" /* ErrorCode.WORKFLOW_RETRY_INCONSISTENT */,
|
|
522
|
-
category: 'type',
|
|
523
|
-
severity: 'warning',
|
|
524
|
-
message: "Workflow retry 配置可能不合理: {reason}",
|
|
525
|
-
help: "检查 retry 总等待时间、maxAttempts 与 backoff 策略的组合是否合理。",
|
|
526
|
-
},
|
|
527
|
-
["W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */]: {
|
|
528
|
-
code: "W106" /* ErrorCode.WORKFLOW_TIMEOUT_UNREASONABLE */,
|
|
529
|
-
category: 'type',
|
|
530
|
-
severity: 'warning',
|
|
531
|
-
message: "Workflow timeout 配置可能不合理: {reason}",
|
|
532
|
-
help: "检查 timeout 值是否过大或过小。",
|
|
533
|
-
},
|
|
72
|
+
["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." },
|
|
73
|
+
["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." },
|
|
74
|
+
["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." },
|
|
75
|
+
["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." },
|
|
76
|
+
["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." },
|
|
77
|
+
["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." },
|
|
78
|
+
["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." },
|
|
79
|
+
["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." },
|
|
80
|
+
["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." },
|
|
81
|
+
["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." },
|
|
82
|
+
["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." },
|
|
83
|
+
["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." },
|
|
84
|
+
["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." },
|
|
85
|
+
["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." },
|
|
86
|
+
["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." },
|
|
87
|
+
["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." },
|
|
88
|
+
["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." },
|
|
89
|
+
["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." },
|
|
90
|
+
["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." },
|
|
91
|
+
["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." },
|
|
92
|
+
["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." },
|
|
93
|
+
["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." },
|
|
94
|
+
["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." },
|
|
95
|
+
["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." },
|
|
96
|
+
["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." },
|
|
97
|
+
["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." },
|
|
98
|
+
["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." },
|
|
99
|
+
["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." },
|
|
100
|
+
["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." },
|
|
101
|
+
["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." },
|
|
102
|
+
["E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */]: { code: "E070" /* ErrorCode.PII_ASSIGN_DOWNGRADE */, category: 'type', 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." },
|
|
103
|
+
["E072" /* ErrorCode.PII_SINK_UNSANITIZED */]: { code: "E072" /* ErrorCode.PII_SINK_UNSANITIZED */, category: 'type', severity: 'error', message: "PII level {level} data output to {sinkKind} without sanitization", help: "Call redact() or tokenize() before output to reduce sensitivity." },
|
|
104
|
+
["E073" /* ErrorCode.PII_ARG_VIOLATION */]: { code: "E073" /* ErrorCode.PII_ARG_VIOLATION */, category: 'type', severity: 'error', message: "PII argument type mismatch: expected {expected}, got {actual}", help: "Check the function signature to ensure PII levels and categories match." },
|
|
105
|
+
["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." },
|
|
106
|
+
["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." },
|
|
107
|
+
["E102" /* ErrorCode.DUPLICATE_SYMBOL */]: { code: "E102" /* 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." },
|
|
108
|
+
["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." },
|
|
109
|
+
["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." },
|
|
110
|
+
["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." },
|
|
111
|
+
["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." },
|
|
112
|
+
["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." },
|
|
113
|
+
["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." },
|
|
114
|
+
["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." },
|
|
115
|
+
["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." },
|
|
116
|
+
["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." },
|
|
117
|
+
["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." },
|
|
118
|
+
["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." },
|
|
119
|
+
["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." },
|
|
120
|
+
["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." },
|
|
121
|
+
["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." },
|
|
122
|
+
["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." },
|
|
123
|
+
["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." },
|
|
124
|
+
["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." },
|
|
125
|
+
["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." },
|
|
126
|
+
["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." },
|
|
127
|
+
["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." },
|
|
128
|
+
["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." },
|
|
129
|
+
["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." },
|
|
130
|
+
["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." },
|
|
131
|
+
["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." },
|
|
132
|
+
["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." },
|
|
133
|
+
["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." },
|
|
134
|
+
["W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */]: { code: "W071" /* ErrorCode.PII_IMPLICIT_UPLEVEL */, category: 'type', severity: 'warning', message: "Implicit PII level escalation detected: {source} -> {target}", help: "Add explicit type annotations for level changes to aid auditing." },
|
|
135
|
+
["W074" /* ErrorCode.PII_SINK_UNKNOWN */]: { code: "W074" /* ErrorCode.PII_SINK_UNKNOWN */, category: 'type', severity: 'warning', message: "PII data may flow to {sinkKind} without annotation", help: "Add @pii annotation to track sensitive data flow." },
|
|
136
|
+
["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." },
|
|
137
|
+
["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." },
|
|
534
138
|
};
|
|
535
139
|
/**
|
|
536
140
|
* 使用命名参数填充错误消息模板。
|
|
141
|
+
* 可选传入 lexicon 以获取本地化翻译。
|
|
537
142
|
*/
|
|
538
|
-
export function formatErrorMessage(code, params) {
|
|
539
|
-
const template = ERROR_MESSAGES[code] ?? "";
|
|
143
|
+
export function formatErrorMessage(code, params, diagnosticMessages) {
|
|
144
|
+
const template = diagnosticMessages?.[code] ?? ERROR_MESSAGES[code] ?? "";
|
|
540
145
|
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
541
146
|
const value = params[key];
|
|
542
147
|
return value === undefined ? `{${key}}` : String(value);
|