@kernlang/core 3.5.9-canary.220.1.c398cd95 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capability-matrix.js +8 -6
- package/dist/capability-matrix.js.map +1 -1
- package/dist/closure-eligibility.d.ts +104 -0
- package/dist/closure-eligibility.js +443 -0
- package/dist/closure-eligibility.js.map +1 -0
- package/dist/closure-python-lowering.d.ts +26 -0
- package/dist/closure-python-lowering.js +132 -22
- package/dist/closure-python-lowering.js.map +1 -1
- package/dist/codegen/body-ts.js +13 -0
- package/dist/codegen/body-ts.js.map +1 -1
- package/dist/codegen/type-system.js +50 -3
- package/dist/codegen/type-system.js.map +1 -1
- package/dist/codegen-core.js +29 -0
- package/dist/codegen-core.js.map +1 -1
- package/dist/codegen-expression.js +7 -0
- package/dist/codegen-expression.js.map +1 -1
- package/dist/constructor-super.d.ts +34 -0
- package/dist/constructor-super.js +122 -0
- package/dist/constructor-super.js.map +1 -0
- package/dist/core-contracts/boolean.d.ts +147 -0
- package/dist/core-contracts/boolean.js +110 -0
- package/dist/core-contracts/boolean.js.map +1 -0
- package/dist/core-contracts/function.d.ts +6 -0
- package/dist/core-contracts/function.js +7 -0
- package/dist/core-contracts/function.js.map +1 -0
- package/dist/core-contracts/index.d.ts +1032 -0
- package/dist/core-contracts/index.js +30 -0
- package/dist/core-contracts/index.js.map +1 -0
- package/dist/core-contracts/list.d.ts +87 -0
- package/dist/core-contracts/list.js +54 -0
- package/dist/core-contracts/list.js.map +1 -0
- package/dist/core-contracts/nullish.d.ts +12 -0
- package/dist/core-contracts/nullish.js +13 -0
- package/dist/core-contracts/nullish.js.map +1 -0
- package/dist/core-contracts/number.d.ts +291 -0
- package/dist/core-contracts/number.js +214 -0
- package/dist/core-contracts/number.js.map +1 -0
- package/dist/core-contracts/record.d.ts +60 -0
- package/dist/core-contracts/record.js +32 -0
- package/dist/core-contracts/record.js.map +1 -0
- package/dist/core-contracts/schema.d.ts +71 -0
- package/dist/core-contracts/schema.js +98 -0
- package/dist/core-contracts/schema.js.map +1 -0
- package/dist/core-contracts/semantics.d.ts +7 -0
- package/dist/core-contracts/semantics.js +221 -0
- package/dist/core-contracts/semantics.js.map +1 -0
- package/dist/core-contracts/string.d.ts +414 -0
- package/dist/core-contracts/string.js +335 -0
- package/dist/core-contracts/string.js.map +1 -0
- package/dist/core-runtime/contract-adapter.d.ts +8 -0
- package/dist/core-runtime/contract-adapter.js +73 -0
- package/dist/core-runtime/contract-adapter.js.map +1 -0
- package/dist/core-runtime/index.d.ts +109 -0
- package/dist/core-runtime/index.js +1946 -0
- package/dist/core-runtime/index.js.map +1 -0
- package/dist/core-runtime/shape-validator.d.ts +61 -0
- package/dist/core-runtime/shape-validator.js +564 -0
- package/dist/core-runtime/shape-validator.js.map +1 -0
- package/dist/core-runtime/value-brand.d.ts +2 -0
- package/dist/core-runtime/value-brand.js +6 -0
- package/dist/core-runtime/value-brand.js.map +1 -0
- package/dist/decompiler.js +46 -0
- package/dist/decompiler.js.map +1 -1
- package/dist/eligibility-taxonomy.d.ts +58 -0
- package/dist/eligibility-taxonomy.generated.d.ts +472 -0
- package/dist/eligibility-taxonomy.generated.js +566 -0
- package/dist/eligibility-taxonomy.generated.js.map +1 -0
- package/dist/eligibility-taxonomy.js +55 -0
- package/dist/eligibility-taxonomy.js.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/instanceof-rhs.d.ts +53 -0
- package/dist/instanceof-rhs.js +74 -0
- package/dist/instanceof-rhs.js.map +1 -0
- package/dist/ir/semantics/lambda.js +9 -1
- package/dist/ir/semantics/lambda.js.map +1 -1
- package/dist/native-eligibility-ast.d.ts +5 -0
- package/dist/native-eligibility-ast.js +242 -63
- package/dist/native-eligibility-ast.js.map +1 -1
- package/dist/parser-expression.d.ts +1 -1
- package/dist/parser-expression.js +90 -1
- package/dist/parser-expression.js.map +1 -1
- package/dist/rag-assertions.d.ts +3 -0
- package/dist/rag-assertions.js +15 -0
- package/dist/rag-assertions.js.map +1 -0
- package/dist/rag-runtime.d.ts +169 -0
- package/dist/rag-runtime.js +823 -0
- package/dist/rag-runtime.js.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +197 -2
- package/dist/schema.js.map +1 -1
- package/dist/semantic-substrate.d.ts +108 -0
- package/dist/semantic-substrate.js +263 -0
- package/dist/semantic-substrate.js.map +1 -0
- package/dist/semantic-validator.d.ts +332 -0
- package/dist/semantic-validator.js +3387 -0
- package/dist/semantic-validator.js.map +1 -1
- package/dist/spec.d.ts +2 -2
- package/dist/spec.js +15 -1
- package/dist/spec.js.map +1 -1
- package/dist/value-ir.d.ts +11 -1
- package/dist/value-ir.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
/** GENERATED — do not edit by hand.
|
|
2
|
+
*
|
|
3
|
+
* Source of truth: packages/core/src/eligibility-taxonomy.json (human-edited).
|
|
4
|
+
* Regenerate with: node scripts/generate-eligibility-taxonomy-module.mjs
|
|
5
|
+
*
|
|
6
|
+
* Grammar-sovereignty phase 2 (taxonomy AUTHORITY inversion): this typed
|
|
7
|
+
* `as const` is the PRODUCTION authority source the eligibility classifier
|
|
8
|
+
* validates its emitted reason strings against — it replaced the former
|
|
9
|
+
* runtime `node:fs` JSON read. A sync test pins this const to the JSON. */
|
|
10
|
+
export declare const ELIGIBILITY_TAXONOMY: {
|
|
11
|
+
readonly $schema: "declarative eligibility taxonomy — production authority (phase 2)";
|
|
12
|
+
readonly description: "CURRENT behavior of the native-eligibility classifier, transcribed from native-eligibility-ast.ts / closure-eligibility.ts / instanceof-rhs.ts. Reason-keyed rows (verdict eligible|ineligible) are snapshot-verified against the golden corpus AND consumed in production as the authority for emitted reasons (native-eligibility-ast.ts reject(), via the generated eligibility-taxonomy.generated.ts — no fs at runtime); contextual rows (verdict contextual, when:[imperative]) describe surface constructs whose verdict depends on shape predicates a flat row cannot evaluate — the phase-2.5 (deterministic-row extraction) backlog.";
|
|
13
|
+
readonly rows: [{
|
|
14
|
+
readonly construct: "bare-block";
|
|
15
|
+
readonly verdict: "ineligible";
|
|
16
|
+
readonly reason: "bare-block";
|
|
17
|
+
readonly rationale: "A bare `{ … }` block statement has no body-stmt form.";
|
|
18
|
+
}, {
|
|
19
|
+
readonly construct: "block-bodied-arrow";
|
|
20
|
+
readonly verdict: "contextual";
|
|
21
|
+
readonly rationale: "A block-bodied arrow is eligible only when every statement is in the closure accept set (let/const/return/expr/if) with no rejected construct (this/await/loop/…); otherwise one of the closure-* reasons. Verdict depends on the whole block.";
|
|
22
|
+
readonly when: ["imperative"];
|
|
23
|
+
}, {
|
|
24
|
+
readonly construct: "break-labeled";
|
|
25
|
+
readonly verdict: "ineligible";
|
|
26
|
+
readonly reason: "break-labeled";
|
|
27
|
+
readonly rationale: "A labeled `break` has no body-stmt form.";
|
|
28
|
+
}, {
|
|
29
|
+
readonly construct: "break-outside-loop";
|
|
30
|
+
readonly verdict: "ineligible";
|
|
31
|
+
readonly reason: "break-outside-loop";
|
|
32
|
+
readonly rationale: "A `break` outside any loop context.";
|
|
33
|
+
}, {
|
|
34
|
+
readonly construct: "closure-assign-value-position";
|
|
35
|
+
readonly verdict: "ineligible";
|
|
36
|
+
readonly reason: "closure-assign-value-position";
|
|
37
|
+
readonly rationale: "A value-position assignment (e.g. const y = (x = 5)) inside a block-bodied arrow.";
|
|
38
|
+
}, {
|
|
39
|
+
readonly construct: "closure-await";
|
|
40
|
+
readonly verdict: "ineligible";
|
|
41
|
+
readonly reason: "closure-await";
|
|
42
|
+
readonly rationale: "An `await` inside a block-bodied arrow — v1 closures are synchronous.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly construct: "closure-break-continue";
|
|
45
|
+
readonly verdict: "ineligible";
|
|
46
|
+
readonly reason: "closure-break-continue";
|
|
47
|
+
readonly rationale: "A `break`/`continue` inside a block-bodied arrow.";
|
|
48
|
+
}, {
|
|
49
|
+
readonly construct: "closure-class";
|
|
50
|
+
readonly verdict: "ineligible";
|
|
51
|
+
readonly reason: "closure-class";
|
|
52
|
+
readonly rationale: "A class declaration/expression inside a block-bodied arrow.";
|
|
53
|
+
}, {
|
|
54
|
+
readonly construct: "closure-destructure";
|
|
55
|
+
readonly verdict: "ineligible";
|
|
56
|
+
readonly reason: "closure-destructure";
|
|
57
|
+
readonly rationale: "A destructuring declaration inside a block-bodied arrow.";
|
|
58
|
+
}, {
|
|
59
|
+
readonly construct: "closure-incdec-value-position";
|
|
60
|
+
readonly verdict: "ineligible";
|
|
61
|
+
readonly reason: "closure-incdec-value-position";
|
|
62
|
+
readonly rationale: "A value-position ++/-- (e.g. arr.push(x++)) inside a block-bodied arrow.";
|
|
63
|
+
}, {
|
|
64
|
+
readonly construct: "closure-labeled";
|
|
65
|
+
readonly verdict: "ineligible";
|
|
66
|
+
readonly reason: "closure-labeled";
|
|
67
|
+
readonly rationale: "A labeled statement inside a block-bodied arrow.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly construct: "closure-loop";
|
|
70
|
+
readonly verdict: "ineligible";
|
|
71
|
+
readonly reason: "closure-loop";
|
|
72
|
+
readonly rationale: "Any loop (for/for-of/for-in/while/do) inside a block-bodied arrow — v1 closures reject loops.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly construct: "closure-nested-function";
|
|
75
|
+
readonly verdict: "ineligible";
|
|
76
|
+
readonly reason: "closure-nested-function";
|
|
77
|
+
readonly rationale: "A nested arrow/function/function-declaration inside a block-bodied arrow.";
|
|
78
|
+
}, {
|
|
79
|
+
readonly construct: "closure-parse-error";
|
|
80
|
+
readonly verdict: "ineligible";
|
|
81
|
+
readonly reason: "closure-parse-error";
|
|
82
|
+
readonly rationale: "A raw closure block that does not parse as a single function body block.";
|
|
83
|
+
}, {
|
|
84
|
+
readonly construct: "closure-spread";
|
|
85
|
+
readonly verdict: "ineligible";
|
|
86
|
+
readonly reason: "closure-spread";
|
|
87
|
+
readonly rationale: "A spread element/assignment inside a block-bodied arrow.";
|
|
88
|
+
}, {
|
|
89
|
+
readonly construct: "closure-switch";
|
|
90
|
+
readonly verdict: "ineligible";
|
|
91
|
+
readonly reason: "closure-switch";
|
|
92
|
+
readonly rationale: "A `switch` inside a block-bodied arrow.";
|
|
93
|
+
}, {
|
|
94
|
+
readonly construct: "closure-this";
|
|
95
|
+
readonly verdict: "ineligible";
|
|
96
|
+
readonly reason: "closure-this";
|
|
97
|
+
readonly rationale: "A `this` usage (incl. a this-rooted assignment target) inside a block-bodied arrow.";
|
|
98
|
+
}, {
|
|
99
|
+
readonly construct: "closure-throw";
|
|
100
|
+
readonly verdict: "ineligible";
|
|
101
|
+
readonly reason: "closure-throw";
|
|
102
|
+
readonly rationale: "A `throw` inside a block-bodied arrow.";
|
|
103
|
+
}, {
|
|
104
|
+
readonly construct: "closure-try";
|
|
105
|
+
readonly verdict: "ineligible";
|
|
106
|
+
readonly reason: "closure-try";
|
|
107
|
+
readonly rationale: "A `try` inside a block-bodied arrow.";
|
|
108
|
+
}, {
|
|
109
|
+
readonly construct: "closure-uninitialized-decl";
|
|
110
|
+
readonly verdict: "ineligible";
|
|
111
|
+
readonly reason: "closure-uninitialized-decl";
|
|
112
|
+
readonly rationale: "An uninitialised `let`/`const` inside a block-bodied arrow.";
|
|
113
|
+
}, {
|
|
114
|
+
readonly construct: "closure-unsupported-assign-target";
|
|
115
|
+
readonly verdict: "ineligible";
|
|
116
|
+
readonly reason: "closure-unsupported-assign-target";
|
|
117
|
+
readonly rationale: "A destructuring/parenthesized assignment target inside a block-bodied arrow (fail-closed).";
|
|
118
|
+
}, {
|
|
119
|
+
readonly construct: "closure-unsupported-operator";
|
|
120
|
+
readonly verdict: "ineligible";
|
|
121
|
+
readonly reason: "closure-unsupported-operator";
|
|
122
|
+
readonly rationale: "An assignment operator outside {=,+=,-=,*=,/=,%=} inside a block-bodied arrow.";
|
|
123
|
+
}, {
|
|
124
|
+
readonly construct: "closure-unsupported-stmt-";
|
|
125
|
+
readonly verdict: "ineligible";
|
|
126
|
+
readonly reason: "closure-unsupported-stmt-";
|
|
127
|
+
readonly rationale: "A statement outside the closure accept set (let/const/return/expr/if) inside a block-bodied arrow.";
|
|
128
|
+
}, {
|
|
129
|
+
readonly construct: "closure-var";
|
|
130
|
+
readonly verdict: "ineligible";
|
|
131
|
+
readonly reason: "closure-var";
|
|
132
|
+
readonly rationale: "A `var` declaration inside a block-bodied arrow.";
|
|
133
|
+
}, {
|
|
134
|
+
readonly construct: "closure-with";
|
|
135
|
+
readonly verdict: "ineligible";
|
|
136
|
+
readonly reason: "closure-with";
|
|
137
|
+
readonly rationale: "A `with` statement inside a block-bodied arrow.";
|
|
138
|
+
}, {
|
|
139
|
+
readonly construct: "closure-yield";
|
|
140
|
+
readonly verdict: "ineligible";
|
|
141
|
+
readonly reason: "closure-yield";
|
|
142
|
+
readonly rationale: "A `yield` inside a block-bodied arrow.";
|
|
143
|
+
}, {
|
|
144
|
+
readonly construct: "comments-present";
|
|
145
|
+
readonly verdict: "ineligible";
|
|
146
|
+
readonly reason: "comments-present";
|
|
147
|
+
readonly rationale: "A comment that does not sit at a migratable statement boundary; the migrator would drop it, so the body is rejected.";
|
|
148
|
+
}, {
|
|
149
|
+
readonly construct: "continue-labeled";
|
|
150
|
+
readonly verdict: "ineligible";
|
|
151
|
+
readonly reason: "continue-labeled";
|
|
152
|
+
readonly rationale: "A labeled `continue` has no body-stmt form.";
|
|
153
|
+
}, {
|
|
154
|
+
readonly construct: "continue-outside-loop";
|
|
155
|
+
readonly verdict: "ineligible";
|
|
156
|
+
readonly reason: "continue-outside-loop";
|
|
157
|
+
readonly rationale: "A `continue` outside any loop context.";
|
|
158
|
+
}, {
|
|
159
|
+
readonly construct: "do-while-stmt";
|
|
160
|
+
readonly verdict: "ineligible";
|
|
161
|
+
readonly reason: "do-while-stmt";
|
|
162
|
+
readonly rationale: "A `do…while` statement has no body-stmt form.";
|
|
163
|
+
}, {
|
|
164
|
+
readonly construct: "empty";
|
|
165
|
+
readonly verdict: "eligible";
|
|
166
|
+
readonly rationale: "A whitespace-only body is trivially eligible (classifyHandlerBodyAst returns reason \"empty\").";
|
|
167
|
+
}, {
|
|
168
|
+
readonly construct: "expr-stmt-assignment";
|
|
169
|
+
readonly verdict: "ineligible";
|
|
170
|
+
readonly reason: "expr-stmt-assignment";
|
|
171
|
+
readonly rationale: "A compound assignment operator outside the supported set (e.g. logical &&=/??=).";
|
|
172
|
+
}, {
|
|
173
|
+
readonly construct: "expr-stmt-bad-assign-target";
|
|
174
|
+
readonly verdict: "ineligible";
|
|
175
|
+
readonly reason: "expr-stmt-bad-assign-target";
|
|
176
|
+
readonly rationale: "An assignment target that is not a valid KERN assignment target (e.g. optional-chained).";
|
|
177
|
+
}, {
|
|
178
|
+
readonly construct: "expr-stmt-bad-assign-value";
|
|
179
|
+
readonly verdict: "ineligible";
|
|
180
|
+
readonly reason: "expr-stmt-bad-assign-value";
|
|
181
|
+
readonly rationale: "An assignment value that is not a valid KERN assignment value.";
|
|
182
|
+
}, {
|
|
183
|
+
readonly construct: "expr-stmt-bad-expr";
|
|
184
|
+
readonly verdict: "ineligible";
|
|
185
|
+
readonly reason: "expr-stmt-bad-expr";
|
|
186
|
+
readonly rationale: "An expression statement that is not a valid KERN expression (e.g. comma expression).";
|
|
187
|
+
}, {
|
|
188
|
+
readonly construct: "expr-stmt-mutation";
|
|
189
|
+
readonly verdict: "ineligible";
|
|
190
|
+
readonly reason: "expr-stmt-mutation";
|
|
191
|
+
readonly rationale: "A prefix ++/-- whose source text the migrator cannot byte-reproduce (postfix is accepted).";
|
|
192
|
+
}, {
|
|
193
|
+
readonly construct: "expression-statement";
|
|
194
|
+
readonly verdict: "contextual";
|
|
195
|
+
readonly rationale: "An expression statement is eligible as a plain call/valid expression, a supported (compound) assignment, or a postfix ++/--; otherwise one of the expr-stmt-* reasons. Verdict depends on the expression shape.";
|
|
196
|
+
readonly when: ["imperative"];
|
|
197
|
+
}, {
|
|
198
|
+
readonly construct: "for-of-async-entry";
|
|
199
|
+
readonly verdict: "ineligible";
|
|
200
|
+
readonly reason: "for-of-async-entry";
|
|
201
|
+
readonly rationale: "A `for await` key-only/value-only entry binding — unsupported.";
|
|
202
|
+
}, {
|
|
203
|
+
readonly construct: "for-of-async-object-entries";
|
|
204
|
+
readonly verdict: "ineligible";
|
|
205
|
+
readonly reason: "for-of-async-object-entries";
|
|
206
|
+
readonly rationale: "A `for await` over Object.entries(...) — unsupported async-entry shape.";
|
|
207
|
+
}, {
|
|
208
|
+
readonly construct: "for-of-bad-expr";
|
|
209
|
+
readonly verdict: "ineligible";
|
|
210
|
+
readonly reason: "for-of-bad-expr";
|
|
211
|
+
readonly rationale: "The for-of iterable expression is not a valid KERN expression.";
|
|
212
|
+
}, {
|
|
213
|
+
readonly construct: "for-of-bad-type";
|
|
214
|
+
readonly verdict: "ineligible";
|
|
215
|
+
readonly reason: "for-of-bad-type";
|
|
216
|
+
readonly rationale: "A for-of binding type annotation that is not a valid KERN type annotation.";
|
|
217
|
+
}, {
|
|
218
|
+
readonly construct: "for-of-destructure";
|
|
219
|
+
readonly verdict: "ineligible";
|
|
220
|
+
readonly reason: "for-of-destructure";
|
|
221
|
+
readonly rationale: "A for-of object-destructuring binding (only [k]/[k,v]/[,v] array patterns lift).";
|
|
222
|
+
}, {
|
|
223
|
+
readonly construct: "for-of-destructure-type";
|
|
224
|
+
readonly verdict: "ineligible";
|
|
225
|
+
readonly reason: "for-of-destructure-type";
|
|
226
|
+
readonly rationale: "A type annotation on a for-of destructuring binding is unsupported.";
|
|
227
|
+
}, {
|
|
228
|
+
readonly construct: "for-of-empty-body";
|
|
229
|
+
readonly verdict: "ineligible";
|
|
230
|
+
readonly reason: "for-of-empty-body";
|
|
231
|
+
readonly rationale: "An empty for-of block body has nothing to emit.";
|
|
232
|
+
}, {
|
|
233
|
+
readonly construct: "for-of-init";
|
|
234
|
+
readonly verdict: "ineligible";
|
|
235
|
+
readonly reason: "for-of-init";
|
|
236
|
+
readonly rationale: "A for-of declarator carrying an initializer.";
|
|
237
|
+
}, {
|
|
238
|
+
readonly construct: "for-of-loop";
|
|
239
|
+
readonly verdict: "contextual";
|
|
240
|
+
readonly rationale: "A `for…of` is eligible only as a const, single-declarator, non-empty braced loop over a valid iterable with a supported binding shape; otherwise one of the for-of-* reasons. Verdict depends on header + body shape.";
|
|
241
|
+
readonly when: ["imperative"];
|
|
242
|
+
}, {
|
|
243
|
+
readonly construct: "for-of-multi-decl";
|
|
244
|
+
readonly verdict: "ineligible";
|
|
245
|
+
readonly reason: "for-of-multi-decl";
|
|
246
|
+
readonly rationale: "A for-of with more than one declarator.";
|
|
247
|
+
}, {
|
|
248
|
+
readonly construct: "for-of-non-block";
|
|
249
|
+
readonly verdict: "ineligible";
|
|
250
|
+
readonly reason: "for-of-non-block";
|
|
251
|
+
readonly rationale: "A non-block for-of body (`for (...) stmt;`); `each` always braces (strict mode).";
|
|
252
|
+
}, {
|
|
253
|
+
readonly construct: "for-of-non-const";
|
|
254
|
+
readonly verdict: "ineligible";
|
|
255
|
+
readonly reason: "for-of-non-const";
|
|
256
|
+
readonly rationale: "A for-of whose binding is not `const`.";
|
|
257
|
+
}, {
|
|
258
|
+
readonly construct: "for-of-non-decl";
|
|
259
|
+
readonly verdict: "ineligible";
|
|
260
|
+
readonly reason: "for-of-non-decl";
|
|
261
|
+
readonly rationale: "A for-of whose initializer is not a variable declaration list.";
|
|
262
|
+
}, {
|
|
263
|
+
readonly construct: "for-of-sync-pair";
|
|
264
|
+
readonly verdict: "ineligible";
|
|
265
|
+
readonly reason: "for-of-sync-pair";
|
|
266
|
+
readonly rationale: "A sync key-only/value-only binding not over Object.entries(...) (only entries=true emits those modes).";
|
|
267
|
+
}, {
|
|
268
|
+
readonly construct: "for-stmt";
|
|
269
|
+
readonly verdict: "ineligible";
|
|
270
|
+
readonly reason: "for-stmt";
|
|
271
|
+
readonly rationale: "A C-style `for` / `for-in` statement has no body-stmt form.";
|
|
272
|
+
}, {
|
|
273
|
+
readonly construct: "foreign-by-design";
|
|
274
|
+
readonly verdict: "ineligible";
|
|
275
|
+
readonly reason: "foreign-by-design";
|
|
276
|
+
readonly rationale: "Host-interop surface (res/process/db/req?., import(), useEffect, fetch, new Pool/AbortController) — stays a foreign boundary.";
|
|
277
|
+
}, {
|
|
278
|
+
readonly construct: "handler-body";
|
|
279
|
+
readonly verdict: "contextual";
|
|
280
|
+
readonly rationale: "The whole handler body is eligible only when it parses, is not a host-interop/template/comment boundary, and every top-level statement is eligible. The aggregate verdict is the conjunction of all per-statement verdicts.";
|
|
281
|
+
readonly when: ["imperative"];
|
|
282
|
+
}, {
|
|
283
|
+
readonly construct: "if-bad-cond";
|
|
284
|
+
readonly verdict: "ineligible";
|
|
285
|
+
readonly reason: "if-bad-cond";
|
|
286
|
+
readonly rationale: "The if-condition is not a valid KERN expression.";
|
|
287
|
+
}, {
|
|
288
|
+
readonly construct: "if-non-block-else";
|
|
289
|
+
readonly verdict: "ineligible";
|
|
290
|
+
readonly reason: "if-non-block-else";
|
|
291
|
+
readonly rationale: "A non-block, non-else-if else-branch (`else stmt;`) would lose byte-equivalence (strict mode).";
|
|
292
|
+
}, {
|
|
293
|
+
readonly construct: "if-non-block-then";
|
|
294
|
+
readonly verdict: "ineligible";
|
|
295
|
+
readonly reason: "if-non-block-then";
|
|
296
|
+
readonly rationale: "A non-block then-branch (`if (c) stmt;`) would lose byte-equivalence; the emitter always braces (strict mode).";
|
|
297
|
+
}, {
|
|
298
|
+
readonly construct: "if-statement";
|
|
299
|
+
readonly verdict: "contextual";
|
|
300
|
+
readonly rationale: "An `if` is eligible only with a valid condition AND braced (or else-if) branches whose statements are all themselves eligible; otherwise if-bad-cond / if-non-block-then / if-non-block-else. Verdict depends on branch shape.";
|
|
301
|
+
readonly when: ["imperative"];
|
|
302
|
+
}, {
|
|
303
|
+
readonly construct: "instanceof-expression";
|
|
304
|
+
readonly verdict: "contextual";
|
|
305
|
+
readonly rationale: "An `instanceof` is eligible when its RHS is an identifier outside the reject set or a qualified member name; otherwise one of the instanceof-rhs-* reasons. Verdict depends on the RHS shape.";
|
|
306
|
+
readonly when: ["imperative"];
|
|
307
|
+
}, {
|
|
308
|
+
readonly construct: "instanceof-rhs-not-a-type-name";
|
|
309
|
+
readonly verdict: "ineligible";
|
|
310
|
+
readonly reason: "instanceof-rhs-not-a-type-name";
|
|
311
|
+
readonly rationale: "An instanceof RHS that is not an identifier or qualified member name (call/literal/binary).";
|
|
312
|
+
}, {
|
|
313
|
+
readonly construct: "instanceof-rhs-unsupported-builtin";
|
|
314
|
+
readonly verdict: "ineligible";
|
|
315
|
+
readonly reason: "instanceof-rhs-unsupported-builtin";
|
|
316
|
+
readonly rationale: "A built-in RHS with no verified cross-target host mapping (Object/Date/Map/Set/…).";
|
|
317
|
+
}, {
|
|
318
|
+
readonly construct: "instanceof-rhs-wrapper-rejected";
|
|
319
|
+
readonly verdict: "ineligible";
|
|
320
|
+
readonly reason: "instanceof-rhs-wrapper-rejected";
|
|
321
|
+
readonly rationale: "A primitive-wrapper RHS (String/Number/Boolean) — the wrapper-parity trap; fail-closed.";
|
|
322
|
+
}, {
|
|
323
|
+
readonly construct: "ok";
|
|
324
|
+
readonly verdict: "eligible";
|
|
325
|
+
readonly rationale: "Every top-level statement (and nested if/try branch) maps to a body-statement form the migrator can emit.";
|
|
326
|
+
}, {
|
|
327
|
+
readonly construct: "return-bad-expr";
|
|
328
|
+
readonly verdict: "ineligible";
|
|
329
|
+
readonly reason: "return-bad-expr";
|
|
330
|
+
readonly rationale: "The returned expression is not a valid KERN expression.";
|
|
331
|
+
}, {
|
|
332
|
+
readonly construct: "return-template-escapes";
|
|
333
|
+
readonly verdict: "ineligible";
|
|
334
|
+
readonly reason: "return-template-escapes";
|
|
335
|
+
readonly rationale: "A returned template literal carrying a TS-only escape that diverges cross-target.";
|
|
336
|
+
}, {
|
|
337
|
+
readonly construct: "return-template-multiline";
|
|
338
|
+
readonly verdict: "ineligible";
|
|
339
|
+
readonly reason: "return-template-multiline";
|
|
340
|
+
readonly rationale: "A returned template literal containing a raw newline.";
|
|
341
|
+
}, {
|
|
342
|
+
readonly construct: "switch-stmt";
|
|
343
|
+
readonly verdict: "ineligible";
|
|
344
|
+
readonly reason: "switch-stmt";
|
|
345
|
+
readonly rationale: "A `switch` statement has no body-stmt form.";
|
|
346
|
+
}, {
|
|
347
|
+
readonly construct: "template-literal-initializer";
|
|
348
|
+
readonly verdict: "contextual";
|
|
349
|
+
readonly rationale: "A template-literal const/return is eligible when single-line with only cross-target-safe escapes; otherwise *-template-multiline / *-template-escapes. Verdict depends on the literal contents.";
|
|
350
|
+
readonly when: ["imperative"];
|
|
351
|
+
}, {
|
|
352
|
+
readonly construct: "template-placeholder";
|
|
353
|
+
readonly verdict: "ineligible";
|
|
354
|
+
readonly reason: "template-placeholder";
|
|
355
|
+
readonly rationale: "A {{ ident }} mustache placeholder in an unparseable body — a templating boundary, not a lift gap.";
|
|
356
|
+
}, {
|
|
357
|
+
readonly construct: "throw-bad-expr";
|
|
358
|
+
readonly verdict: "ineligible";
|
|
359
|
+
readonly reason: "throw-bad-expr";
|
|
360
|
+
readonly rationale: "The thrown expression is not a valid KERN expression.";
|
|
361
|
+
}, {
|
|
362
|
+
readonly construct: "try-destruct-catch";
|
|
363
|
+
readonly verdict: "ineligible";
|
|
364
|
+
readonly reason: "try-destruct-catch";
|
|
365
|
+
readonly rationale: "A destructuring catch binding (`catch ({ e })`) cannot map to the body-stmt catch name.";
|
|
366
|
+
}, {
|
|
367
|
+
readonly construct: "try-statement";
|
|
368
|
+
readonly verdict: "contextual";
|
|
369
|
+
readonly rationale: "A `try` is eligible with catch and/or finally, an identifier-named catch binding, and eligible branch bodies; a destructuring catch is try-destruct-catch and a catch/finally-less try is a parse error. Verdict depends on clause shape.";
|
|
370
|
+
readonly when: ["imperative"];
|
|
371
|
+
}, {
|
|
372
|
+
readonly construct: "ts-parse-error";
|
|
373
|
+
readonly verdict: "ineligible";
|
|
374
|
+
readonly reason: "ts-parse-error";
|
|
375
|
+
readonly rationale: "The body fails to parse as TypeScript and matches no foreign/template boundary — not migratable.";
|
|
376
|
+
}, {
|
|
377
|
+
readonly construct: "unsupported-stmt-";
|
|
378
|
+
readonly verdict: "ineligible";
|
|
379
|
+
readonly reason: "unsupported-stmt-";
|
|
380
|
+
readonly rationale: "Any other statement kind (import/export-default-less/enum/interface/labeled/debugger/…) surfaces its SyntaxKind name.";
|
|
381
|
+
}, {
|
|
382
|
+
readonly construct: "var-bad-expr";
|
|
383
|
+
readonly verdict: "ineligible";
|
|
384
|
+
readonly reason: "var-bad-expr";
|
|
385
|
+
readonly rationale: "The initializer expression is not a valid KERN expression.";
|
|
386
|
+
}, {
|
|
387
|
+
readonly construct: "var-bad-type";
|
|
388
|
+
readonly verdict: "ineligible";
|
|
389
|
+
readonly reason: "var-bad-type";
|
|
390
|
+
readonly rationale: "The declared type annotation is not a valid KERN type annotation (round-trip-unsafe).";
|
|
391
|
+
}, {
|
|
392
|
+
readonly construct: "var-destructure";
|
|
393
|
+
readonly verdict: "ineligible";
|
|
394
|
+
readonly reason: "var-destructure";
|
|
395
|
+
readonly rationale: "A destructuring binding whose shape the migrator cannot emit (incl. uninitialised destructure).";
|
|
396
|
+
}, {
|
|
397
|
+
readonly construct: "var-destructure-bad-expr";
|
|
398
|
+
readonly verdict: "ineligible";
|
|
399
|
+
readonly reason: "var-destructure-bad-expr";
|
|
400
|
+
readonly rationale: "A destructuring initializer that is not a valid KERN expression.";
|
|
401
|
+
}, {
|
|
402
|
+
readonly construct: "var-destructure-computed";
|
|
403
|
+
readonly verdict: "ineligible";
|
|
404
|
+
readonly reason: "var-destructure-computed";
|
|
405
|
+
readonly rationale: "A computed property name ([k]) in a destructuring pattern is unsupported.";
|
|
406
|
+
}, {
|
|
407
|
+
readonly construct: "var-destructure-default";
|
|
408
|
+
readonly verdict: "ineligible";
|
|
409
|
+
readonly reason: "var-destructure-default";
|
|
410
|
+
readonly rationale: "A default value (= 1) on a destructuring element is unsupported.";
|
|
411
|
+
}, {
|
|
412
|
+
readonly construct: "var-destructure-empty";
|
|
413
|
+
readonly verdict: "ineligible";
|
|
414
|
+
readonly reason: "var-destructure-empty";
|
|
415
|
+
readonly rationale: "An empty destructuring pattern ({} / []) binds nothing.";
|
|
416
|
+
}, {
|
|
417
|
+
readonly construct: "var-destructure-nested";
|
|
418
|
+
readonly verdict: "ineligible";
|
|
419
|
+
readonly reason: "var-destructure-nested";
|
|
420
|
+
readonly rationale: "A nested destructuring pattern is unsupported.";
|
|
421
|
+
}, {
|
|
422
|
+
readonly construct: "var-destructure-rest";
|
|
423
|
+
readonly verdict: "ineligible";
|
|
424
|
+
readonly reason: "var-destructure-rest";
|
|
425
|
+
readonly rationale: "A rest element (...rest) in a destructuring pattern is unsupported.";
|
|
426
|
+
}, {
|
|
427
|
+
readonly construct: "var-multi-decl";
|
|
428
|
+
readonly verdict: "ineligible";
|
|
429
|
+
readonly reason: "var-multi-decl";
|
|
430
|
+
readonly rationale: "A declaration list with more than one declarator cannot map to a single body-stmt.";
|
|
431
|
+
}, {
|
|
432
|
+
readonly construct: "var-non-const";
|
|
433
|
+
readonly verdict: "ineligible";
|
|
434
|
+
readonly reason: "var-non-const";
|
|
435
|
+
readonly rationale: "A `var` declaration; only `const`/`let` lift.";
|
|
436
|
+
}, {
|
|
437
|
+
readonly construct: "var-template-escapes";
|
|
438
|
+
readonly verdict: "ineligible";
|
|
439
|
+
readonly reason: "var-template-escapes";
|
|
440
|
+
readonly rationale: "A template-literal initializer carrying a TS-only escape (e.g. \\u{NNNN}) that diverges cross-target.";
|
|
441
|
+
}, {
|
|
442
|
+
readonly construct: "var-template-multiline";
|
|
443
|
+
readonly verdict: "ineligible";
|
|
444
|
+
readonly reason: "var-template-multiline";
|
|
445
|
+
readonly rationale: "A template-literal initializer containing a raw newline cannot sit in a KERN attribute value.";
|
|
446
|
+
}, {
|
|
447
|
+
readonly construct: "variable-declaration";
|
|
448
|
+
readonly verdict: "contextual";
|
|
449
|
+
readonly rationale: "A `let`/`const` is eligible only when single-declarator, identifier- or simple-pattern-named, with a valid type and a valid (or template) initializer; otherwise one of the var-* reasons. Verdict depends on declarator shape.";
|
|
450
|
+
readonly when: ["imperative"];
|
|
451
|
+
}, {
|
|
452
|
+
readonly construct: "while-bad-cond";
|
|
453
|
+
readonly verdict: "ineligible";
|
|
454
|
+
readonly reason: "while-bad-cond";
|
|
455
|
+
readonly rationale: "The while-condition is not a valid KERN expression.";
|
|
456
|
+
}, {
|
|
457
|
+
readonly construct: "while-empty-body";
|
|
458
|
+
readonly verdict: "ineligible";
|
|
459
|
+
readonly reason: "while-empty-body";
|
|
460
|
+
readonly rationale: "An empty while block body has nothing to emit.";
|
|
461
|
+
}, {
|
|
462
|
+
readonly construct: "while-loop";
|
|
463
|
+
readonly verdict: "contextual";
|
|
464
|
+
readonly rationale: "A `while` is eligible only with a valid condition and a non-empty braced body; otherwise while-bad-cond / while-non-block / while-empty-body. Verdict depends on body shape.";
|
|
465
|
+
readonly when: ["imperative"];
|
|
466
|
+
}, {
|
|
467
|
+
readonly construct: "while-non-block";
|
|
468
|
+
readonly verdict: "ineligible";
|
|
469
|
+
readonly reason: "while-non-block";
|
|
470
|
+
readonly rationale: "A non-block while body (`while (c) stmt;`); the emitter always braces (strict mode).";
|
|
471
|
+
}];
|
|
472
|
+
};
|