@nudojs/core 1.14.0 → 1.14.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/dist/{chunk-N7AGFMSD.js → chunk-4GZPH6YL.js} +398 -2
- package/dist/{chunk-W3Z77Y2I.js → chunk-JMOQEJTD.js} +14552 -14200
- package/dist/exec.d.ts +206 -57
- package/dist/exec.js +1 -1
- package/dist/index.d.ts +141 -8
- package/dist/index.js +21 -358
- package/dist/internal.d.ts +21 -5
- package/dist/internal.js +6 -2
- package/dist/{projection-budget-DPPRBOLp.d.ts → projection-budget-07VnMktV.d.ts} +44 -2
- package/dist/{run-DhSqP3in.d.ts → run-DfloWX6i.d.ts} +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,12 +2,14 @@ import "./chunk-US532PZA.js";
|
|
|
2
2
|
import {
|
|
3
3
|
INTERFACE_SOURCE_ABBR,
|
|
4
4
|
NudoSidecarError,
|
|
5
|
+
actionsForIssue,
|
|
5
6
|
buildArgsFromAssume,
|
|
6
7
|
canSkipLiteralCallScan,
|
|
7
8
|
collectAbsFreeVars,
|
|
8
9
|
effectiveInterface,
|
|
9
10
|
evictGeneralizeMemoForPaths,
|
|
10
11
|
execNudoModule,
|
|
12
|
+
extractAllLoadSpecs,
|
|
11
13
|
extractAssumeSegs,
|
|
12
14
|
extractBalancedParens,
|
|
13
15
|
extractDeclaredThrows,
|
|
@@ -23,8 +25,11 @@ import {
|
|
|
23
25
|
findFnDirectiveScope,
|
|
24
26
|
fnDirectiveCommentLines,
|
|
25
27
|
fnTopLevelLocalNames,
|
|
28
|
+
formatCheckReport,
|
|
26
29
|
formatConstraint,
|
|
27
30
|
formatEffectiveInterfaceDisplay,
|
|
31
|
+
formatGithubAnnotations,
|
|
32
|
+
formatGitlabCodeQuality,
|
|
28
33
|
formatInterfaceTierLine,
|
|
29
34
|
generalizeAll,
|
|
30
35
|
generalizeFromAst,
|
|
@@ -57,6 +62,8 @@ import {
|
|
|
57
62
|
scanContractSegments,
|
|
58
63
|
scanLiteralCalls,
|
|
59
64
|
scanThrowsDecl,
|
|
65
|
+
serializeCheckJson,
|
|
66
|
+
serializeCheckJsonMulti,
|
|
60
67
|
setInterfaceDiagCollector,
|
|
61
68
|
setRefineDiagCollector,
|
|
62
69
|
sidecarClosureFingerprint,
|
|
@@ -67,7 +74,7 @@ import {
|
|
|
67
74
|
takeInterfaceDiagsSince,
|
|
68
75
|
takeRefineDiags,
|
|
69
76
|
takeRefineDiagsSince
|
|
70
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-4GZPH6YL.js";
|
|
71
78
|
import {
|
|
72
79
|
$add,
|
|
73
80
|
$arguments,
|
|
@@ -528,7 +535,7 @@ import {
|
|
|
528
535
|
withExecPhi,
|
|
529
536
|
withInvariantSpecs,
|
|
530
537
|
withVar
|
|
531
|
-
} from "./chunk-
|
|
538
|
+
} from "./chunk-JMOQEJTD.js";
|
|
532
539
|
|
|
533
540
|
// src/environment.ts
|
|
534
541
|
function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
|
|
@@ -761,6 +768,9 @@ function formatDiagnostics(diags) {
|
|
|
761
768
|
}).join("\n");
|
|
762
769
|
}
|
|
763
770
|
|
|
771
|
+
// src/algebra/check.ts
|
|
772
|
+
import { isBuiltin } from "module";
|
|
773
|
+
|
|
764
774
|
// src/algebra/postcondition.ts
|
|
765
775
|
function proved() {
|
|
766
776
|
return { status: "proved" };
|
|
@@ -2458,12 +2468,20 @@ function invariantSpecsOf(name, source, file, issues) {
|
|
|
2458
2468
|
if (specs.length === 0) return void 0;
|
|
2459
2469
|
return { specs, display };
|
|
2460
2470
|
}
|
|
2471
|
+
var OPAQUE_EVIDENCE_HINT = "add @nudo:case or a call site";
|
|
2472
|
+
var OPAQUE_ENV_HINT = "declare the runtime env to type native modules: '/// @nudo:env node' (or web/es) \u2014 see guides/env-harvest.md";
|
|
2473
|
+
function isBuiltinModuleSpec(spec) {
|
|
2474
|
+
if (spec.startsWith(".") || spec.startsWith("/")) return false;
|
|
2475
|
+
const base = (spec.startsWith("node:") ? spec.slice("node:".length) : spec).split("/")[0];
|
|
2476
|
+
return base.length > 0 && isBuiltin(base);
|
|
2477
|
+
}
|
|
2461
2478
|
function checkSourceInner(filePath, source, file, phi, opts, issues, signatures, names, truncated, identityOpts = opts, depsFp, sidecarFp) {
|
|
2462
2479
|
const hasRefineDirective = stripStringsKeepComments(source).includes("@nudo:contract");
|
|
2463
2480
|
const entryNames = localNamedExports(source);
|
|
2464
2481
|
const exportedNames = sidecarFp !== void 0 ? entryNames : void 0;
|
|
2465
2482
|
const entryThrowsMode = opts.entryThrows ?? "error";
|
|
2466
2483
|
const ignoreThrows = opts.ignoreThrows;
|
|
2484
|
+
const opaqueEnvHint = Object.keys(opts.inject?.envGlobals ?? {}).length === 0 && extractFileEnvNames(source).length === 0 && extractAllLoadSpecs(source).some(isBuiltinModuleSpec);
|
|
2467
2485
|
const driftCandidates = [];
|
|
2468
2486
|
const returnContracts = /* @__PURE__ */ new Map();
|
|
2469
2487
|
const returnViolated = /* @__PURE__ */ new Set();
|
|
@@ -2744,7 +2762,7 @@ function checkSourceInner(filePath, source, file, phi, opts, issues, signatures,
|
|
|
2744
2762
|
severity: "info",
|
|
2745
2763
|
code: "nudo:opaque-result",
|
|
2746
2764
|
message: `${name}(...): conf=opaque (path not covered, or native)`,
|
|
2747
|
-
suggestion:
|
|
2765
|
+
suggestion: opaqueEnvHint ? OPAQUE_ENV_HINT : OPAQUE_EVIDENCE_HINT,
|
|
2748
2766
|
fn: name
|
|
2749
2767
|
});
|
|
2750
2768
|
}
|
|
@@ -2981,361 +2999,6 @@ function checkReturnConstraint(fnName, cName, constraint, ret, assumeDisplay, in
|
|
|
2981
2999
|
`${proof.reason}; add a precondition, narrow the return expression, or relax the return contract`
|
|
2982
3000
|
);
|
|
2983
3001
|
}
|
|
2984
|
-
|
|
2985
|
-
// src/algebra/check-report.ts
|
|
2986
|
-
function actionsForIssue(i) {
|
|
2987
|
-
const draft = {
|
|
2988
|
-
kind: "draft",
|
|
2989
|
-
command: "nudo contract --draft",
|
|
2990
|
-
label: "emit a sidecar draft you can edit"
|
|
2991
|
-
};
|
|
2992
|
-
switch (i.code) {
|
|
2993
|
-
case "nudo:constraint-violated":
|
|
2994
|
-
return [
|
|
2995
|
-
{
|
|
2996
|
-
kind: "callsite",
|
|
2997
|
-
label: "use a value satisfying the constraint",
|
|
2998
|
-
...i.expected ? { hint: i.expected } : {}
|
|
2999
|
-
},
|
|
3000
|
-
{
|
|
3001
|
-
kind: "relax",
|
|
3002
|
-
label: "relax the precondition (edit *.nudo.js / @nudo:contract)",
|
|
3003
|
-
...i.expected ? { hint: i.expected } : {}
|
|
3004
|
-
},
|
|
3005
|
-
draft
|
|
3006
|
-
];
|
|
3007
|
-
case "nudo:assign-mismatch":
|
|
3008
|
-
return [
|
|
3009
|
-
{
|
|
3010
|
-
kind: "callsite",
|
|
3011
|
-
label: "align the assigned value with the existing shape",
|
|
3012
|
-
...i.expected ? { hint: i.expected } : {}
|
|
3013
|
-
},
|
|
3014
|
-
draft
|
|
3015
|
-
];
|
|
3016
|
-
case "nudo:entry-may-throw":
|
|
3017
|
-
return [
|
|
3018
|
-
{
|
|
3019
|
-
kind: "draft",
|
|
3020
|
-
command: "nudo contract --draft",
|
|
3021
|
-
label: "narrow the entry with a sidecar fn({ \u2026 }) param contract \u2014 most honest fix for helpers (also tightens the signature)",
|
|
3022
|
-
...i.fn ? { hint: i.fn } : {}
|
|
3023
|
-
},
|
|
3024
|
-
{
|
|
3025
|
-
kind: "relax",
|
|
3026
|
-
label: "declare intentional fail-fast: @nudo:throws Error (or case `!! throws`)",
|
|
3027
|
-
...i.fn ? { hint: i.fn } : {}
|
|
3028
|
-
},
|
|
3029
|
-
{
|
|
3030
|
-
kind: "info",
|
|
3031
|
-
label: "or refine / guard / try-catch the entry so it is total"
|
|
3032
|
-
},
|
|
3033
|
-
{
|
|
3034
|
-
kind: "ignore-throws",
|
|
3035
|
-
command: "nudo check --ignore-throws TypeError",
|
|
3036
|
-
label: "migration switch: ignore this throw class on L2"
|
|
3037
|
-
}
|
|
3038
|
-
];
|
|
3039
|
-
case "nudo:unproven-return":
|
|
3040
|
-
return [
|
|
3041
|
-
{
|
|
3042
|
-
kind: "relax",
|
|
3043
|
-
label: `relax the return contract${i.fn ? ` of ${i.fn}` : ""} to the inferred surface (review the diff \u2014 not a silent green)`,
|
|
3044
|
-
...i.expected ? { hint: i.expected } : {}
|
|
3045
|
-
},
|
|
3046
|
-
draft,
|
|
3047
|
-
{
|
|
3048
|
-
kind: "info",
|
|
3049
|
-
label: "or narrow the return expression / add a precondition so the bound is implied"
|
|
3050
|
-
}
|
|
3051
|
-
];
|
|
3052
|
-
case "nudo:unknown-inference":
|
|
3053
|
-
case "nudo:opaque-result":
|
|
3054
|
-
return [
|
|
3055
|
-
{ kind: "mock", label: "pin the native/unknown face with @nudo:mock" },
|
|
3056
|
-
{ kind: "assume", command: "nudo check --assume", label: "state preconditions via --assume" },
|
|
3057
|
-
{ kind: "info", label: "or add a call site / @nudo:case for evidence" }
|
|
3058
|
-
];
|
|
3059
|
-
case "nudo:arg-opaque":
|
|
3060
|
-
case "nudo:constraint-unproven":
|
|
3061
|
-
return [
|
|
3062
|
-
{ kind: "assume", command: "nudo check --assume", label: "state preconditions via --assume" },
|
|
3063
|
-
{ kind: "info", label: "add a call site or @nudo:case" }
|
|
3064
|
-
];
|
|
3065
|
-
case "nudo:fork-truncated":
|
|
3066
|
-
case "nudo:promise-micro-truncated":
|
|
3067
|
-
case "nudo:promise-micro-error":
|
|
3068
|
-
return [
|
|
3069
|
-
{
|
|
3070
|
-
kind: "info",
|
|
3071
|
-
label: "results widened to unknown \u2014 raise budget (@nudo:budget forks/calls/depth on the function) or narrow control flow"
|
|
3072
|
-
}
|
|
3073
|
-
];
|
|
3074
|
-
case "nudo:loop-truncated":
|
|
3075
|
-
return [
|
|
3076
|
-
{
|
|
3077
|
-
kind: "info",
|
|
3078
|
-
label: "loop state widened \u2014 the exit condition stayed concrete-true past the iteration cap; make the bound data-dependent (abstract) or pin the result with @nudo:case / @nudo:contract"
|
|
3079
|
-
}
|
|
3080
|
-
];
|
|
3081
|
-
case "nudo:recursion-truncated":
|
|
3082
|
-
return [
|
|
3083
|
-
{
|
|
3084
|
-
kind: "info",
|
|
3085
|
-
label: i.reason === "cycle" ? "call cycle: same abstract arguments already on the stack \u2014 raising @nudo:budget cannot lift it; make the arguments vary per recursion level or declare @nudo:contract" : i.reason === "depth" || i.reason === "calls" || i.reason === "budget" ? `results widened to unknown \u2014 raise budget (@nudo:budget ${i.reason === "depth" ? "depth" : i.reason === "calls" ? "calls" : "calls/depth"} on the function) or narrow the recursion` : "results widened to unknown \u2014 raise budget (@nudo:budget calls/depth on the function) or narrow control flow"
|
|
3086
|
-
}
|
|
3087
|
-
];
|
|
3088
|
-
case "nudo:host-effect-blocked":
|
|
3089
|
-
return [
|
|
3090
|
-
{ kind: "mock", label: "pin the host API with @nudo:mock / @nudo:env" },
|
|
3091
|
-
{ kind: "info", label: "results widened to unknown \u2014 or feed the value in from a call site" }
|
|
3092
|
-
];
|
|
3093
|
-
case "nudo:interface-drift":
|
|
3094
|
-
return [
|
|
3095
|
-
{
|
|
3096
|
-
kind: "emit",
|
|
3097
|
-
command: "nudo contract --emit",
|
|
3098
|
-
label: "refresh the @generated segment"
|
|
3099
|
-
}
|
|
3100
|
-
];
|
|
3101
|
-
case "nudo:dual-entry":
|
|
3102
|
-
return [
|
|
3103
|
-
{
|
|
3104
|
-
kind: "info",
|
|
3105
|
-
label: "browser/node records do not cross files \u2014 analyze the entry you ship; mock or skip the other variant"
|
|
3106
|
-
}
|
|
3107
|
-
];
|
|
3108
|
-
default:
|
|
3109
|
-
return i.suggestion ? [{ kind: "info", label: i.suggestion }] : [];
|
|
3110
|
-
}
|
|
3111
|
-
}
|
|
3112
|
-
function serializeCheckJson(r) {
|
|
3113
|
-
return {
|
|
3114
|
-
version: 1,
|
|
3115
|
-
file: r.file,
|
|
3116
|
-
ok: r.ok,
|
|
3117
|
-
summary: { ...r.summary },
|
|
3118
|
-
signatures: r.signatures.map((s) => ({
|
|
3119
|
-
name: s.name,
|
|
3120
|
-
params: [...s.params],
|
|
3121
|
-
...s.paramTypes ? { paramTypes: [...s.paramTypes] } : {},
|
|
3122
|
-
display: s.display,
|
|
3123
|
-
detail: s.detail,
|
|
3124
|
-
conf: s.conf,
|
|
3125
|
-
abs: formatAbs(s.abs),
|
|
3126
|
-
...s.throws ? { throws: s.throws } : {},
|
|
3127
|
-
...s.entry ? { entry: true } : {}
|
|
3128
|
-
})),
|
|
3129
|
-
issues: r.issues.map((i) => {
|
|
3130
|
-
const acts = i.actions ?? actionsForIssue(i);
|
|
3131
|
-
return {
|
|
3132
|
-
severity: i.severity,
|
|
3133
|
-
code: i.code,
|
|
3134
|
-
message: i.message,
|
|
3135
|
-
...i.fn !== void 0 ? { fn: i.fn } : {},
|
|
3136
|
-
...i.line !== void 0 ? { line: i.line } : {},
|
|
3137
|
-
...i.column !== void 0 ? { column: i.column } : {},
|
|
3138
|
-
...i.actual !== void 0 ? { actual: i.actual } : {},
|
|
3139
|
-
...i.expected !== void 0 ? { expected: i.expected } : {},
|
|
3140
|
-
...i.suggestion !== void 0 ? { suggestion: i.suggestion } : {},
|
|
3141
|
-
...i.reason !== void 0 ? { reason: i.reason } : {},
|
|
3142
|
-
...acts.length > 0 ? { actions: acts } : {}
|
|
3143
|
-
};
|
|
3144
|
-
}),
|
|
3145
|
-
...r.budget ? { budget: { ...r.budget } } : {}
|
|
3146
|
-
};
|
|
3147
|
-
}
|
|
3148
|
-
function serializeCheckJsonMulti(reports) {
|
|
3149
|
-
const summary = {
|
|
3150
|
-
errors: 0,
|
|
3151
|
-
warnings: 0,
|
|
3152
|
-
infos: 0,
|
|
3153
|
-
functions: 0,
|
|
3154
|
-
files: reports.length
|
|
3155
|
-
};
|
|
3156
|
-
let calls = 0;
|
|
3157
|
-
let forks = 0;
|
|
3158
|
-
let maxCalls = 0;
|
|
3159
|
-
let maxForks = 0;
|
|
3160
|
-
let callTruncated = false;
|
|
3161
|
-
let forkTruncated = false;
|
|
3162
|
-
let evalCalls = 0;
|
|
3163
|
-
let maxEvalCalls = 0;
|
|
3164
|
-
let evalCallTruncated = false;
|
|
3165
|
-
let cycleTruncated = false;
|
|
3166
|
-
let loopTruncated = false;
|
|
3167
|
-
const reasons = /* @__PURE__ */ new Set();
|
|
3168
|
-
for (const r of reports) {
|
|
3169
|
-
summary.errors += r.summary.errors;
|
|
3170
|
-
summary.warnings += r.summary.warnings;
|
|
3171
|
-
summary.infos += r.summary.infos;
|
|
3172
|
-
summary.functions += r.summary.functions;
|
|
3173
|
-
if (r.budget) {
|
|
3174
|
-
calls += r.budget.calls;
|
|
3175
|
-
forks += r.budget.forks;
|
|
3176
|
-
maxCalls = Math.max(maxCalls, r.budget.maxCalls);
|
|
3177
|
-
maxForks = Math.max(maxForks, r.budget.maxForks);
|
|
3178
|
-
callTruncated = callTruncated || r.budget.callTruncated;
|
|
3179
|
-
forkTruncated = forkTruncated || r.budget.forkTruncated;
|
|
3180
|
-
evalCalls += r.budget.evalCalls ?? 0;
|
|
3181
|
-
maxEvalCalls = Math.max(maxEvalCalls, r.budget.maxEvalCalls ?? 0);
|
|
3182
|
-
evalCallTruncated = evalCallTruncated || (r.budget.evalCallTruncated ?? false);
|
|
3183
|
-
cycleTruncated = cycleTruncated || (r.budget.cycleTruncated ?? false);
|
|
3184
|
-
loopTruncated = loopTruncated || (r.budget.loopTruncated ?? false);
|
|
3185
|
-
for (const x of r.budget.reasons ?? []) reasons.add(x);
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
const budgetTruncated = callTruncated || evalCallTruncated || forkTruncated || loopTruncated;
|
|
3189
|
-
return {
|
|
3190
|
-
version: 1,
|
|
3191
|
-
kind: "multi",
|
|
3192
|
-
ok: reports.every((r) => r.ok),
|
|
3193
|
-
summary: {
|
|
3194
|
-
...summary,
|
|
3195
|
-
...budgetTruncated ? { budgetTruncated: true } : {}
|
|
3196
|
-
},
|
|
3197
|
-
...budgetTruncated || reports.some((r) => r.budget) ? {
|
|
3198
|
-
budget: {
|
|
3199
|
-
truncated: budgetTruncated,
|
|
3200
|
-
callTruncated,
|
|
3201
|
-
forkTruncated,
|
|
3202
|
-
calls,
|
|
3203
|
-
maxCalls,
|
|
3204
|
-
forks,
|
|
3205
|
-
maxForks,
|
|
3206
|
-
evalCalls,
|
|
3207
|
-
maxEvalCalls,
|
|
3208
|
-
evalCallTruncated,
|
|
3209
|
-
cycleTruncated,
|
|
3210
|
-
loopTruncated,
|
|
3211
|
-
reasons: [...reasons].sort()
|
|
3212
|
-
}
|
|
3213
|
-
} : {},
|
|
3214
|
-
reports
|
|
3215
|
-
};
|
|
3216
|
-
}
|
|
3217
|
-
var CONTRACT_FIX_CODES = /* @__PURE__ */ new Set([
|
|
3218
|
-
"nudo:constraint-violated",
|
|
3219
|
-
"nudo:assign-mismatch",
|
|
3220
|
-
"nudo:arg-structure",
|
|
3221
|
-
"nudo:interface-domain-exceeds",
|
|
3222
|
-
"nudo:entry-may-throw",
|
|
3223
|
-
"nudo:missing-slot"
|
|
3224
|
-
]);
|
|
3225
|
-
function formatCheckReport(r, opts = {}) {
|
|
3226
|
-
const lines = [];
|
|
3227
|
-
lines.push(`nudo check ${r.file}`);
|
|
3228
|
-
lines.push(r.ok ? "OK" : "FAILED");
|
|
3229
|
-
lines.push(
|
|
3230
|
-
` ${r.summary.errors} error \xB7 ${r.summary.warnings} warning \xB7 ${r.summary.infos} info \xB7 ${r.summary.functions} fn`
|
|
3231
|
-
);
|
|
3232
|
-
if (r.budget?.truncated) {
|
|
3233
|
-
const onlyLoop = r.budget.loopTruncated && !r.budget.callTruncated && !r.budget.evalCallTruncated && !r.budget.forkTruncated;
|
|
3234
|
-
lines.push("");
|
|
3235
|
-
lines.push("budget");
|
|
3236
|
-
lines.push(
|
|
3237
|
-
` truncated calls ${r.budget.calls}/${r.budget.maxCalls} \xB7 eval calls ${r.budget.evalCalls}/${r.budget.maxEvalCalls} \xB7 forks ${r.budget.forks}/${r.budget.maxForks}${r.budget.callTruncated ? " (calls)" : ""}${r.budget.evalCallTruncated ? " (eval calls)" : ""}${r.budget.forkTruncated ? " (forks)" : ""}${r.budget.loopTruncated ? " (loop iters)" : ""}`
|
|
3238
|
-
);
|
|
3239
|
-
lines.push(
|
|
3240
|
-
r.budget.cycleTruncated ? ` \u2192 some results widened to unknown (not a contract failure) \u2014 includes call cycles (same abstract args; a budget cannot lift them)` : onlyLoop ? ` \u2192 loop state widened (iteration budget, not a contract failure) \u2014 @nudo:budget does not apply; make the bound data-dependent or pin with @nudo:case / @nudo:contract` : ` \u2192 some results widened to unknown (not a contract failure) \u2014 raise @nudo:budget / nudo.analysis.maxForks or simplify recursion`
|
|
3241
|
-
);
|
|
3242
|
-
}
|
|
3243
|
-
if (r.signatures.length > 0) {
|
|
3244
|
-
lines.push("");
|
|
3245
|
-
lines.push("signatures");
|
|
3246
|
-
for (const s of r.signatures) {
|
|
3247
|
-
const paramStr = s.paramTypes && s.paramTypes.length > 0 ? s.params.map((p, i) => `${p}: ${s.paramTypes[i] ?? "any"}`).join(", ") : s.params.join(", ");
|
|
3248
|
-
const throwsStr = s.throws ? ` throws ${s.throws}` : "";
|
|
3249
|
-
const displayBase = s.display.replace(/\s+throws\s+[\s\S]+$/, "").trim();
|
|
3250
|
-
const shapeK = s.abs?.shape?.k;
|
|
3251
|
-
const looksLikeFakeAny = shapeK === "any" && displayBase.length > 0 && !/^any(\b|$)/.test(displayBase);
|
|
3252
|
-
const retStr = !looksLikeFakeAny && shapeK ? formatShape(s.abs) || displayBase.replace(/\s+#\w+$/, "").trim() : displayBase.replace(/\s+#\w+$/, "").trim();
|
|
3253
|
-
lines.push(` ${s.name}(${paramStr}) => ${retStr}${throwsStr}`);
|
|
3254
|
-
if (opts.verbose) {
|
|
3255
|
-
for (const ln of s.detail.split("\n").slice(1)) {
|
|
3256
|
-
lines.push(` ${ln}`);
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
}
|
|
3261
|
-
if (r.issues.length === 0) {
|
|
3262
|
-
lines.push("");
|
|
3263
|
-
lines.push("(no issues)");
|
|
3264
|
-
} else {
|
|
3265
|
-
lines.push("");
|
|
3266
|
-
lines.push("issues");
|
|
3267
|
-
for (const i of r.issues) {
|
|
3268
|
-
const loc = i.line != null ? `L${i.line}` : "";
|
|
3269
|
-
const head = [i.severity.toUpperCase(), loc, i.fn].filter(Boolean).join(" ");
|
|
3270
|
-
lines.push(` [${head}] ${i.message} (${i.code})`);
|
|
3271
|
-
const showDetail = i.severity === "error" || opts.verbose;
|
|
3272
|
-
if (showDetail && i.actual) lines.push(` actual: ${i.actual}`);
|
|
3273
|
-
if (showDetail && i.expected) lines.push(` expected: ${i.expected}`);
|
|
3274
|
-
if (i.suggestion) {
|
|
3275
|
-
lines.push(` \u2192 ${i.suggestion}`);
|
|
3276
|
-
} else if (CONTRACT_FIX_CODES.has(i.code)) {
|
|
3277
|
-
lines.push(` \u2192 add a refine / sidecar contract, or fix the call-site value`);
|
|
3278
|
-
}
|
|
3279
|
-
if (CONTRACT_FIX_CODES.has(i.code)) {
|
|
3280
|
-
lines.push(` fix: nudo contract --draft (emit a sidecar draft you can edit)`);
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3283
|
-
}
|
|
3284
|
-
return lines.join("\n");
|
|
3285
|
-
}
|
|
3286
|
-
function escapeGhaData(s) {
|
|
3287
|
-
return s.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
3288
|
-
}
|
|
3289
|
-
function escapeGhaProp(s) {
|
|
3290
|
-
return escapeGhaData(s).replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
3291
|
-
}
|
|
3292
|
-
function formatGithubAnnotations(r, opts = {}) {
|
|
3293
|
-
const lines = [];
|
|
3294
|
-
let file = r.file;
|
|
3295
|
-
if (opts.workspaceRoot && file.startsWith(opts.workspaceRoot)) {
|
|
3296
|
-
file = file.slice(opts.workspaceRoot.length).replace(/^[/\\]/, "");
|
|
3297
|
-
}
|
|
3298
|
-
for (const i of r.issues) {
|
|
3299
|
-
const level = i.severity === "error" ? "error" : i.severity === "warning" ? "warning" : "notice";
|
|
3300
|
-
const line = i.line ?? 1;
|
|
3301
|
-
const col = (i.column ?? 0) + 1;
|
|
3302
|
-
const title = escapeGhaProp(i.code);
|
|
3303
|
-
const msgBits = [i.message];
|
|
3304
|
-
if (i.actual && i.expected) msgBits.push(`${i.actual} \u22AD ${i.expected}`);
|
|
3305
|
-
else if (i.suggestion) msgBits.push(i.suggestion);
|
|
3306
|
-
if (CONTRACT_FIX_CODES.has(i.code)) {
|
|
3307
|
-
msgBits.push(`fix: nudo contract --draft`);
|
|
3308
|
-
}
|
|
3309
|
-
const msg = escapeGhaData(msgBits.join(" \xB7 "));
|
|
3310
|
-
const props = [
|
|
3311
|
-
`file=${escapeGhaProp(file)}`,
|
|
3312
|
-
`line=${line}`,
|
|
3313
|
-
`col=${col}`,
|
|
3314
|
-
`title=${title}`
|
|
3315
|
-
].join(",");
|
|
3316
|
-
lines.push(`::${level} ${props}::${msg}`);
|
|
3317
|
-
}
|
|
3318
|
-
return lines.join("\n");
|
|
3319
|
-
}
|
|
3320
|
-
function formatGitlabCodeQuality(r, opts = {}) {
|
|
3321
|
-
let file = r.file;
|
|
3322
|
-
if (opts.workspaceRoot && file.startsWith(opts.workspaceRoot)) {
|
|
3323
|
-
file = file.slice(opts.workspaceRoot.length).replace(/^[/\\]/, "");
|
|
3324
|
-
}
|
|
3325
|
-
return r.issues.map((i) => {
|
|
3326
|
-
const begin = i.line ?? 1;
|
|
3327
|
-
const severity = i.severity === "error" ? "major" : i.severity === "warning" ? "minor" : "info";
|
|
3328
|
-
const description = i.actual && i.expected ? `${i.message} (${i.actual} \u22AD ${i.expected})` : i.message;
|
|
3329
|
-
const fingerprint = `${file}:${i.code}:${begin}:${i.message}`;
|
|
3330
|
-
return {
|
|
3331
|
-
description,
|
|
3332
|
-
check_name: i.code,
|
|
3333
|
-
fingerprint,
|
|
3334
|
-
severity,
|
|
3335
|
-
location: { path: file, lines: { begin } }
|
|
3336
|
-
};
|
|
3337
|
-
});
|
|
3338
|
-
}
|
|
3339
3002
|
export {
|
|
3340
3003
|
$add,
|
|
3341
3004
|
$arguments,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-
|
|
2
|
-
export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as
|
|
3
|
-
import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-
|
|
4
|
-
export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-
|
|
1
|
+
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-07VnMktV.js';
|
|
2
|
+
export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as budgetAttributionSegs, f as defaultLeakBudget, g as exceedsBudget, h as exportedNameOfLocal, i as extractAllLoadSpecs, j as getPromiseMicrosLength, l as leakIfNeeded, k as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, o as resolveDepPath, s as sidecarSpecsOf, q as stablePathKey, t as stablePathKeyGraph, u as termDepth, v as termNodes } from './projection-budget-07VnMktV.js';
|
|
3
|
+
import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-DfloWX6i.js';
|
|
4
|
+
export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-DfloWX6i.js';
|
|
5
5
|
import { File, Node } from '@babel/types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -89,6 +89,18 @@ type AbsBudgetStats = {
|
|
|
89
89
|
loopTruncated: boolean;
|
|
90
90
|
/** 调用截断原因集合(A+B;稳定排序,进 JSON) */
|
|
91
91
|
reasons: AbsTruncationReason[];
|
|
92
|
+
/** A 路径(enterCall 抽象调用)本轮截断原因——上屏归因用(与合并集 reasons 分流) */
|
|
93
|
+
callReasons: AbsTruncationReason[];
|
|
94
|
+
/** A 路径最大进入深度;depth 截断时 = 触发时深度(== 触发时生效上限) */
|
|
95
|
+
depth: number;
|
|
96
|
+
/** A 路径 depth 上限;depth 截断时 = 触发时生效上限(@nudo:budget 覆盖亦如实) */
|
|
97
|
+
maxDepth: number;
|
|
98
|
+
/** B 路径($callNamed 求值调用)本轮截断原因 */
|
|
99
|
+
evalReasons: AbsTruncationReason[];
|
|
100
|
+
/** B 路径最大进入深度;depth 截断时 = 触发时深度(== 触发时生效上限) */
|
|
101
|
+
evalDepth: number;
|
|
102
|
+
/** B 路径 depth 上限;depth 截断时 = 触发时生效上限(@nudo:budget 覆盖亦如实) */
|
|
103
|
+
maxEvalDepth: number;
|
|
92
104
|
};
|
|
93
105
|
declare function getAbsCallBudgetStats(): AbsBudgetStats;
|
|
94
106
|
/** 宿主入口(runTranspiled / callTranspiledExportFull / check)前重置 */
|
|
@@ -170,6 +182,10 @@ declare function resetEvalForkBudget(): void;
|
|
|
170
182
|
/** $fork 入口:超限放弃该分支(调用方返回 unknown = 最保守,安全)。 */
|
|
171
183
|
declare function bumpEvalForkBudget(): boolean;
|
|
172
184
|
|
|
185
|
+
/** 每轮模块图求值入口清空:上一轮 refresh 闭包只指向已死模块作用域,
|
|
186
|
+
* 语义无害但滞留膨胀;新图重新注册(evalAbsModuleGraph 入口调用)。 */
|
|
187
|
+
declare function clearLiveImportRefreshers(): void;
|
|
188
|
+
|
|
173
189
|
/**
|
|
174
190
|
* 可 ALS 隔离的模块级可变槽。
|
|
175
191
|
* 语义:`get`/`set` 作用于当前最内层 store(无作用域 = fallback);
|
|
@@ -774,4 +790,4 @@ declare function runWithEvalMissingSlot<T>(enabled: boolean, body: () => T): T;
|
|
|
774
790
|
*/
|
|
775
791
|
declare function noteObjSlotMissing(recv: Abs | undefined, name: string, loc?: [number, number]): boolean;
|
|
776
792
|
|
|
777
|
-
export { type AbsBudgetStats, type AbsInlay, type ArgDerivation, type ClassDef, type CollectAbsInlaysOpts, type CollectorScopeParticipant, type DerivationNode, type DiagChannel, 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, PROMISE_MICRO_ERROR_LABEL, PROMISE_MICRO_OVERFLOW_LABEL, type ScopedDiagChannel, type ScopedSlot, type StringLiteralSpan, type TemplateMeta, type TemplatePartDesc, type TemplatePartView, type TemplatePredicateDecision, abortDerivationSession, absTemplateViews, allFixedTextOfViews, anyMemberResult, awaitAbs, beginDerivationSession, bumpEvalForkBudget, callBudgetKey, canSkipLiteralCallScan, checkInjectedDomainEvidence, classChainNames, classFromMethods, coerceAsyncReturn, collectAbsInlays, concatString, createDiagChannel, createScopedDiagChannel, createScopedSlot, createTemplateAbs, decideEndsWith, decideIncludes, decideStartsWith, defineClass, definitelyUncallableMember, denoteGuard, derivationChain, endDerivationSession, enterCall, escapeTemplateTypeFixed, exitCall, fixedLengthOfViews, fnFingerprints, formatObjectKey, formatTemplateNameViews, generalizeSourceKeyPart, getAbsCallBudgetStats, getAbsOrigin, getClass, getClassChain, getDerivation, getEvalForkBudgetLimit, getEvalForkCount, getFnNameAndBodies, hasDerivationSession, hashSource, instanceOf, instantiateClass, isEvalMissingSlotEnabled, isJsBindingIdent, isJsIdent, isNullishAbs, isTemplateLike, knownPrefixOfViews, knownSuffixOfViews, listTopFunctions, lookupMethod, lookupMethodWithOwner, lookupSuperMethod, maskCommentsAndStrings, mergeAdjacentFixedViews, noteAbsTruncation, noteAnyMemberMayThrow, noteDerivationAdd, noteDerivationJoin, noteEvalForkTruncation, noteHostEffectBlocked, noteMemberDispatchMiss, noteNullishMemberThrows, noteObjSlotMissing, notePrimMemberMissing, noteUnknownMemberMissing, popCallLoc, projectBrand, projectDerivationDsl, pushCallLoc, recordMemberDiag, registerCollectorScopeParticipant, resetAbsCallBudget, resetEvalForkBudget, resetFnFpCache, resetHashSourceCache, runWithCollectorScope, runWithEvalMissingSlot, safeMemberAccess, sanitizeCommentText, scanStringLiterals, setAbsTruncationCollector, setDerivation, setDerivationCollector, setEvalForkBudgetLimit, setEvalMissingSlotEnabled, setMemberDiagCollector, sourceHasCjsExports, sourceHasModuleDependency, sourceHasRequireCall, stableAnalyzeKeySource, stableCallId, stripCommentsAndStrings, stripStringsKeepComments, superNameOf, tagAbsOrigin, tagDerivationRoot, templateMatchesValue, templatePartsOf, termKey, toJsBindingIdent, truncatedAbs, viewTemplateParts, withFnBudgetOverride, wrapPromise };
|
|
793
|
+
export { type AbsBudgetStats, type AbsInlay, type ArgDerivation, type ClassDef, type CollectAbsInlaysOpts, type CollectorScopeParticipant, type DerivationNode, type DiagChannel, 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, PROMISE_MICRO_ERROR_LABEL, PROMISE_MICRO_OVERFLOW_LABEL, type ScopedDiagChannel, type ScopedSlot, type StringLiteralSpan, type TemplateMeta, type TemplatePartDesc, type TemplatePartView, type TemplatePredicateDecision, abortDerivationSession, absTemplateViews, allFixedTextOfViews, anyMemberResult, awaitAbs, beginDerivationSession, bumpEvalForkBudget, callBudgetKey, canSkipLiteralCallScan, checkInjectedDomainEvidence, classChainNames, classFromMethods, clearLiveImportRefreshers, coerceAsyncReturn, collectAbsInlays, concatString, createDiagChannel, createScopedDiagChannel, createScopedSlot, createTemplateAbs, decideEndsWith, decideIncludes, decideStartsWith, defineClass, definitelyUncallableMember, denoteGuard, derivationChain, endDerivationSession, enterCall, escapeTemplateTypeFixed, exitCall, fixedLengthOfViews, fnFingerprints, formatObjectKey, formatTemplateNameViews, generalizeSourceKeyPart, getAbsCallBudgetStats, getAbsOrigin, getClass, getClassChain, getDerivation, getEvalForkBudgetLimit, getEvalForkCount, getFnNameAndBodies, hasDerivationSession, hashSource, instanceOf, instantiateClass, isEvalMissingSlotEnabled, isJsBindingIdent, isJsIdent, isNullishAbs, isTemplateLike, knownPrefixOfViews, knownSuffixOfViews, listTopFunctions, lookupMethod, lookupMethodWithOwner, lookupSuperMethod, maskCommentsAndStrings, mergeAdjacentFixedViews, noteAbsTruncation, noteAnyMemberMayThrow, noteDerivationAdd, noteDerivationJoin, noteEvalForkTruncation, noteHostEffectBlocked, noteMemberDispatchMiss, noteNullishMemberThrows, noteObjSlotMissing, notePrimMemberMissing, noteUnknownMemberMissing, popCallLoc, projectBrand, projectDerivationDsl, pushCallLoc, recordMemberDiag, registerCollectorScopeParticipant, resetAbsCallBudget, resetEvalForkBudget, resetFnFpCache, resetHashSourceCache, runWithCollectorScope, runWithEvalMissingSlot, safeMemberAccess, sanitizeCommentText, scanStringLiterals, setAbsTruncationCollector, setDerivation, setDerivationCollector, setEvalForkBudgetLimit, setEvalMissingSlotEnabled, setMemberDiagCollector, sourceHasCjsExports, sourceHasModuleDependency, sourceHasRequireCall, stableAnalyzeKeySource, stableCallId, stripCommentsAndStrings, stripStringsKeepComments, superNameOf, tagAbsOrigin, tagDerivationRoot, templateMatchesValue, templatePartsOf, termKey, toJsBindingIdent, truncatedAbs, viewTemplateParts, withFnBudgetOverride, wrapPromise };
|
package/dist/internal.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
budgetAttributionSegs,
|
|
2
3
|
canSkipLiteralCallScan,
|
|
3
4
|
checkInjectedDomainEvidence,
|
|
4
5
|
createDiagChannel,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
stableAnalyzeKeySource,
|
|
22
23
|
stablePathKey,
|
|
23
24
|
stablePathKeyGraph
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4GZPH6YL.js";
|
|
25
26
|
import {
|
|
26
27
|
$tryDigestSoft,
|
|
27
28
|
$tryMarkSoft,
|
|
@@ -52,6 +53,7 @@ import {
|
|
|
52
53
|
callBudgetKey,
|
|
53
54
|
classChainNames,
|
|
54
55
|
classFromMethods,
|
|
56
|
+
clearLiveImportRefreshers,
|
|
55
57
|
clearPureCallMemo,
|
|
56
58
|
clearPureMemo,
|
|
57
59
|
coerceAsyncReturn,
|
|
@@ -169,7 +171,7 @@ import {
|
|
|
169
171
|
withEvalBudgetOverride,
|
|
170
172
|
withFnBudgetOverride,
|
|
171
173
|
wrapPromise
|
|
172
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-JMOQEJTD.js";
|
|
173
175
|
|
|
174
176
|
// src/algebra/inlay.ts
|
|
175
177
|
function listFunctions(source) {
|
|
@@ -632,12 +634,14 @@ export {
|
|
|
632
634
|
anyMemberResult,
|
|
633
635
|
awaitAbs,
|
|
634
636
|
beginDerivationSession,
|
|
637
|
+
budgetAttributionSegs,
|
|
635
638
|
bumpEvalForkBudget,
|
|
636
639
|
callBudgetKey,
|
|
637
640
|
canSkipLiteralCallScan,
|
|
638
641
|
checkInjectedDomainEvidence,
|
|
639
642
|
classChainNames,
|
|
640
643
|
classFromMethods,
|
|
644
|
+
clearLiveImportRefreshers,
|
|
641
645
|
clearPureCallMemo,
|
|
642
646
|
clearPureMemo,
|
|
643
647
|
coerceAsyncReturn,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { File } from '@babel/types';
|
|
2
|
-
import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-
|
|
2
|
+
import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-DfloWX6i.js';
|
|
3
3
|
|
|
4
4
|
declare function resetParseSourceCache(): void;
|
|
5
5
|
declare function getParseSourceCacheSize(): number;
|
|
@@ -727,6 +727,18 @@ type CheckReport = {
|
|
|
727
727
|
/** 循环迭代预算截断(#loop-iterations;maxIters/硬上限,非调用预算) */
|
|
728
728
|
loopTruncated: boolean;
|
|
729
729
|
reasons: string[];
|
|
730
|
+
/** A 路径(enterCall)截断原因——归因到具体预算/路径(depth≠calls 预算) */
|
|
731
|
+
callReasons: string[];
|
|
732
|
+
/** A 路径最大进入深度;depth 截断时 = 触发时深度(== 触发时生效上限) */
|
|
733
|
+
depth: number;
|
|
734
|
+
/** A 路径 depth 上限;depth 截断时 = 触发时生效上限 */
|
|
735
|
+
maxDepth: number;
|
|
736
|
+
/** B 路径($callNamed)截断原因 */
|
|
737
|
+
evalReasons: string[];
|
|
738
|
+
/** B 路径最大进入深度;depth 截断时 = 触发时深度(== 触发时生效上限) */
|
|
739
|
+
evalDepth: number;
|
|
740
|
+
/** B 路径 depth 上限;depth 截断时 = 触发时生效上限 */
|
|
741
|
+
maxEvalDepth: number;
|
|
730
742
|
};
|
|
731
743
|
};
|
|
732
744
|
/**
|
|
@@ -800,6 +812,36 @@ type CheckJsonMulti = {
|
|
|
800
812
|
declare function serializeCheckJson(r: CheckReport): CheckJson;
|
|
801
813
|
/** 多文件信封:汇总 summary,`ok` = 全部文件 ok。 */
|
|
802
814
|
declare function serializeCheckJsonMulti(reports: CheckJson[]): CheckJsonMulti;
|
|
815
|
+
/**
|
|
816
|
+
* budget 归因段构建器——check 面(formatCheckReport)与 health 面
|
|
817
|
+
* (nudojs commands/health)单一实现(#health-budget,两处曾各自维护
|
|
818
|
+
* 同一映射而漂移出回归):只打触发截断的那条预算自己的计数段——
|
|
819
|
+
* depth 截断打 depth/limit 对、calls 截断打计数/上限(必到顶)、
|
|
820
|
+
* cycle 不是预算(无可打的计数)——杜绝「71/20000 却标 truncated」。
|
|
821
|
+
* 参数是 CheckReport.budget 内联对象与 AbsBudgetStats 的结构公共子集
|
|
822
|
+
* (reasons 按 `?? []` 防御,两个来源都必填但防御面保持一致)。
|
|
823
|
+
*/
|
|
824
|
+
declare function budgetAttributionSegs(b: {
|
|
825
|
+
calls: number;
|
|
826
|
+
maxCalls: number;
|
|
827
|
+
/** A 路径(enterCall)截断原因 */
|
|
828
|
+
callReasons?: readonly string[];
|
|
829
|
+
depth: number;
|
|
830
|
+
maxDepth: number;
|
|
831
|
+
evalCalls: number;
|
|
832
|
+
maxEvalCalls: number;
|
|
833
|
+
/** B 路径($callNamed)截断原因 */
|
|
834
|
+
evalReasons?: readonly string[];
|
|
835
|
+
evalDepth: number;
|
|
836
|
+
maxEvalDepth: number;
|
|
837
|
+
forks: number;
|
|
838
|
+
maxForks: number;
|
|
839
|
+
forkTruncated: boolean;
|
|
840
|
+
loopTruncated: boolean;
|
|
841
|
+
}): {
|
|
842
|
+
segs: string[];
|
|
843
|
+
cycleOnly: boolean;
|
|
844
|
+
};
|
|
803
845
|
/**
|
|
804
846
|
* Nudo 原生报告:Abs 签名表 + actual ⊭ expected。
|
|
805
847
|
* 不是 tsc 输出的换皮。
|
|
@@ -880,4 +922,4 @@ declare class ProjectionBudget {
|
|
|
880
922
|
exit(): void;
|
|
881
923
|
}
|
|
882
924
|
|
|
883
|
-
export {
|
|
925
|
+
export { andC as $, type CheckAction as A, type CheckJson as B, type CheckIssue as C, type CheckJsonMulti as D, type EffectiveInterfaceOpts as E, type ConstraintBuilder as F, type Diagnostic as G, type EffectiveInterface as H, type InterfaceSource as I, type GitlabCodeQualityIssue as J, INTERFACE_SOURCE_ABBR as K, type LeakBudget as L, MAX_PROMISE_MICROS as M, type NudoConstraint as N, type InterfaceDiag as O, PROJECTION_MAX_DEPTH as P, type InterfaceTierInfo as Q, type NamedImport as R, type NudoField as S, type NudoFnConstraint as T, NudoSidecarError as U, type NudoSig as V, type RefineDiag as W, type RefineEntry as X, type RefineResolveOpts as Y, SELF as Z, actionsForIssue as _, type InterfaceTierOpts as a, string as a$, any as a0, array as a1, boolean as a2, checkArg as a3, checkCall as a4, constraintAdmitsNullish as a5, constraintToEntryAbs as a6, derefConstraint as a7, drainPromiseMicros as a8, effectiveInterface as a9, isIntFlag as aA, isNodeModulesPath as aB, isNudoConstraint as aC, lazy as aD, leavePromiseExecutorScope as aE, lenTerm as aF, litC as aG, localNamedExports as aH, notePromiseExecutorFork as aI, nullable as aJ, number as aK, omit as aL, partial as aM, pick as aN, queuePromiseMicro as aO, refineDiagCount as aP, refineToIndexedFull as aQ, resetNudoModuleExecCache as aR, resetParseSourceCache as aS, resetSidecarLoadFailureCache as aT, serializeCheckJson as aU, serializeCheckJsonMulti as aV, setInterfaceDiagCollector as aW, setRefineDiagCollector as aX, shape as aY, sidecarClosureFingerprint as aZ, sidecarPathOf as a_, enterPromiseExecutorScope as aa, evalPromiseCtor as ab, evalPromiseMethod as ac, evalPromiseStatic as ad, execNudoModule as ae, extractDeclaredThrows as af, extractFnBudget as ag, extractNudoImports as ah, extractRefineReturnFromSource as ai, extractRefinesFromSource as aj, fn as ak, fnConstraintToEntryReqs as al, formatCheckReport as am, formatConstraint as an, formatDiagnostics as ao, formatEffectiveInterfaceDisplay as ap, formatGithubAnnotations as aq, formatGitlabCodeQuality as ar, formatInterfaceTierLine as as, generatedExportNames as at, getParseSourceCacheSize as au, getTerm as av, instantiateConstraint as aw, interfaceDiagCount as ax, interfaceSourceOf as ay, interfaceTierOf as az, type LoadDepsFingerprint as b, takeInterfaceDiags as b0, takeInterfaceDiagsSince as b1, takeRefineDiags as b2, takeRefineDiagsSince as b3, throwConstraintToKinds as b4, union as b5, ProjectionBudget as c, type ProjectionStopReason as d, budgetAttributionSegs as e, defaultLeakBudget as f, exceedsBudget as g, exportedNameOfLocal as h, extractAllLoadSpecs as i, getPromiseMicrosLength as j, loadModuleDepsFingerprint as k, leakIfNeeded as l, maybeLeak as m, normPath as n, resolveDepPath as o, parseSource as p, stablePathKey as q, resetLeakCounter as r, sidecarSpecsOf as s, stablePathKeyGraph as t, termDepth as u, termNodes as v, type CheckReport as w, CONSTRAINT_BUILDERS as x, CONSTRAINT_BUILDER_NAMES as y, CONSTRAINT_EXPR_RE as z };
|
|
@@ -863,11 +863,16 @@ type TranspiledCallResult = {
|
|
|
863
863
|
declare function isAbsVal(v: unknown): v is Abs;
|
|
864
864
|
/** 调用 runTranspiled 导出(捕获 $throw)。opts.phi:入口 Φ 种子
|
|
865
865
|
* (instantiate/symbolic 的约束入口——eval 侧路径条件收窄)。
|
|
866
|
+
* opts.shareArgs:evaluator 内部桥(跨模块 import / mock 文件桥,
|
|
867
|
+
* callTranspiledExportApply)传引用——被调方对容器实参的变异必须对
|
|
868
|
+
* caller 帧可见(与同文件闭包调用同语义);宿主重放(case/记录/LSP)
|
|
869
|
+
* 不传,保持 D1 防御副本。
|
|
866
870
|
* 嵌套进入(导出桥 apply)继承外层预算;仅最外层宿主入口重置。
|
|
867
871
|
* #152 assume 前提不设选项位:播种统一走 withAssumePremises 动态域
|
|
868
872
|
* 包裹(check.ts 的 runSeeded extent),单一机制无第二路径。 */
|
|
869
873
|
declare function callTranspiledExportFull(exports: Record<string, unknown>, name: string, args: Abs[], opts?: {
|
|
870
874
|
phi?: Phi;
|
|
875
|
+
shareArgs?: boolean;
|
|
871
876
|
}): TranspiledCallResult;
|
|
872
877
|
/** 调用 runTranspiled 导出(仅结果) */
|
|
873
878
|
declare function callTranspiledExport(exports: Record<string, unknown>, name: string, args: Abs[]): Abs;
|
|
@@ -877,6 +882,10 @@ declare function callTranspiledExport(exports: Record<string, unknown>, name: st
|
|
|
877
882
|
* 返回 AbsApplyResult(`{abs, throws}`),$call 统一路由 throws。
|
|
878
883
|
* 手拆 `.result` 会静默丢 throws 面(BUG-006 根因)。
|
|
879
884
|
*
|
|
885
|
+
* 桥是 evaluator 内部调用(caller 帧 → 跨模块 import):实参传引用
|
|
886
|
+
* (shareArgs),被调方 mutator 写回 caller 绑定——与同文件闭包调用同语义;
|
|
887
|
+
* 宿主重放不走此工厂,保持 D1 防御副本。
|
|
888
|
+
*
|
|
880
889
|
* `exports` 可传惰性 getter(互递归模块桥:导出表在桥创建后才赋值)。
|
|
881
890
|
*/
|
|
882
891
|
declare function callTranspiledExportApply(exports: Record<string, unknown> | (() => Record<string, unknown>), name: string): (args: Abs[], thisVal?: Abs) => AbsApplyResult;
|