@nudojs/core 1.13.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.
@@ -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-DhSqP3in.js';
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 { any as $, type CheckJson as A, type CheckJsonMulti as B, type CheckIssue as C, type ConstraintBuilder as D, type EffectiveInterfaceOpts as E, type Diagnostic as F, type EffectiveInterface as G, type GitlabCodeQualityIssue as H, type InterfaceSource as I, INTERFACE_SOURCE_ABBR as J, type InterfaceDiag as K, type LeakBudget as L, MAX_PROMISE_MICROS as M, type NudoConstraint as N, type InterfaceTierInfo as O, PROJECTION_MAX_DEPTH as P, type NamedImport as Q, type NudoField as R, type NudoFnConstraint as S, NudoSidecarError as T, type NudoSig as U, type RefineDiag as V, type RefineEntry as W, type RefineResolveOpts as X, SELF as Y, actionsForIssue as Z, andC as _, type InterfaceTierOpts as a, takeInterfaceDiags as a$, array as a0, boolean as a1, checkArg as a2, checkCall as a3, constraintAdmitsNullish as a4, constraintToEntryAbs as a5, derefConstraint as a6, drainPromiseMicros as a7, effectiveInterface as a8, enterPromiseExecutorScope as a9, isNodeModulesPath as aA, isNudoConstraint as aB, lazy as aC, leavePromiseExecutorScope as aD, lenTerm as aE, litC as aF, localNamedExports as aG, notePromiseExecutorFork as aH, nullable as aI, number as aJ, omit as aK, partial as aL, pick as aM, queuePromiseMicro as aN, refineDiagCount as aO, refineToIndexedFull as aP, resetNudoModuleExecCache as aQ, resetParseSourceCache as aR, resetSidecarLoadFailureCache as aS, serializeCheckJson as aT, serializeCheckJsonMulti as aU, setInterfaceDiagCollector as aV, setRefineDiagCollector as aW, shape as aX, sidecarClosureFingerprint as aY, sidecarPathOf as aZ, string as a_, evalPromiseCtor as aa, evalPromiseMethod as ab, evalPromiseStatic as ac, execNudoModule as ad, extractDeclaredThrows as ae, extractFnBudget as af, extractNudoImports as ag, extractRefineReturnFromSource as ah, extractRefinesFromSource as ai, fn as aj, fnConstraintToEntryReqs as ak, formatCheckReport as al, formatConstraint as am, formatDiagnostics as an, formatEffectiveInterfaceDisplay as ao, formatGithubAnnotations as ap, formatGitlabCodeQuality as aq, formatInterfaceTierLine as ar, generatedExportNames as as, getParseSourceCacheSize as at, getTerm as au, instantiateConstraint as av, interfaceDiagCount as aw, interfaceSourceOf as ax, interfaceTierOf as ay, isIntFlag as az, type LoadDepsFingerprint as b, takeInterfaceDiagsSince as b0, takeRefineDiags as b1, takeRefineDiagsSince as b2, throwConstraintToKinds as b3, union as b4, ProjectionBudget as c, type ProjectionStopReason as d, defaultLeakBudget as e, exceedsBudget as f, exportedNameOfLocal as g, extractAllLoadSpecs as h, getPromiseMicrosLength as i, loadModuleDepsFingerprint as j, resolveDepPath as k, leakIfNeeded as l, maybeLeak as m, normPath as n, stablePathKey as o, parseSource as p, stablePathKeyGraph as q, resetLeakCounter as r, sidecarSpecsOf as s, termDepth as t, termNodes as u, type CheckReport as v, CONSTRAINT_BUILDERS as w, CONSTRAINT_BUILDER_NAMES as x, CONSTRAINT_EXPR_RE as y, type CheckAction as z };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nudojs/core",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },