@nudojs/core 1.1.4 → 1.2.2
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/{check-report-AtnAfY9U.d.ts → check-report-0B9Z66n0.d.ts} +1 -1
- package/dist/{chunk-SQSO4NKT.js → chunk-4V3CRVSD.js} +931 -396
- package/dist/{chunk-XOHKHJHE.js → chunk-TOURNNEA.js} +34 -34
- package/dist/exec.d.ts +2 -2
- package/dist/exec.js +33 -25
- package/dist/{hof-types-tAeoYvzY.d.ts → hof-types-DqDpAxfh.d.ts} +17 -3
- package/dist/{index-D4rnOHre.d.ts → index-BNiZvVHw.d.ts} +53 -40
- package/dist/index.d.ts +37 -20
- package/dist/index.js +61 -50
- package/dist/internal.d.ts +26 -26
- package/dist/internal.js +16 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
takeRefineDiagsSince,
|
|
68
68
|
throwConstraintToKinds,
|
|
69
69
|
union
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-TOURNNEA.js";
|
|
71
71
|
import {
|
|
72
72
|
$add,
|
|
73
73
|
$arguments,
|
|
@@ -160,6 +160,7 @@ import {
|
|
|
160
160
|
$thisSet,
|
|
161
161
|
$throw,
|
|
162
162
|
$toNumber,
|
|
163
|
+
$toNumeric,
|
|
163
164
|
$tryCurrentMark,
|
|
164
165
|
$tryDetachSoftCatch,
|
|
165
166
|
$tryDigestSoftCatch,
|
|
@@ -172,6 +173,8 @@ import {
|
|
|
172
173
|
$tryTakeSince,
|
|
173
174
|
$typeof,
|
|
174
175
|
$unknown,
|
|
176
|
+
$updateAdd,
|
|
177
|
+
$updateSub,
|
|
175
178
|
$ushr,
|
|
176
179
|
$while,
|
|
177
180
|
$whileSeq,
|
|
@@ -179,8 +182,8 @@ import {
|
|
|
179
182
|
DEFAULT_MAX_LOOP_ITERS,
|
|
180
183
|
FORK_TRUNCATION_LABEL,
|
|
181
184
|
HOST_EFFECT_LABEL_PREFIX,
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
MAX_EVAL_CALL_DEPTH,
|
|
186
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
184
187
|
NudoLoopSignal,
|
|
185
188
|
NudoReturn,
|
|
186
189
|
NudoThrow,
|
|
@@ -282,8 +285,8 @@ import {
|
|
|
282
285
|
geNum,
|
|
283
286
|
getAbsCallBudgetStats,
|
|
284
287
|
getAbsProperty,
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
getEvalCallCollector,
|
|
289
|
+
getEvalClass,
|
|
287
290
|
getFnImpl,
|
|
288
291
|
getImplicationOracle,
|
|
289
292
|
getParseSourceCacheSize,
|
|
@@ -361,9 +364,9 @@ import {
|
|
|
361
364
|
never,
|
|
362
365
|
not,
|
|
363
366
|
notAbs,
|
|
364
|
-
noteBCallRecord,
|
|
365
|
-
noteBPathFallback,
|
|
366
367
|
noteCollectionWrite,
|
|
368
|
+
noteEvalCallRecord,
|
|
369
|
+
noteEvalFallback,
|
|
367
370
|
notePromiseExecutorFork,
|
|
368
371
|
num,
|
|
369
372
|
numLit,
|
|
@@ -385,6 +388,7 @@ import {
|
|
|
385
388
|
primToTypeof,
|
|
386
389
|
projectFlatMapResult,
|
|
387
390
|
promoteParamShape,
|
|
391
|
+
propertyKeyOf,
|
|
388
392
|
protoBrandAbs,
|
|
389
393
|
protoOfRecv,
|
|
390
394
|
ptypeof,
|
|
@@ -395,12 +399,12 @@ import {
|
|
|
395
399
|
queuePromiseMicro,
|
|
396
400
|
refineAbsForRelTrue,
|
|
397
401
|
regexBrandAbsFrom,
|
|
398
|
-
|
|
402
|
+
registerEvalClass,
|
|
399
403
|
relationFingerprint,
|
|
400
404
|
relationFn,
|
|
401
405
|
requiredFnArity,
|
|
402
406
|
resetAbsCallBudget,
|
|
403
|
-
|
|
407
|
+
resetEvalCallBudget,
|
|
404
408
|
resetParseSourceCache,
|
|
405
409
|
runTranspiled,
|
|
406
410
|
runTranspiledOptionsMemoKey,
|
|
@@ -410,13 +414,13 @@ import {
|
|
|
410
414
|
setAbsTruncationCollector,
|
|
411
415
|
setAddEntry,
|
|
412
416
|
setApplyCallbackHost,
|
|
413
|
-
setBAssignCollector,
|
|
414
|
-
setBBindingSink,
|
|
415
|
-
setBCallCollector,
|
|
416
|
-
setBPathFallbackCollector,
|
|
417
417
|
setClearEntries,
|
|
418
418
|
setDeleteEntry,
|
|
419
419
|
setElementsAbs,
|
|
420
|
+
setEvalAssignCollector,
|
|
421
|
+
setEvalBindingSink,
|
|
422
|
+
setEvalCallCollector,
|
|
423
|
+
setEvalFallbackCollector,
|
|
420
424
|
setHasEntry,
|
|
421
425
|
setImplicationOracle,
|
|
422
426
|
setMayThrowCollector,
|
|
@@ -466,7 +470,7 @@ import {
|
|
|
466
470
|
v,
|
|
467
471
|
withExecPhi,
|
|
468
472
|
withVar
|
|
469
|
-
} from "./chunk-
|
|
473
|
+
} from "./chunk-4V3CRVSD.js";
|
|
470
474
|
|
|
471
475
|
// src/environment.ts
|
|
472
476
|
function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
|
|
@@ -1340,7 +1344,7 @@ function collectEntryMayThrows(source, fnName, g, file, phi, opts = {}) {
|
|
|
1340
1344
|
return runWithMayThrowSession(() => {
|
|
1341
1345
|
setMayThrowCollector((e) => effects.push(e));
|
|
1342
1346
|
try {
|
|
1343
|
-
const full =
|
|
1347
|
+
const full = evalThrowsOf(source, fnName, entryArgs, opts, phi);
|
|
1344
1348
|
if (!full) return effects;
|
|
1345
1349
|
if (full.throws && full.throws.shape.k !== "never") {
|
|
1346
1350
|
for (const tName of throwAbsToKinds(full.throws)) {
|
|
@@ -1359,8 +1363,8 @@ function collectEntryMayThrows(source, fnName, g, file, phi, opts = {}) {
|
|
|
1359
1363
|
return effects;
|
|
1360
1364
|
});
|
|
1361
1365
|
}
|
|
1362
|
-
var
|
|
1363
|
-
function
|
|
1366
|
+
var evalRunMemo = /* @__PURE__ */ new Map();
|
|
1367
|
+
function evalAnalyzeOpts(opts) {
|
|
1364
1368
|
const inject = opts.inject ?? {};
|
|
1365
1369
|
const modules = opts.modules ?? inject.modules;
|
|
1366
1370
|
return {
|
|
@@ -1383,18 +1387,18 @@ function invokeAsThrows(fn2, phi = pTrue) {
|
|
|
1383
1387
|
throw e;
|
|
1384
1388
|
}
|
|
1385
1389
|
}
|
|
1386
|
-
function
|
|
1390
|
+
function evalThrowsOf(source, fnName, args, opts = {}, phi = pTrue) {
|
|
1387
1391
|
const runKey = `${source}|${runTranspiledOptionsMemoKey(opts.inject)}|${runTranspiledOptionsMemoKey(opts.modules ? { modules: opts.modules } : void 0)}`;
|
|
1388
|
-
if (
|
|
1389
|
-
const oldest =
|
|
1390
|
-
if (oldest !== void 0)
|
|
1392
|
+
if (evalRunMemo.size >= MAX_CHECK_MEMO) {
|
|
1393
|
+
const oldest = evalRunMemo.keys().next().value;
|
|
1394
|
+
if (oldest !== void 0) evalRunMemo.delete(oldest);
|
|
1391
1395
|
}
|
|
1392
|
-
let exports =
|
|
1396
|
+
let exports = evalRunMemo.get(runKey);
|
|
1393
1397
|
if (exports === void 0) {
|
|
1394
|
-
const run = tryRunTranspiled(source,
|
|
1398
|
+
const run = tryRunTranspiled(source, evalAnalyzeOpts(opts));
|
|
1395
1399
|
if (run === void 0) return void 0;
|
|
1396
1400
|
exports = run;
|
|
1397
|
-
|
|
1401
|
+
evalRunMemo.set(runKey, exports);
|
|
1398
1402
|
}
|
|
1399
1403
|
const isAbsVal = (v2) => !!v2 && typeof v2 === "object" && "shape" in v2 && "conf" in v2;
|
|
1400
1404
|
const call = (name, callArgs) => {
|
|
@@ -1465,8 +1469,11 @@ function widenForAssign(a) {
|
|
|
1465
1469
|
a.conf
|
|
1466
1470
|
);
|
|
1467
1471
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1472
|
+
if (a.term?.op === "lit") {
|
|
1473
|
+
const lv = a.term.value;
|
|
1474
|
+
if (lv === null || lv === void 0) {
|
|
1475
|
+
return abs({ k: "unknown" }, void 0, void 0, a.conf);
|
|
1476
|
+
}
|
|
1470
1477
|
if (typeof lv === "number") {
|
|
1471
1478
|
return abs({ k: "prim", type: "number" }, void 0, void 0, a.conf);
|
|
1472
1479
|
}
|
|
@@ -2125,15 +2132,15 @@ function checkSourceInner(filePath, source, file, phi, opts, issues, signatures,
|
|
|
2125
2132
|
const varAbs = /* @__PURE__ */ new Map();
|
|
2126
2133
|
const callRecords = [];
|
|
2127
2134
|
const bCalls = [];
|
|
2128
|
-
const prevAssign =
|
|
2129
|
-
const prevCall =
|
|
2130
|
-
let
|
|
2131
|
-
const
|
|
2135
|
+
const prevAssign = setEvalAssignCollector((r) => records.push(r));
|
|
2136
|
+
const prevCall = setEvalCallCollector((r) => bCalls.push(r));
|
|
2137
|
+
let evalBindings;
|
|
2138
|
+
const evalAnalyze = evalAnalyzeOpts(opts);
|
|
2132
2139
|
try {
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2135
|
-
if (
|
|
2136
|
-
for (const [k, v2] of
|
|
2140
|
+
const evalRun = tryRunTranspiled(source, evalAnalyze);
|
|
2141
|
+
evalBindings = evalRun ? bindingsOf(evalRun) : void 0;
|
|
2142
|
+
if (evalBindings) {
|
|
2143
|
+
for (const [k, v2] of evalBindings) {
|
|
2137
2144
|
if (v2 && typeof v2 === "object" && "shape" in v2 && "conf" in v2) {
|
|
2138
2145
|
varAbs.set(k, v2);
|
|
2139
2146
|
}
|
|
@@ -2149,10 +2156,10 @@ function checkSourceInner(filePath, source, file, phi, opts, issues, signatures,
|
|
|
2149
2156
|
}
|
|
2150
2157
|
} catch {
|
|
2151
2158
|
} finally {
|
|
2152
|
-
|
|
2153
|
-
|
|
2159
|
+
setEvalAssignCollector(prevAssign);
|
|
2160
|
+
setEvalCallCollector(prevCall);
|
|
2154
2161
|
}
|
|
2155
|
-
void
|
|
2162
|
+
void evalBindings;
|
|
2156
2163
|
const callIssues = canSkipLiteralCallScan(source, file) ? [] : scanLiteralCalls(source, names, phi, {
|
|
2157
2164
|
loadModule: opts.loadModule,
|
|
2158
2165
|
// 与 generalize / 返回后置同一 fromFile 口径:ambient 侧车按真实
|
|
@@ -2192,7 +2199,7 @@ function checkSourceInner(filePath, source, file, phi, opts, issues, signatures,
|
|
|
2192
2199
|
return (fnName, args) => {
|
|
2193
2200
|
try {
|
|
2194
2201
|
if (!driftInit) {
|
|
2195
|
-
driftRun = tryRunTranspiled(source,
|
|
2202
|
+
driftRun = tryRunTranspiled(source, evalAnalyze);
|
|
2196
2203
|
driftInit = true;
|
|
2197
2204
|
}
|
|
2198
2205
|
if (!driftRun || !(fnName in driftRun)) return void 0;
|
|
@@ -2847,6 +2854,7 @@ export {
|
|
|
2847
2854
|
$thisSet,
|
|
2848
2855
|
$throw,
|
|
2849
2856
|
$toNumber,
|
|
2857
|
+
$toNumeric,
|
|
2850
2858
|
$tryCurrentMark,
|
|
2851
2859
|
$tryDetachSoftCatch,
|
|
2852
2860
|
$tryDigestSoftCatch,
|
|
@@ -2859,13 +2867,15 @@ export {
|
|
|
2859
2867
|
$tryTakeSince,
|
|
2860
2868
|
$typeof,
|
|
2861
2869
|
$unknown,
|
|
2870
|
+
$updateAdd,
|
|
2871
|
+
$updateSub,
|
|
2862
2872
|
$ushr,
|
|
2863
2873
|
$while,
|
|
2864
2874
|
$whileSeq,
|
|
2865
2875
|
$yield,
|
|
2866
2876
|
DEFAULT_MAX_LOOP_ITERS,
|
|
2867
|
-
|
|
2868
|
-
|
|
2877
|
+
MAX_EVAL_CALL_DEPTH,
|
|
2878
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
2869
2879
|
NudoLoopSignal,
|
|
2870
2880
|
NudoReturn,
|
|
2871
2881
|
NudoSidecarError,
|
|
@@ -3003,8 +3013,8 @@ export {
|
|
|
3003
3013
|
generalizeFromAst,
|
|
3004
3014
|
generatedExportNames,
|
|
3005
3015
|
getAbsProperty,
|
|
3006
|
-
|
|
3007
|
-
|
|
3016
|
+
getEvalCallCollector,
|
|
3017
|
+
getEvalClass,
|
|
3008
3018
|
getFnImpl,
|
|
3009
3019
|
getGeneralizeMemoSize,
|
|
3010
3020
|
getImplicationOracle,
|
|
@@ -3097,9 +3107,9 @@ export {
|
|
|
3097
3107
|
never,
|
|
3098
3108
|
not,
|
|
3099
3109
|
notAbs,
|
|
3100
|
-
noteBCallRecord,
|
|
3101
|
-
noteBPathFallback,
|
|
3102
3110
|
noteCollectionWrite,
|
|
3111
|
+
noteEvalCallRecord,
|
|
3112
|
+
noteEvalFallback,
|
|
3103
3113
|
notePromiseExecutorFork,
|
|
3104
3114
|
num,
|
|
3105
3115
|
numLit,
|
|
@@ -3126,6 +3136,7 @@ export {
|
|
|
3126
3136
|
primToTypeof,
|
|
3127
3137
|
projectFlatMapResult,
|
|
3128
3138
|
promoteParamShape,
|
|
3139
|
+
propertyKeyOf,
|
|
3129
3140
|
protoBrandAbs,
|
|
3130
3141
|
protoOfRecv,
|
|
3131
3142
|
ptypeof,
|
|
@@ -3139,12 +3150,12 @@ export {
|
|
|
3139
3150
|
refineDiagCount,
|
|
3140
3151
|
refineToIndexedFull,
|
|
3141
3152
|
regexBrandAbsFrom,
|
|
3142
|
-
|
|
3153
|
+
registerEvalClass,
|
|
3143
3154
|
relationFingerprint,
|
|
3144
3155
|
relationFn,
|
|
3145
3156
|
requiredFnArity,
|
|
3146
|
-
resetBCallBudget,
|
|
3147
3157
|
resetCheckSourceMemo,
|
|
3158
|
+
resetEvalCallBudget,
|
|
3148
3159
|
resetGeneralizeMemo,
|
|
3149
3160
|
resetNudoModuleExecCache,
|
|
3150
3161
|
resetParseSourceCache,
|
|
@@ -3157,13 +3168,13 @@ export {
|
|
|
3157
3168
|
serializeCheckJsonMulti,
|
|
3158
3169
|
setAddEntry,
|
|
3159
3170
|
setApplyCallbackHost,
|
|
3160
|
-
setBAssignCollector,
|
|
3161
|
-
setBBindingSink,
|
|
3162
|
-
setBCallCollector,
|
|
3163
|
-
setBPathFallbackCollector,
|
|
3164
3171
|
setClearEntries,
|
|
3165
3172
|
setDeleteEntry,
|
|
3166
3173
|
setElementsAbs,
|
|
3174
|
+
setEvalAssignCollector,
|
|
3175
|
+
setEvalBindingSink,
|
|
3176
|
+
setEvalCallCollector,
|
|
3177
|
+
setEvalFallbackCollector,
|
|
3167
3178
|
setHasEntry,
|
|
3168
3179
|
setImplicationOracle,
|
|
3169
3180
|
setInterfaceDiagCollector,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './check-report-
|
|
2
|
-
export { L as LeakBudget, b as LoadDepsFingerprint, d as defaultLeakBudget, e as exceedsBudget, c as extractAllLoadSpecs, l as leakIfNeeded, f as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, g as resolveDepPath, s as sidecarSpecsOf, t as termDepth, h as termNodes } from './check-report-
|
|
3
|
-
import { A as Abs, T as Term, c as AstEnv } from './hof-types-
|
|
4
|
-
export { $ as $tryDigestSoft, d as $tryMarkSoft, e as $tryReleaseSoft, E as ERROR_FAMILY, M as MayThrowEffect, f as errorTypeAbs, g as filterDeclaredThrows, h as filterGateThrows, i as filterIgnoredThrows, j as flushMayThrowEffects, k as formatThrowsAbs, l as getMayThrowCollector, m as isThrowsIgnored, n as mayThrowEffectsToAbs, o as orphanMayThrowEffects, p as popMayThrowFrame, q as pushMayThrowFrame, r as recordMayThrow, s as runWithMayThrowSession, t as setMayThrowCollector, u as throwAbsToKinds, v as throwsKindCovered } from './hof-types-
|
|
1
|
+
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './check-report-0B9Z66n0.js';
|
|
2
|
+
export { L as LeakBudget, b as LoadDepsFingerprint, d as defaultLeakBudget, e as exceedsBudget, c as extractAllLoadSpecs, l as leakIfNeeded, f as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, g as resolveDepPath, s as sidecarSpecsOf, t as termDepth, h as termNodes } from './check-report-0B9Z66n0.js';
|
|
3
|
+
import { A as Abs, T as Term, c as AstEnv } from './hof-types-DqDpAxfh.js';
|
|
4
|
+
export { $ as $tryDigestSoft, d as $tryMarkSoft, e as $tryReleaseSoft, E as ERROR_FAMILY, M as MayThrowEffect, f as errorTypeAbs, g as filterDeclaredThrows, h as filterGateThrows, i as filterIgnoredThrows, j as flushMayThrowEffects, k as formatThrowsAbs, l as getMayThrowCollector, m as isThrowsIgnored, n as mayThrowEffectsToAbs, o as orphanMayThrowEffects, p as popMayThrowFrame, q as pushMayThrowFrame, r as recordMayThrow, s as runWithMayThrowSession, t as setMayThrowCollector, u as throwAbsToKinds, v as throwsKindCovered } from './hof-types-DqDpAxfh.js';
|
|
5
5
|
import { File, Node } from '@babel/types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* 调用预算 +
|
|
8
|
+
* 调用预算 + 截断观测(求值引擎共享面)。
|
|
9
9
|
* 抽象求值对递归做展开而非不动点:参数类型每层变形(fac(n-1))时
|
|
10
10
|
* cycle key 不重复,必须靠深度/总调用数封顶。超限结果 conf=opaque。
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
declare const MAX_CALL_DEPTH = 64;
|
|
14
|
-
/** 与 B 命名调用(calls.ts
|
|
14
|
+
/** 与 B 命名调用(calls.ts MAX_EVAL_TOTAL_CALLS)同阀:病态展开下 200k 级不可接受 */
|
|
15
15
|
declare const MAX_TOTAL_CALLS = 20000;
|
|
16
16
|
/** A2:预算/截断快照(check --json / health 上屏) */
|
|
17
17
|
type AbsBudgetStats = {
|
|
@@ -54,11 +54,11 @@ declare function exitCall(): void;
|
|
|
54
54
|
* 独立封顶,任一超限都 fail-closed 成 unknown。
|
|
55
55
|
*
|
|
56
56
|
* 默认 5000:monorepo 语料(含 core/service 全量测试与 check 金门)下
|
|
57
|
-
* 正常函数远低于此;病态递归×循环能在秒级内兜住(对照
|
|
58
|
-
* 从 200k 收到 20k 的先例)。可经
|
|
57
|
+
* 正常函数远低于此;病态递归×循环能在秒级内兜住(对照 MAX_EVAL_TOTAL_CALLS
|
|
58
|
+
* 从 200k 收到 20k 的先例)。可经 setEvalForkBudgetLimit / env NUDO_MAX_FORKS /
|
|
59
59
|
* package.json#nudo.analysis.maxForks 调节。
|
|
60
60
|
*/
|
|
61
|
-
declare const
|
|
61
|
+
declare const MAX_EVAL_TOTAL_FORKS = 5000;
|
|
62
62
|
/**
|
|
63
63
|
* 专用标签:fork 截断不是「某个递归函数被截断」,不能复用函数名 label
|
|
64
64
|
* (否则 check 会误报 nudo:recursion-truncated)。service/check 按此标签
|
|
@@ -75,19 +75,19 @@ declare const HOST_EFFECT_LABEL_PREFIX = "#host-effect:";
|
|
|
75
75
|
/** 宿主副作用未执行观测(service/LSP 映射 nudo:host-effect-blocked;与调用截断同 collector 管道) */
|
|
76
76
|
declare function noteHostEffectBlocked(name: string): void;
|
|
77
77
|
/** fork 超限观测(service/LSP 映射 nudo:fork-truncated;与调用截断同 collector 管道) */
|
|
78
|
-
declare function
|
|
78
|
+
declare function noteEvalForkTruncation(): void;
|
|
79
79
|
/**
|
|
80
80
|
* 调整 fork 总次数上限。约定:n ≥ 1 的有限整数才生效(向下取整);
|
|
81
|
-
* 非法值(0 / 负数 / NaN / Infinity / 非数)回默认
|
|
81
|
+
* 非法值(0 / 负数 / NaN / Infinity / 非数)回默认 MAX_EVAL_TOTAL_FORKS。
|
|
82
82
|
* 返回实际生效值。core 无 IO——env/package.json 由 service 读取后 set 进来。
|
|
83
83
|
*/
|
|
84
|
-
declare function
|
|
85
|
-
declare function
|
|
86
|
-
declare function
|
|
87
|
-
/** 宿主入口前重置 fork 计数(与 resetAbsCallBudget /
|
|
88
|
-
declare function
|
|
84
|
+
declare function setEvalForkBudgetLimit(n: number): number;
|
|
85
|
+
declare function getEvalForkBudgetLimit(): number;
|
|
86
|
+
declare function getEvalForkCount(): number;
|
|
87
|
+
/** 宿主入口前重置 fork 计数(与 resetAbsCallBudget / resetEvalCallBudget 同口径) */
|
|
88
|
+
declare function resetEvalForkBudget(): void;
|
|
89
89
|
/** $fork 入口:超限放弃该分支(调用方返回 unknown = 最保守,安全)。 */
|
|
90
|
-
declare function
|
|
90
|
+
declare function bumpEvalForkBudget(): boolean;
|
|
91
91
|
|
|
92
92
|
declare function hashSource(s: string): string;
|
|
93
93
|
declare function resetHashSourceCache(): void;
|
|
@@ -97,7 +97,7 @@ declare function resetHashSourceCache(): void;
|
|
|
97
97
|
* Keeps every line that may carry @nudo directives.
|
|
98
98
|
*
|
|
99
99
|
* Fast path: already-stable sources return the same string identity (O(1)
|
|
100
|
-
* compare in
|
|
100
|
+
* compare in evaluator / analysis caches when the caller reuses the buffer).
|
|
101
101
|
*/
|
|
102
102
|
declare function stableAnalyzeKeySource(source: string): string;
|
|
103
103
|
|
|
@@ -146,7 +146,7 @@ declare function canSkipLiteralCallScan(source: string, file: File): boolean;
|
|
|
146
146
|
*
|
|
147
147
|
* 不叫 provenance:`setProvenanceTracking` 已被 evaluator 的 TypeValue origin map
|
|
148
148
|
* 占用。机制对齐 `setCallCollector` / `setAbsTruncationCollector` 先例——
|
|
149
|
-
* **不进 Abs payload**;
|
|
149
|
+
* **不进 Abs payload**;evaluator 核心 ops(`add` / `joinAbs`)上打点,
|
|
150
150
|
* 执行面天然覆盖。
|
|
151
151
|
*
|
|
152
152
|
* 设计原则:emit 打印的是推导图的投影,**禁止**事后从最终 Abs 反编译 shift 链。
|
|
@@ -458,7 +458,7 @@ type InjectedDomainEvidenceOpts = {
|
|
|
458
458
|
declare function checkInjectedDomainEvidence(fnName: string, source: string, records: InjectedDomainRecord[], opts: InjectedDomainEvidenceOpts): CheckIssue[];
|
|
459
459
|
|
|
460
460
|
/**
|
|
461
|
-
*
|
|
461
|
+
* 成员缺失诊断(求值引擎 $invoke / 成员访问共用)。
|
|
462
462
|
* 无 $call / transpile 依赖,避免与 calls 循环。
|
|
463
463
|
*
|
|
464
464
|
* any vs unknown(design-cli-semantics §2–3):
|
|
@@ -467,7 +467,7 @@ declare function checkInjectedDomainEvidence(fnName: string, source: string, rec
|
|
|
467
467
|
* - null/undefined:成员访问 hard-throw TypeError(§3.3 / design.md §4.5)
|
|
468
468
|
*/
|
|
469
469
|
|
|
470
|
-
type
|
|
470
|
+
type EvalMemberDiag = {
|
|
471
471
|
kind: "method" | "property";
|
|
472
472
|
name: string;
|
|
473
473
|
/** 接收者 prim 类型名,或 "unknown" / "object"(C0.5 闭 shape 缺槽) */
|
|
@@ -492,13 +492,13 @@ declare function getAbsOrigin(a: Abs | undefined): {
|
|
|
492
492
|
column: number;
|
|
493
493
|
} | undefined;
|
|
494
494
|
/** 返回先前 collector,便于嵌套调用 save/restore */
|
|
495
|
-
declare function setMemberDiagCollector(c: ((d:
|
|
495
|
+
declare function setMemberDiagCollector(c: ((d: EvalMemberDiag) => void) | null): ((d: EvalMemberDiag) => void) | null;
|
|
496
496
|
declare function pushCallLoc(loc: {
|
|
497
497
|
line: number;
|
|
498
498
|
column: number;
|
|
499
499
|
}): void;
|
|
500
500
|
declare function popCallLoc(): void;
|
|
501
|
-
declare function recordMemberDiag(d:
|
|
501
|
+
declare function recordMemberDiag(d: EvalMemberDiag): void;
|
|
502
502
|
/**
|
|
503
503
|
* prim 接收者上的未知成员 → 诊断。
|
|
504
504
|
* 返回 true 表示确定缺失(number 上任意方法;string 上表外方法)。
|
|
@@ -527,7 +527,7 @@ declare function noteMemberDispatchMiss(recv: Abs | undefined, name: string, kin
|
|
|
527
527
|
/** Object.prototype 上的恒有成员(`in` 判定 / 不可调用判定共用) */
|
|
528
528
|
declare const OBJECT_PROTO_NAMES: Set<string>;
|
|
529
529
|
/**
|
|
530
|
-
* 结构上确定不可调用的成员调用(
|
|
530
|
+
* 结构上确定不可调用的成员调用(evaluator $invoke):
|
|
531
531
|
* - null-proto 对象:无 Object.prototype 可回退,缺失自有槽即确定缺失
|
|
532
532
|
* - 闭 exact 对象:slots 是精确键集,非 OP 名缺失即确定缺失(OP 名经
|
|
533
533
|
* Object.prototype 存在,未建模 → 保守不抛)
|
|
@@ -536,7 +536,7 @@ declare const OBJECT_PROTO_NAMES: Set<string>;
|
|
|
536
536
|
* 的 path 产物)、OP 原型名一律不判抛——避免假抛 false positive。
|
|
537
537
|
*/
|
|
538
538
|
declare function definitelyUncallableMember(recv: Abs, name: string): boolean;
|
|
539
|
-
/** host(service analysisConfig)在
|
|
539
|
+
/** host(service analysisConfig)在 evaluator 前设置;默认 false */
|
|
540
540
|
declare function setEvalMissingSlotEnabled(enabled: boolean): void;
|
|
541
541
|
declare function isEvalMissingSlotEnabled(): boolean;
|
|
542
542
|
/** per-analysis 作用域:body 内 flag 隔离,结束后自动恢复外层值 */
|
|
@@ -547,4 +547,4 @@ declare function runWithEvalMissingSlot<T>(enabled: boolean, body: () => T): T;
|
|
|
547
547
|
*/
|
|
548
548
|
declare function noteObjSlotMissing(recv: Abs | undefined, name: string, loc?: [number, number]): boolean;
|
|
549
549
|
|
|
550
|
-
export { type AbsBudgetStats, type AbsInlay, type ArgDerivation, type
|
|
550
|
+
export { type AbsBudgetStats, type AbsInlay, type ArgDerivation, type ClassDef, type CollectAbsInlaysOpts, type DerivationNode, type EvalMemberDiag, FORK_TRUNCATION_LABEL, type FnFp, HOST_EFFECT_LABEL_PREFIX, type InjectedDomainEvidenceOpts, type InjectedDomainRecord, MAX_CALL_DEPTH, MAX_EVAL_TOTAL_FORKS, MAX_TOTAL_CALLS, type MethodDef, OBJECT_PROTO_NAMES, type TemplateMeta, type TemplatePartDesc, type TemplatePartView, type TemplatePredicateDecision, abortDerivationSession, absTemplateViews, allFixedTextOfViews, anyMemberResult, awaitAbs, beginDerivationSession, bumpEvalForkBudget, callBudgetKey, canSkipLiteralCallScan, checkInjectedDomainEvidence, classChainNames, classFromMethods, coerceAsyncReturn, collectAbsInlays, concatString, createTemplateAbs, decideEndsWith, decideIncludes, decideStartsWith, defineClass, definitelyUncallableMember, denoteGuard, derivationChain, endDerivationSession, enterCall, exitCall, fixedLengthOfViews, fnFingerprints, formatTemplateNameViews, generalizeSourceKeyPart, getAbsCallBudgetStats, getAbsOrigin, getClass, getClassChain, getDerivation, getEvalForkBudgetLimit, getEvalForkCount, getFnNameAndBodies, hasDerivationSession, hashSource, instanceOf, instantiateClass, isEvalMissingSlotEnabled, isNullishAbs, isTemplateLike, knownPrefixOfViews, knownSuffixOfViews, listTopFunctions, lookupMethod, lookupMethodWithOwner, lookupSuperMethod, mergeAdjacentFixedViews, noteAbsTruncation, noteAnyMemberMayThrow, noteDerivationAdd, noteDerivationJoin, noteEvalForkTruncation, noteHostEffectBlocked, noteMemberDispatchMiss, noteNullishMemberThrows, noteObjSlotMissing, notePrimMemberMissing, noteUnknownMemberMissing, popCallLoc, projectBrand, projectDerivationDsl, pushCallLoc, recordMemberDiag, resetAbsCallBudget, resetEvalForkBudget, resetFnFpCache, resetHashSourceCache, runWithEvalMissingSlot, setAbsTruncationCollector, setDerivation, setDerivationCollector, setEvalForkBudgetLimit, setEvalMissingSlotEnabled, setMemberDiagCollector, stableAnalyzeKeySource, stableCallId, superNameOf, tagAbsOrigin, tagDerivationRoot, templateMatchesValue, templatePartsOf, termKey, truncatedAbs, viewTemplateParts, wrapPromise };
|
package/dist/internal.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveDepPath,
|
|
17
17
|
sidecarSpecsOf,
|
|
18
18
|
stableAnalyzeKeySource
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TOURNNEA.js";
|
|
20
20
|
import {
|
|
21
21
|
$tryDigestSoft,
|
|
22
22
|
$tryMarkSoft,
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
ERROR_FAMILY,
|
|
25
25
|
FORK_TRUNCATION_LABEL,
|
|
26
26
|
HOST_EFFECT_LABEL_PREFIX,
|
|
27
|
-
MAX_B_TOTAL_FORKS,
|
|
28
27
|
MAX_CALL_DEPTH,
|
|
28
|
+
MAX_EVAL_TOTAL_FORKS,
|
|
29
29
|
MAX_TOTAL_CALLS,
|
|
30
30
|
OBJECT_PROTO_NAMES,
|
|
31
31
|
abortDerivationSession,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
anyMemberResult,
|
|
35
35
|
awaitAbs,
|
|
36
36
|
beginDerivationSession,
|
|
37
|
-
|
|
37
|
+
bumpEvalForkBudget,
|
|
38
38
|
callBudgetKey,
|
|
39
39
|
classChainNames,
|
|
40
40
|
classFromMethods,
|
|
@@ -63,11 +63,11 @@ import {
|
|
|
63
63
|
formatThrowsAbs,
|
|
64
64
|
getAbsCallBudgetStats,
|
|
65
65
|
getAbsOrigin,
|
|
66
|
-
getBForkBudgetLimit,
|
|
67
|
-
getBForkCount,
|
|
68
66
|
getClass,
|
|
69
67
|
getClassChain,
|
|
70
68
|
getDerivation,
|
|
69
|
+
getEvalForkBudgetLimit,
|
|
70
|
+
getEvalForkCount,
|
|
71
71
|
getMayThrowCollector,
|
|
72
72
|
hasDerivationSession,
|
|
73
73
|
instanceOf,
|
|
@@ -88,9 +88,9 @@ import {
|
|
|
88
88
|
mergeAdjacentFixedViews,
|
|
89
89
|
noteAbsTruncation,
|
|
90
90
|
noteAnyMemberMayThrow,
|
|
91
|
-
noteBForkTruncation,
|
|
92
91
|
noteDerivationAdd,
|
|
93
92
|
noteDerivationJoin,
|
|
93
|
+
noteEvalForkTruncation,
|
|
94
94
|
noteHostEffectBlocked,
|
|
95
95
|
noteMemberDispatchMiss,
|
|
96
96
|
noteNullishMemberThrows,
|
|
@@ -109,14 +109,14 @@ import {
|
|
|
109
109
|
recordMayThrow,
|
|
110
110
|
recordMemberDiag,
|
|
111
111
|
resetAbsCallBudget,
|
|
112
|
-
|
|
112
|
+
resetEvalForkBudget,
|
|
113
113
|
resetLeakCounter,
|
|
114
114
|
runWithEvalMissingSlot,
|
|
115
115
|
runWithMayThrowSession,
|
|
116
116
|
setAbsTruncationCollector,
|
|
117
|
-
setBForkBudgetLimit,
|
|
118
117
|
setDerivation,
|
|
119
118
|
setDerivationCollector,
|
|
119
|
+
setEvalForkBudgetLimit,
|
|
120
120
|
setEvalMissingSlotEnabled,
|
|
121
121
|
setMayThrowCollector,
|
|
122
122
|
setMemberDiagCollector,
|
|
@@ -135,7 +135,7 @@ import {
|
|
|
135
135
|
truncatedAbs,
|
|
136
136
|
viewTemplateParts,
|
|
137
137
|
wrapPromise
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-4V3CRVSD.js";
|
|
139
139
|
|
|
140
140
|
// src/algebra/inlay.ts
|
|
141
141
|
function listFunctions(source) {
|
|
@@ -461,8 +461,8 @@ export {
|
|
|
461
461
|
ERROR_FAMILY,
|
|
462
462
|
FORK_TRUNCATION_LABEL,
|
|
463
463
|
HOST_EFFECT_LABEL_PREFIX,
|
|
464
|
-
MAX_B_TOTAL_FORKS,
|
|
465
464
|
MAX_CALL_DEPTH,
|
|
465
|
+
MAX_EVAL_TOTAL_FORKS,
|
|
466
466
|
MAX_TOTAL_CALLS,
|
|
467
467
|
OBJECT_PROTO_NAMES,
|
|
468
468
|
abortDerivationSession,
|
|
@@ -471,7 +471,7 @@ export {
|
|
|
471
471
|
anyMemberResult,
|
|
472
472
|
awaitAbs,
|
|
473
473
|
beginDerivationSession,
|
|
474
|
-
|
|
474
|
+
bumpEvalForkBudget,
|
|
475
475
|
callBudgetKey,
|
|
476
476
|
canSkipLiteralCallScan,
|
|
477
477
|
checkInjectedDomainEvidence,
|
|
@@ -506,11 +506,11 @@ export {
|
|
|
506
506
|
generalizeSourceKeyPart,
|
|
507
507
|
getAbsCallBudgetStats,
|
|
508
508
|
getAbsOrigin,
|
|
509
|
-
getBForkBudgetLimit,
|
|
510
|
-
getBForkCount,
|
|
511
509
|
getClass,
|
|
512
510
|
getClassChain,
|
|
513
511
|
getDerivation,
|
|
512
|
+
getEvalForkBudgetLimit,
|
|
513
|
+
getEvalForkCount,
|
|
514
514
|
getFnNameAndBodies,
|
|
515
515
|
getMayThrowCollector,
|
|
516
516
|
hasDerivationSession,
|
|
@@ -535,9 +535,9 @@ export {
|
|
|
535
535
|
normPath,
|
|
536
536
|
noteAbsTruncation,
|
|
537
537
|
noteAnyMemberMayThrow,
|
|
538
|
-
noteBForkTruncation,
|
|
539
538
|
noteDerivationAdd,
|
|
540
539
|
noteDerivationJoin,
|
|
540
|
+
noteEvalForkTruncation,
|
|
541
541
|
noteHostEffectBlocked,
|
|
542
542
|
noteMemberDispatchMiss,
|
|
543
543
|
noteNullishMemberThrows,
|
|
@@ -554,7 +554,7 @@ export {
|
|
|
554
554
|
recordMayThrow,
|
|
555
555
|
recordMemberDiag,
|
|
556
556
|
resetAbsCallBudget,
|
|
557
|
-
|
|
557
|
+
resetEvalForkBudget,
|
|
558
558
|
resetFnFpCache,
|
|
559
559
|
resetHashSourceCache,
|
|
560
560
|
resetLeakCounter,
|
|
@@ -562,9 +562,9 @@ export {
|
|
|
562
562
|
runWithEvalMissingSlot,
|
|
563
563
|
runWithMayThrowSession,
|
|
564
564
|
setAbsTruncationCollector,
|
|
565
|
-
setBForkBudgetLimit,
|
|
566
565
|
setDerivation,
|
|
567
566
|
setDerivationCollector,
|
|
567
|
+
setEvalForkBudgetLimit,
|
|
568
568
|
setEvalMissingSlotEnabled,
|
|
569
569
|
setMayThrowCollector,
|
|
570
570
|
setMemberDiagCollector,
|