AbsGraphOptions | type | — | AbsGraphOptions = { loadModule?: AbsLoadModule; seedVars?: Record<string, Abs>; seedFns?: Record<string, { params: string[]; body: Node; ... |
AbsMockSeeds | type | — | AbsMockSeeds = { seedVars: Record<string, Abs>; seedFns: Record<string, { params: string[]; body: Node; async?: boolean; fingerprint?: st... |
AbsModuleCacheEntry | type | 会话级依赖模块缓存条目:自身 stat 指纹 + 子树内容指纹 + 导出 + 子树装载 issue。 | AbsModuleCacheEntry = { mtimeMs: number; size: number; contentHash: string; depFingerprints: AbsModuleDepFingerprint[]; exports: AbsModul... |
AbsModuleDepFingerprint | type | 单条本地依赖的内容指纹:解析后稳定路径 + 求值时源码的 hashSource (与 loadModuleDepsFingerprint 同一 hash 口径,DESIGN-002 不另起第二套)。 | AbsModuleDepFingerprint = { path: string; hash: string; via?: { spec: string; fromFile: string }; } |
AbsModuleGraphResult | type | — | AbsModuleGraphResult = { modules: Record<string, AbsModuleExports>; byPath: Map<string, AbsModuleExports>; issues: AbsModuleLoadIssue[]; } |
AbsModuleLoadIssue | type | 模块装载问题分类(求值引擎是唯一上报源;analyzer 映射诊断用) | AbsModuleLoadIssue = { kind: | "cycle" | "depth" | "missing" | "missing-export" | "exports-unresolved" | "unreadable" | "json-invalid"; l... |
absToSchemaNode | fn | Abs → SchemaNode + dropped(优先 core absToConstraint;失败则 shape 尽力) | absToSchemaNode( a: Abs, opts?: { scope?: SchemaProjectionScope }, ) |
absToSchemaSource | fn | — | absToSchemaSource( a: Abs, opts?: { dialect?: SchemaDialect; scope?: SchemaProjectionScope }, ): string |
absToStandardSchemaFunction | fn | Abs → Standard Schema v1 函数级模块源码(入参面 + 返回面)。 | absToStandardSchemaFunction( spec: StandardSchemaFunctionSpec, opts?: { banner?: string; scope?: SchemaProjectionScope }, ): StandardSchemaModuleProjection |
absToTSType | fn | Abs → TS 类型串。有损:pred / 非 lit term 落到 shape 基类型。 | absToTSType(a: Abs, typeVars?: Map<string, string>): string |
absToZodSchemaModule | fn | Abs 导出表 → 可 import 的 zod JS 模块源码。 | absToZodSchemaModule( exports: Record<string, Abs>, opts?: { banner?: string; scope?: SchemaProjectionScope }, ): ZodModuleProjection |
AlsoSynthesizeCases | type | --both-paths(nudo test):对带 @nudo:case 的函数同轮也走合成路径 (call@/entry@),directive case 与合成 case 同轮同报(教学对比面)。 | AlsoSynthesizeCases = boolean | readonly string[] |
ambientSourcesOfSidecar | fn | lib.nudo.{js,mjs,ts} → candidate ambient sources next to it | ambientSourcesOfSidecar(sidecarPath: string): string[] |
ANALYSIS_ABI | const | 带包版本:升级 @nudojs/* 后旧 CheckJson 不得继续命中。 | const ANALYSIS_ABI |
analysisConfig | fn | 归一化 nudo.analysis。默认 mode=exports(A1:无指令但有 export/侧车的文件 进 IDE 分析;all / directives 需显式配置)。 | analysisConfig(config: NudoConfig | null | undefined): AnalysisConfig |
AnalysisConfig | type | — | AnalysisConfig = { include: string[]; exclude: string[]; mode: AnalysisMode; diagnostics: DiagnosticsLevel; callSiteBudget: number; evalM... |
analysisFileCacheKey | fn | — | analysisFileCacheKey( filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], analysisCfg?: { mode: string; evalMissingSlot: string; callSiteBudget: number; diagnostics: string; maxForks?: number; }, loadModule?: AnalyzeLoadModule, projectEnvNames?: string[], autoBind?: boolean, caseMode: DirectiveCaseMode = "all", alsoSynthesizeCases?: AlsoSynthesizeCases, ) |
AnalysisMode | type | — | AnalysisMode = "directives" | "exports" | "all" |
AnalysisResult | type | — | AnalysisResult = { functions: FunctionAnalysis[]; diagnostics: Diagnostic[]; bindings: Map<string, BindingInfo>; nodeAbsMap: Map<Node, Ab... |
AnalysisSession | type | — | AnalysisSession = { evictForDependents(files: string[]): void; clear(): void; reset(): void; analyze( filePath: string, source: string, a... |
analyzeExportsFromSource | fn | 分析单文件导出 + 内涵签名(source 由 host 提供) | analyzeExportsFromSource( filePath: string, source: string, ): ModuleExports |
analyzeFile | fn | 整文件分析。同 (path, source, cases, external) 命中 memo → O(1)。 | analyzeFile( filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule, caseMode: DirectiveCaseMode = "all", alsoSynthesizeCases?: AlsoSynthesizeCases, ): AnalysisResult |
analyzeFileAsync | fn | Async entry to analyzeFile: preloads path-based env files (/// @nudo:env ./nudo-harvest-node.ts) via dynamic import — impossible synchronously in ESM — then runs the sync analysis, which picks the preloaded factories up from the env-loader cache. | analyzeFileAsync( filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule, caseMode: DirectiveCaseMode = "all", alsoSynthesizeCases?: AlsoSynthesizeCases, ): Promise<AnalysisResult> |
analyzeFileAsyncWithEvalFailures | fn | {@link analyzeFileAsync} 的观测面版本(1145):env 预载 + 同步分析 + 按文件的引擎内部回落观测。 | analyzeFileAsyncWithEvalFailures( filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule, caseMode: DirectiveCaseMode = "all", alsoSynthesizeCases?: AlsoSynthesizeCases, ): Promise<{ analysis: AnalysisResult; evalFailures: FileEvalFailure[] }> |
analyzeFileWithEvalFailures | fn | 分析一个文件 + 观测该文件的引擎内部回落(1145 观测面)。 | analyzeFileWithEvalFailures( filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule, caseMode: DirectiveCaseMode = "all", alsoSynthesizeCases?: AlsoSynthesizeCases, ) |
applyBForkBudgetFromConfig | fn | 把 fork 预算写进 core(core 保持无 IO)。 | applyBForkBudgetFromConfig( config: NudoConfig | null | undefined, env: NodeJS.ProcessEnv = process.env, ): number |
applyMockModuleDirectives | fn | Overlay @nudo:mock-module directives onto a modules map. | applyMockModuleDirectives( base: Record<string, AbsModuleExports>, fileDirectives: FileDirective[], opts: { fromFile: string; loadModule?: LoadModule }, ): MockModuleApplyResult |
applyMockModuleDirectivesFromSource | fn | Source string → apply mock-module (CLI / one-shot hosts). | applyMockModuleDirectivesFromSource( source: string, base: Record<string, AbsModuleExports>, opts: { fromFile: string; loadModule?: LoadModule }, ): MockModuleApplyResult |
applySessionCacheConfig | fn | 接线 package.json#nudo.sessionCache(进程内 LRU 上限)并立刻 trim。 | applySessionCacheConfig(config: NudoConfig | null | undefined): SessionCacheLimits |
applyTextEdits | fn | 把 edits 应用到源码(按 start 从后往前) | applyTextEdits(source: string, edits: TextEdit[]): string |
BindingInfo | type | — | BindingInfo = { abs: Abs; loc?: SourceLocation; } |
blankGeneratedCaseDirectives | fn | 供分析使用的源码视图:把生成态 call@ case 指令抹成空注释行(行数 不变)。BUG-076:混合块(手写 case + 生成见证)不参与剥离,但分析若仍把 旧见证当 directive case 读到,就不再合成当前调用点证据 ⇒ 陈旧见证永远 不刷新。写盘基源仍用 stripGeneratedCaseDirectives 的结果(手写块原样)。 | blankGeneratedCaseDirectives(source: string): string |
BodyReadField | type | — | BodyReadField = { field: string; type: string; via: string; fields?: BodyReadField[]; } |
BodyReadTypes | type | — | BodyReadTypes = Map<string, Map<string, BodyReadField[]>> |
buildCaseDirective | fn | 组装单行 * @nudo:case "name" (a, b) 指令文本(无尾换行)。 | buildCaseDirective(name: string, argsAbs: Abs[]): string | null |
buildEvalInjection | fn | — | buildEvalInjection( filePath: string, source: string, allEnvNames: string[], dirDiags: DirectiveDiag[], parseAst: (filePath: string, source: string) => ReturnType<typeof parse>, ) |
buildModuleGraph | fn | Statically extract each file's relative import edges (extension resolution identical to CLI resolveModule: ''/'.js'/'.ts'/'.mjs'; bare npm specifiers skipped). | buildModuleGraph( files: string[], cache?: ModuleGraphCache, ) |
buildTestReport | fn | 汇总一份 case 报告的断言结果(+ 逐函数展示行)。 | buildTestReport( file: string, result: AnalysisResult, opts: TestReportOptions = {}, ): TestReport |
CallRecord | type | — | — |
CallsiteRecords | type | 采集结果:记录 + 路径错误(两者必须分开呈现)。 | CallsiteRecords = { records: CallRecord[]; errors: Array<{ path: string; message: string }>; } |
caseExpectedSatisfied | fn | 实际值是否满足期望(结构面 leqAbs + 对象槽字面量严格面 + 值面谓词)。 | caseExpectedSatisfied(actual: Abs, expected: Abs): boolean |
CaseHint | type | — | CaseHint = { line: number; label: string; ok: boolean; } |
CaseJson | type | — | CaseJson = { version: 1; file: string; summary: { functions: number; externalFunctions: number; cases: number; diagnostics: number; }; fu... |
CaseJsonCase | type | — | CaseJsonCase = { name: string; args: string[]; result: string; throws: string | null; source: string | null; aggregatedFrom?: number; arg... |
CaseJsonFunction | type | — | CaseJsonFunction = { name: string; loc: SourceLocation; entryOnly: boolean; noDeclaration?: boolean; cases: CaseJsonCase[]; combined?: st... |
CaseResult | type | — | CaseResult = { name: string; argAbs: Abs[]; abs: Abs; throwsAbs: Abs; throwLoc?: SourceLocation; source?: "directive" | "callsite"; expec... |
CaseTestOutcome | type | — | CaseTestOutcome = { fn: string; caseName: string; ok: boolean; unchecked: boolean; uncheckedReason?: "no-expectation" | "inference-failed... |
checkCacheKey | fn | check 报告键:abi + 相对路径 + 源码 sha + autoBind + 侧车 sha + @nudo:import / 传递契约依赖内容 sha(依赖变更必须 miss)。 | checkCacheKey( filePath: string, source: string, opts: { autoBind: boolean; projectDir?: string; sidecarContent?: string | null; depContents?: Array<{ path: string; content: string | null }>; projectEnvNames?: string[]; analysisCfg?: { mode?: string; evalMissingSlot?: string; callSiteBudget?: number; entryThrows?: string; ignoreThrows?: string; maxForks?: number; }; }, ): string |
checkConfig | fn | package.json#nudo 键 → 执法选项 | checkConfig(config: NudoConfig | null | undefined): CheckConfig |
CheckConfig | type | — | CheckConfig = { entryThrows: "error" | "warning" | "off"; ignoreThrows: string[]; } |
CheckSupplementOptions | type | 补充诊断通道的采集选项。 | CheckSupplementOptions = { modules?: Record<string, unknown>; loadModule?: LoadModule; } |
clearAbsModuleCache | fn | — | clearAbsModuleCache(): void |
clearAnalysisFileCache | fn | — | clearAnalysisFileCache(): void |
clearAnalysisSessionCaches | fn | 清空全部会话级分析缓存(service + core)。 | clearAnalysisSessionCaches(): void |
clearEnvPathDeps | fn | — | clearEnvPathDeps(): void |
clearEvalCache | fn | — | clearEvalCache(): void |
clearFnAnalysisCache | fn | — | clearFnAnalysisCache(): void |
clearPathEnvCaches | fn | Host cache-clear hooks (CLI watch / vite / tests) must drop path-env modules too | clearPathEnvCaches(): void |
collectAbsBindingsFromGraph | fn | 收集顶层绑定名 → Abs(含相对 import / 裸包 harvest 注入)。 | collectAbsBindingsFromGraph( source: string, filePath: string, opts: AbsGraphOptions = {}, ): Map<string, Abs> |
collectCallRecords | fn | 调用点发现(阶段一):在"使用现场"文件(测试 / 上层应用)中求值 顶层代码,收集它对(外部模块导出的)函数的调用记录。每条记录带 真实的实参类型与结果类型——后续 analyzeFile 将其注入合成 case, 使被使用方从 entry-only(参数全 unknown)升级为真实调用形态。 | collectCallRecords(filePath: string, source: string): CallSiteRecord[] |
collectCallsiteRecords | fn | 采集使用点记录(--from 等价通道)。 | collectCallsiteRecords(sites: string[]): CallsiteRecords |
collectCheckSupplementIssues | fn | 采集三条补充诊断通道(指令文法 / mock 装载 / env 未解析)→ CheckIssue[]。 | collectCheckSupplementIssues( filePath: string, source: string, opts: CheckSupplementOptions = {}, ): CheckIssue[] |
collectDependencySpecs | const | — | — |
collectEnvGlobals | fn | — | collectEnvGlobals(envNames: string[]): Record<string, Abs> |
collectEnvModules | fn | Bug 282:env 模块是 CJS 互操作模块——Node 的 node:fs 的默认导出就是 模块对象本身(具名导出挂在它上面)⇒ ESM 默认导入 (import fs from "node:fs")必须绑到命名空间。 | collectEnvModules(envNames: string[]): Record<string, AbsModuleExports> |
collectEnvNames | fn | — | collectEnvNames(filePath: string, source: string, includeProject: boolean): string[] |
collectEvalDiagnostics | fn | 静态收集 求值引擎诊断。 | collectEvalDiagnostics( source: string, extraKnown?: Iterable<string>, filename?: string, ): EvalDiagnostics |
collectEvalReplacements | fn | 收集 @nudo:replace + @nudo:as → transpile 注入表。 | collectEvalReplacements( source: string, opts?: { diags?: DirectiveDiag[] }, ): EvalReplacements |
collectLoadDepContents | fn | — | collectLoadDepContents( filePath: string, source: string, loadModule: (spec: string, fromFile: string) => string | undefined, ) |
collectMissingExportIssues | fn | named import / re-export 缺名 → missing-export issue。 | collectMissingExportIssues( source: string, modules: Record<string, AbsModuleExports>, fromFile: string, ): AbsModuleLoadIssue[] |
collectParamBodyReadTypes | fn | 收集每个函数形参成员读取 + 用法推断类型。 | collectParamBodyReadTypes(source: string): BodyReadTypes |
collectParamContracts | fn | 收集每个函数形参的契约证据(quickfix 侧车发射面): 数组方法接收者读 → array(元素契约)(元素 shape 由回调元素位 成员读合成);纯成员读 → shape(…);参数本体标量用法 → 叶子 DSL (number() 等)。无证据参数不进表(契约留 any 位)。 | collectParamContracts(source: string): ParamContracts |
collectSkipReturns | fn | 每个带 @nudo:skip 的顶层函数 → 声明的返回 Abs;null = 未声明返回类型。 | collectSkipReturns(source: string): Map<string, Abs | null> |
collectStaticImports | fn | 从入口文件沿静态相对 import/require 收集(仅类型事实,不是运行时加载器)。 | collectStaticImports( entryFile: string, maxDepth = 8, ): Map<string, ModuleExports> |
compileAnyMatcher | fn | Compile a pattern list into a matcher that is true when any pattern matches. | compileAnyMatcher(patterns: string[] | string): Matcher |
compilePattern | fn | 单模式编译:无通配符(* / ?)→ 字面量子串匹配;有 → 锚定正则。 | compilePattern(pattern: string): Matcher |
CompletionItem | type | — | CompletionItem = { label: string; kind: "property" | "method" | "variable" | "function"; detail?: string; } |
ComposedEvalModules | type | 模块图组装的共享产物:analyzer 与 tryRunEval 走同一序列 (evalAbsModuleGraph → collectEnvModules → mergeHarvestUnderEnv → applyMockModule*),单一事实源,不再各自漂移。 | ComposedEvalModules = { modules: Record<string, AbsModuleExports>; issues: AbsModuleLoadIssue[]; mockErrors: string[]; mockModuleErrors: ... |
composeEvalModules | fn | 模块图组装单一入口:相对/harvest 模块图 → @nudo:env modules 并入 (手写 env wins,B8)→ @nudo:mock-module 覆盖。 | composeEvalModules( source: string, filePath: string, opts: { envNames?: string[]; seedVars?: Record<string, Abs>; seedFns?: AbsGraphOptions["seedFns"]; loadModule?: LoadModule; fileDirectives?: FileDirective[]; } = {}, ): ComposedEvalModules |
computeDirtySet | fn | changed plus its transitive dependents (reverse-edge BFS); cycle-safe via visited. | computeDirtySet(dependents: Map<string, Set<string>>, changedFile: string): string[] |
configIgnoreThrows | fn | package.json#nudo.check.ignoreThrows 的原始值 → 与 CLI 同口径的列表 (679:配置面复用本解析器,不再走各面自己的严格 string[] 过滤—— 裸字符串 "TypeError" 曾被静默丢成空表 ⇒ 门禁假红)。 | configIgnoreThrows( config: { check?: unknown } | null | undefined, ): string[] |
ConstraintSourceExpr | type | — | ConstraintSourceExpr = { expr: string; importFrom?: string; importName?: string; } |
contractCacheKey | fn | effectiveContract 表键(L1 Phase B,design-persistent-cache)。 | contractCacheKey( filePath: string, source: string, opts: { autoBind: boolean; projectDir?: string; sidecarSource?: string | undefined; depContents?: Array<{ path: string; content: string | null }>; projectEnvNames?: string[]; }, ): string |
contractConfig | fn | 归一化 nudo.contract 配置段。 | contractConfig(config: NudoConfig | null | undefined): ContractConfig |
ContractConfig | type | — | ContractConfig = { autoBind: boolean; emit: string[]; } |
ContractDraftEntry | type | — | ContractDraftEntry = { fn: string; identity?: string; params: Array<{ name: string; constraint?: NudoConstraint; display: string; project... |
ContractDraftOpts | type | — | ContractDraftOpts = { fnNames?: string[]; records?: CallRecord[]; loadModule?: LoadModule; autoBind?: boolean; bodyAccesses?: boolean; so... |
ContractDraftResult | type | — | ContractDraftResult = { file: string; entries: ContractDraftEntry[]; draftSource: string; sidecarPath: string; } |
contractDslOf | fn | 契约证据 → constraint-builder DSL 文本(array(shape({ … })) 等) | contractDslOf(ev: ParamContractEvidence): string |
contractSurface | fn | 单文件 contract 表面:analyzer 推断结果给出函数清单与 implicit 展示, effectiveContract 给出契约命中(手写 > 生成段)。 | contractSurface( filePath: string, opts: ContractSurfaceOpts = {}, ): Promise<ContractSurfaceEntry[]> |
ContractSurfaceEntry | type | — | ContractSurfaceEntry = { fn: string; identity?: string; kind: "export" | "local"; source: "handwritten" | "generated" | "implicit"; param... |
ContractSurfaceOpts | type | — | ContractSurfaceOpts = { autoBind?: boolean; loadModule?: LoadModule; records?: CallRecord[]; source?: string; diagnostics?: ContractFaceD... |
currentBForkBudgetLimit | fn | 当前生效 fork 上限(调试/测试;与 core getEvalForkBudgetLimit 同源) | currentBForkBudgetLimit(): number |
DEFAULT_ANALYSIS_MODE | const | ", ]; /** A1 产品默认:exports — 普通带导出的 .js 进 IDE;directives/all 需显式 | const DEFAULT_ANALYSIS_MODE |
DEFAULT_SESSION_CACHE_LIMITS | const | 保守默认:多项目共存时不悄悄吃内存(大仓请显式调高) | const DEFAULT_SESSION_CACHE_LIMITS |
defaultAbsLoadModule | fn | 相对说明符 → 源码(与 defaultLoadModule 同一扩展名/入口候选表) | defaultAbsLoadModule(spec: string, fromFile: string): string | undefined |
defaultLoadModule | fn | 默认 loadModule:相对/绝对说明符 → 源码。 | defaultLoadModule( spec: string, fromFile: string, mode?: ModuleLoadMode, ): string | undefined |
DepContent | type | — | DepContent = { path: string; content: string | null } |
DerivedExport | type | — | DerivedExport = { file: string; fn: string; paramNames: string[]; params: DerivedParam[]; returns?: { constraint: NudoConstraint; dsl: st... |
DerivedParam | type | — | DerivedParam = { name: string; constraint: NudoConstraint; dsl: string; prelude: string[]; imports: Array<{ name: string; from: string }>... |
deriveFromRoot | fn | 入口:对 filePath 做 root 驱动下行推导。 | deriveFromRoot( filePath: string, opts: RootDeriveOpts = {}, ): RootDeriveResult |
detectEntryVariantsFromPackageJson | fn | Detect browser/node dual faces in a parsed package.json. | detectEntryVariantsFromPackageJson(pkg: unknown): EntryVariantFaces | null |
Diagnostic | type | — | Diagnostic = { range: SourceLocation; severity: DiagnosticSeverity; message: string; tags?: DiagnosticTag[]; code?: string; suggestions?:... |
DiagnosticSeverity | type | — | DiagnosticSeverity = "error" | "warning" | "info" |
DiagnosticsLevel | type | — | DiagnosticsLevel = "off" | "errors" | "default" | "verbose" |
diagnosticsLevelForFile | fn | — | diagnosticsLevelForFile(filePath: string): DiagnosticsLevel |
DiagnosticTag | type | — | DiagnosticTag = "unnecessary" |
DirectiveCaseMode | type | @nudo:case 求值档: - none(默认):不跑 case;有 case 的函数也走 entry@ 出签名(check / IDE) - all:逐 case 真跑(nudo test / CaseJson / freeze) - selected:只跑 activeCases 选中的那条(LSP selectCase) | DirectiveCaseMode = "none" | "all" | "selected" |
directiveDiagIssues | fn | D1: 指令文法诊断(nudo:directive-syntax)→ CheckIssue(warning,不挡 exit)。 | directiveDiagIssues( diags: Array<{ code: string; message: string; at?: { line: number; column: number }; }>, ): CheckIssue[] |
DiskCache | fn | — | DiskCache { private readonly root: string | undefined; private readonly ns: string; private readonly keyMat: Buffer | undefined; enabled ... |
DiskCacheOptions | type | — | DiskCacheOptions = { root?: string | undefined; namespace: string; signKey?: string; } |
diskCacheRoot | fn | 磁盘缓存根(B3):config.cache / NUDO_CACHE_DIR / 默认关。 | diskCacheRoot( config: NudoConfig | null | undefined, projectDir: string | undefined, ): string | undefined |
DiskCacheSignError | fn | nudo.cache.sign 配置错误(sign: true 但 NUDO_CACHE_KEY 缺席/空, 或 sign 取值形状非法)。签名是安全旋钮 ⇒ 拒绝运行(CLI 面显式报错 退出),不静默降级到未签名缓存。 | DiskCacheSignError extends Error { constructor(message: string) { super(message); this.name = "DiskCacheSignError"; } } |
diskCacheSignState | fn | — | diskCacheSignState( config: NudoConfig | null | undefined, env: NodeJS.ProcessEnv = process.env, ): DiskCacheSignState |
DiskCacheSignState | type | 磁盘缓存条目签名状态(B3 信任面): - { kind: "off" }:未开签名(默认)——旧未签名行为原样 - { kind: "on", key }:签名开 + NUDO_CACHE_KEY 就绪(key = 原始密钥串, HMAC 密钥材料派生见 disk-cache.ts) - { kind: "error", message }:配置错误——sign: true 但密钥缺席/空。 | DiskCacheSignState = | { kind: "off" } | { kind: "on"; key: string } | { kind: "error"; message: string } |
domainEvidenceCases | fn | 产物面(dts / zod / standard / guard)的域证据 case。 | domainEvidenceCases(cases: readonly CaseResult[]): CaseResult[] |
draftContract | fn | 为单文件顶层导出生成 contract 草稿(不写盘)。 | draftContract( filePath: string, opts: ContractDraftOpts = {}, ): Promise<ContractDraftResult> |
DraftEvidence | type | DraftEvidence body = 仅来自函数体对形参的成员读取(草稿建议,非义务)。 | DraftEvidence = "callsite" | "directive" | "symbolic" | "body" | "none" |
DtsClassSurface | type | 类声明面(成员面 + 导出形态) | DtsClassSurface extends DtsClassMemberSurface { exportName?: string; exportNames?: string[]; isDefault: boolean; } |
DtsContractFace | type | 契约面证据(export CLI 从 effectiveContract 取——与 check 签名面同数据源: sidecar(*.nudo.js)∪ inline @nudo:contract)。 | DtsContractFace { params: Array<{ name: string; abs: Abs; optional?: boolean; display?: string }>; return?: Abs; returnDisplay?: string; } |
DtsFunctionProjection | type | projectFunctionDts 的返回面:声明行 + 主签名参数位(unknown = 无证据) | DtsFunctionProjection { lines: string[]; params: Array<{ name: string; type: string }>; exportName?: string; classMember?: { className: s... |
DtsModuleExtras | type | 模块面合成的分析面补充证据(函数入口之外的事实:模块级绑定 Abs)。 | DtsModuleExtras { values?: ReadonlyMap<string, Abs>; } |
DtsModuleProjection | type | 模块面 dts 投影结果 | DtsModuleProjection { lines: string[]; params: Array<{ name: string; type: string }>; } |
dtsModuleSurface | fn | 模块导出面扫描(源文件 → 导出名表 + 类面 + 再导出语句)。 | dtsModuleSurface(source: string): DtsModuleSurface |
DtsModuleSurface | type | 模块导出面(源文件的导出面:导出名 → 本地绑定 + 类面 + 再导出 + 导入面) | DtsModuleSurface { exportBindings: Map<string, string>; reexports: string[]; classes: Map<string, DtsClassSurface>; imports?: Map<string,... |
DtsValueSurface | type | 模块级值声明面(BUG-190):export const/let/var 与 TS enum。 | DtsValueSurface { kind: "const" | "let" | "var" | "enum"; enumMembers?: Array<{ name: string; init?: string }>; constEnum?: boolean; type... |
emitContract | fn | 单文件 emit:分析 → 逐目标投影/自检 → 组装侧车内容 →(非 dryRun)写盘。 | emitContract( filePath: string, opts: EmitContractOpts, ): Promise<EmitContractResult> |
EmitContractOpts | type | — | EmitContractOpts = { fnNames?: string[]; mode: "add" | "update"; all?: boolean; dryRun?: boolean; records?: CallRecord[]; source?: string... |
EmitContractResult | type | — | EmitContractResult = { written: string[]; skipped: Array<{ fn: string; reason: EmitContractSkipReason }>; changed: boolean; diff?: string... |
EmitContractSkipReason | type | — | EmitContractSkipReason = | "name-clash" | "not-projectable" | "not-an-export" | "no-change" | "emit-denied" | "multi-declarator" | "expor... |
emitDerivedFromRoot | fn | — | emitDerivedFromRoot( rootFile: string, opts: { fnNames?: string[]; mode: "add" | "update"; dryRun?: boolean; loadModule?: LoadModule; autoBind?: boolean; refreshExistingOnly?: boolean; baseContent?: (sidecarPath: string) => string | undefined; skipWrite?: string[]; directSections?: Set<string>; directCreatedSections?: Set<string>; }, ): EmitDerivedResult |
EmitDerivedResult | type | — | EmitDerivedResult = { sidecars: Array<{ file: string; sidecarPath: string; fn: string; written: boolean; writtenNames?: string[]; changed... |
EmitResult | type | — | EmitResult = { source: string; changed: boolean; written: Array<{ fn: string; cases: string[] }>; skipped: Array<{ fn: string; reason: Em... |
EmitSkipReason | type | — | EmitSkipReason = | "hand-written" | "already-generated" | "entry-only" | "no-serializable-cases" | "no-declaration" | "contract-violation... |
ENTRY_CONTRACT_NOTE | const | entry@ 回退 case × 有效契约的注解行:解释「check 全绿但 test 打 (any) => any throws」的表面矛盾——entry@ 用的是无约束入口 face, 契约作用于 check/export 面;要看到受约束的 case 就加 @nudo:case 或提供调用点。throws 显示保留(那是无约束 face 的诚实结果)。 | const ENTRY_CONTRACT_NOTE |
EntryVariantFaceGroup | type | One browser/node face pair, scoped to a subpath or field source. | EntryVariantFaceGroup = { key: string; browser: string[]; node: string[]; } |
EntryVariantFaces | type | — | EntryVariantFaces = { kind: "exports-conditions" | "browser-field"; groups: Map<string, EntryVariantFaceGroup>; } |
entryVariantForFile | fn | Dual-entry info for an analyzed file: the owning package must declare a dual group (browser + node faces resolving to different files in the same subpath / field source) and this file must be one of that group's entry targets on exactly one face. | entryVariantForFile(filePath: string): EntryVariantInfo | null |
EntryVariantInfo | type | — | EntryVariantInfo = { pkgPath: string; pkgDir: string; pkgName?: string; kind: "exports-conditions" | "browser-field"; browserPaths: strin... |
EntryVariantIssue | type | Host-facing info issue (CLI check / JSON) for one analyzed entry variant. | EntryVariantIssue = { severity: "info"; code: typeof DIAG.dualEntry; message: string; suggestion: string; line: number; column: number; } |
entryVariantIssueForFile | fn | — | entryVariantIssueForFile(filePath: string): EntryVariantIssue | null |
ENV_UNRESOLVED_CODE | const | path env 加载失败告警码(live 瞬态:每轮 preloadPathEnvs 现场收集)。 | const ENV_UNRESOLVED_CODE |
EnvHarvestConflict | type | Conflict when handwritten env overwrote a harvest module/export (B8). | EnvHarvestConflict = { module: string; exports: string[]; defaultOverwritten: boolean; } |
envPathDependents | fn | 依赖该 env 模板的源文件列表 | envPathDependents(envPath: string): string[] |
envUnresolvedIssues | fn | path env 未解析 → CheckIssue(warning)。 | envUnresolvedIssues( filePath: string, source: string, baseDir = dirname(filePath), ): CheckIssue[] |
evalAbsModuleGraph | fn | 递归求值相对依赖 + 裸包 harvest,产出入口可用的 modules 表。 | evalAbsModuleGraph( entrySource: string, entryFile: string, opts: AbsGraphOptions = {}, ): AbsModuleGraphResult |
EvalBuiltinUnknown | type | — | EvalBuiltinUnknown = { name: string; range: EvalLoc } |
EvalDiagnostics | type | — | EvalDiagnostics = { unreachable: EvalUnreachable[]; builtinUnknown: EvalBuiltinUnknown[]; capabilityDenied: EvalBuiltinUnknown[]; deniedM... |
EvalRunResult | type | — | EvalRunResult = { exports: Record<string, unknown>; modules: Record<string, AbsModuleExports>; memberDiags?: EvalMemberDiag[]; moduleIssu... |
EvalUnreachable | type | — | EvalUnreachable = { range: EvalLoc } |
evictAbsModuleCacheFiles | fn | 键身份统一 stablePathKey(FIX-RESIDUAL-4):跨盘符形态删除/命中一致 | evictAbsModuleCacheFiles(paths: string[]): void |
evictAnalysisCachesForFiles | fn | 依赖内容变更后:按入口文件定向逐出 service 层缓存。 | evictAnalysisCachesForFiles(files: string[]): void |
evictAnalysisFileCacheForFiles | fn | 依赖变更后:按入口文件逐出(查找与写入同走 stablePathKey) | evictAnalysisFileCacheForFiles(files: string[]): number |
evictEvalCacheForFiles | fn | 依赖文件变更后:逐出以这些文件为入口的 evaluator 缓存(键走 stablePathKey;两种 mode 槽一并清) | evictEvalCacheForFiles(files: string[]): number |
evictFnAnalysisCacheForFiles | fn | Dependency content changed: drop every per-fn entry for these entry files. | evictFnAnalysisCacheForFiles(files: string[]): number |
evictProjectConfigMemo | fn | 清空 findProjectConfig 目录链 memo(项目配置 watch 通道 / 测试隔离)。 | evictProjectConfigMemo(): void |
extractNudoImportSpecs | fn | 从源码提取 @nudo:import / @nudo:import * as 的 specifier | extractNudoImportSpecs(source: string): string[] |
FileEvalFailure | type | — | — |
filterDiagnosticsByLevel | fn | 按 analysis.diagnostics 档过滤 evaluator/check 显示路径诊断。 | filterDiagnosticsByLevel<T extends { severity: string; code?: string }>( diags: T[], level: DiagnosticsLevel, ): T[] |
findOwningPackage | fn | Nearest package.json walking up from the file's directory. | findOwningPackage( fromFile: string, ) |
findProjectConfig | fn | — | findProjectConfig( startDir: string, ) |
formatContractSurfaceLine | fn | 单条 contract 打印行(CLI runContract 与 LSP agent 面共用) | formatContractSurfaceLine(e: ContractSurfaceEntry): string |
formatDerivedSection | fn | 组装生成段(组合式 + import + prelude)。 | formatDerivedSection( row: DerivedExport, opts: { rootSidecarDir: string; targetSidecarDir: string; takenNames?: Iterable<string>; }, ) |
formatDraftModule | fn | 草稿模块文本(人读 + 可复制到 *.nudo.js / *.nudo.ts) | formatDraftModule( filePath: string, entries: ContractDraftEntry[], sidecarPath?: string, throwsHints?: readonly string[], ): string |
formatDraftSummary | fn | — | formatDraftSummary( sourceRel: string, draftRel: string, result: ContractDraftResult, write?: WriteDraftResult, ): string[] |
formatEmitSummary | fn | emit 摘要行(CLI runContractEmit 与 LSP agent 面共用;路径由调用方按 展示口径传入——CLI 传 cwd 相对、agent 传绝对路径)。 | formatEmitSummary( sourcePath: string, sidecarRel: string, result: EmitContractResult, ): string[] |
formatExpected | fn | 期望值的可读文本(带谓词):number (> 0) / { n: number (> 0) }。 | formatExpected(expected: Abs): string |
formatPathErrorText | fn | 路径错误的非 JSON 面文案(CLI 的 usage error 面同口径): 一行原因 + 一行 fix: 提示。 | formatPathErrorText(errors: PathError[]): string |
formatTestReport | fn | — | formatTestReport(r: TestReport): string |
FunctionAnalysis | type | — | FunctionAnalysis = { name: string; loc: SourceLocation; paramNames: string[]; formals?: FormalParam[]; declaredReturnType?: string; thisR... |
generateDts | fn | — | generateDts(result: AnalysisResult): string |
generateFunctionDtsLines | fn | — | generateFunctionDtsLines( fn: FunctionAnalysis, contract?: DtsContractFace, ): string[] |
generateGuardFunctionFromAbs | fn | 守卫源码:export function <name>(value: unknown): boolean { … }。 | generateGuardFunctionFromAbs(name: string, abs: Abs, used?: Set<string>): string |
getAbsModuleCacheSize | fn | 测试/诊断:当前条目数(≤ ABS_MODULE_CACHE_MAX) | getAbsModuleCacheSize(): number |
getAnalysisFileCacheSize | fn | — | getAnalysisFileCacheSize(): number |
getAnalysisSession | fn | 进程内默认 AnalysisSession(LSP server / CLI watch / agent tools 共用) | getAnalysisSession(): AnalysisSession |
getEnvHarvestConflictCollector | fn | Read-only peek for tests / nested restore. | getEnvHarvestConflictCollector() |
getEnvPathDepsSize | fn | 测试/诊断:反向依赖驻留规模 | getEnvPathDepsSize(): number |
getEvalCacheSize | fn | 测试/诊断:当前 evaluator run 缓存条目数(≤ getSessionCacheLimits().maxEvalRuns) | getEvalCacheSize(): number |
getFnAnalysisCacheSize | fn | 测试/诊断:当前条目数(≤ getSessionCacheLimits().maxFns) | getFnAnalysisCacheSize(): number |
getPathEnvCacheSizes | fn | 测试/诊断:path-env 驻留规模(均 ≤ 对应上限) | getPathEnvCacheSizes() |
getPathEnvDepContents | fn | 已成功预载的 path env 文件(供 check 磁盘缓存指纹纳入 sha)。 | getPathEnvDepContents(baseDir?: string): Array<{ path: string; content: string | null }> |
getPathEnvLoadErrors | fn | path env 加载失败诊断(check/test 打印 nudo:env-unresolved warning 用)。 | getPathEnvLoadErrors(baseDir?: string): Array<{ path: string; error: string; baseDir: string }> |
getSessionCacheLimits | fn | — | getSessionCacheLimits( env: NodeJS.ProcessEnv = process.env, ): SessionCacheLimits |
inferenceFailed | fn | Bug 950 第三态:引擎未能推断实测值(⇒ 无法判定,不是「不匹配」)。 | inferenceFailed(actual: Abs): boolean |
injectBindings | fn | — | injectBindings( source: string, bindings: TypeBinding[], ) |
InsertCaseOptions | type | 固化写回的宿主接线(BUG-055 / BUG-119)——全部可选: 缺省时行为与改前逐字一致(只认源码内指令契约、add 模式的整函数跳过)。 | InsertCaseOptions = { filePath?: string; loadModule?: (spec: string, fromFile: string) => string | undefined; autoBind?: boolean; project... |
insertGeneratedCaseDirectives | fn | 把 analysis 中的合成 case(source === "callsite")固化为源码指令: 1. | insertGeneratedCaseDirectives( source: string, analysis: AnalysisResult, opts: InsertCaseOptions = {}, ): EmitResult |
isEnvTemplatePath | fn | watch 门禁:env 模板变更必须可被接收(即便扩展名不进 isNudoTargetPath) | isEnvTemplatePath(path: string): boolean |
isNudoTargetPath | fn | nudo 推断目标文件判定(纯扩展名规则,路径无需存在)。 | isNudoTargetPath(path: string): boolean |
isProjectConfigPath | fn | — | isProjectConfigPath(path: string): boolean |
isRuntimeGlobalCtorName | fn | brand 名能否用 z.instanceof(<name>) 表达(须是运行时全局构造器名)。 | isRuntimeGlobalCtorName(name: string): boolean |
isSidecarPath | fn | Formal sidecar contracts only — drafts never ambient-bind and need not reanalyze | isSidecarPath(path: string): boolean |
isWatchRelevantPath | fn | Watch accept gate: analysis targets + sidecar/config/env-template invalidators | isWatchRelevantPath(path: string): boolean |
LoadModule | type | — | LoadModule = (spec: string, fromFile: string) => string | undefined |
locFromNode | fn | — | locFromNode(node: Node): SourceLocation |
Matcher | type | 极简 glob → RegExp 编译器(自 vite-plugin 内联实现抽取,语义不变)。 | Matcher = (id: string) => boolean |
matchesEmitAllowlist | fn | 极简 glob(** / * / ?):相对 projectDir 匹配源文件绝对路径 (不是侧车路径;侧车随源文件同目录写出)。无白名单 → true。 | matchesEmitAllowlist( absPath: string, projectDir: string | undefined, patterns: string[], ): boolean |
matchSidecarFnDecl | fn | 定位侧车里目标契约的声明起点:export const <name> = fn( / <name> = fn(。 | matchSidecarFnDecl( sidecarSource: string, exportName: string, ) |
materializeAction | fn | kind → WorkspaceEdit 物化。返回 undefined = 该 action 只读(info)或缺证据。 | materializeAction(input: MaterializeInput): QuickfixPlan | undefined |
MaterializeInput | type | — | MaterializeInput = { code: string; fn?: string; file: string; source: string; sidecarText?: string; sidecarPath: string; action: CheckAct... |
mergeCheckIssues | fn | 追加 issues 并同步 summary/ok(有新 error 则 ok=false)。 | mergeCheckIssues<T extends Summarized>(report: T, issues: CheckIssue[]): T |
MergeHarvestOptions | type | — | MergeHarvestOptions = { onConflict?: (c: EnvHarvestConflict) => void; } |
mergeHarvestUnderEnv | fn | Handwritten @nudojs/env wins over harvest / graph modules on overlapping module keys and overlapping export names (docs/versioning.md B8 + website harvester API). | mergeHarvestUnderEnv( harvestModules: Record<string, AbsModuleExports>, envModules: Record<string, AbsModuleExports>, opts?: MergeHarvestOptions, ): Record<string, AbsModuleExports> |
mockDirectivesToAbsSeeds | fn | 从函数上的 @nudo:mock 指令收集 Abs seed | mockDirectivesToAbsSeeds( functions: Array<{ directives: FunctionWithDirectives["directives"]; name?: string }>, opts?: { fromFile?: string; loadModule?: LoadModule; }, ): AbsMockSeeds |
MockFromError | type | @nudo:mock name from "path" 解析失败(缺文件/缺绑定/求值失败)。 | MockFromError = { name: string; fromPath: string; message: string; code?: string; } |
mockFromErrorIssues | fn | mock 装载失败 → CheckIssue。 | mockFromErrorIssues(mockFromErrors: MockFromError[]): CheckIssue[] |
MockModuleApplyResult | type | — | MockModuleApplyResult = { modules: Record<string, AbsModuleExports>; errors: FromMockError[]; applied: boolean; } |
mockSeedsForSource | fn | 便捷入口:源码 → @nudo:mock 的 eval 注入 Abs 绑定(checkSource 注入管线用) | mockSeedsForSource( source: string, opts?: { fromFile?: string; loadModule?: LoadModule }, ): Record<string, Abs> |
mockSeedsToAbsMocks | fn | 求值引擎注入用:seedVars + seedFns 统一为 Abs 函数绑定。 | mockSeedsToAbsMocks(seeds: AbsMockSeeds): Record<string, Abs> |
ModuleExports | type | — | ModuleExports = { path: string; named: Map<string, string>; defaultExport?: string; source: string; poly: Map<string, PolyFn>; } |
ModuleGraphCache | type | mtime 边缓存:key 为文件路径,edges 为已抽取的相对 import 边(与 buildModuleGraph 返回语义一致)。 | ModuleGraphCache = Map<string, { mtimeMs: number; size: number; edges: string[] }> |
ModuleReadError | fn | 路径 stat 或文件读失败(EACCES / EMFILE / ESTALE / EIO …)。 | ModuleReadError extends Error { readonly code: string; readonly path: string; constructor(path: string, cause: unknown) { const code = (c... |
normalizeRealPath | fn | — | normalizeRealPath(p: string): string |
normPosixPath | fn | posix 化(\ → /)——等值比较前先统一分隔符 | normPosixPath(p: string): string |
noteEnvPathDeps | fn | 源码里的 path-based load specs 解析为绝对路径后登记反向边 | noteEnvPathDeps(sourcePath: string, source: string): void |
NudoCacheConfig | type | nudo.cache 的对象形态(CI 级信任面): - dir:根目录(true/省略 → .nudo/cache;字符串 → 自定义根;false → 关闭) - sign:条目 HMAC 签名(默认 false)。开启时必须提供 env NUDO_CACHE_KEY(非空),否则拒绝运行(显式配置错误,不静默降级)—— 伪造的结构合法 CheckJson 会造成假绿(persistent-cache.md 的 L1 关闭理由), 签名把「结构合法」升级为「本密钥签发」。 | NudoCacheConfig = { dir?: boolean | string; sign?: boolean; } |
NudoConfig | type | — | NudoConfig = { env?: string[]; mocks?: Record<string, string>; contract?: { autoBind?: boolean; emit?: string[] | string; }; analysis?: {... |
openDiskCache | fn | 单源 DiskCache 构造:根目录(diskCacheRoot)+ 签名状态 (diskCacheSignState)一并解析。配置错误时 throw DiskCacheSignError (消费面:CLI check/contract/health 在 action 层预检给分面错误形态; 本函数是库面/漏检路径的 fail-closed 兜底)。 | openDiskCache(opts: { config: NudoConfig | null | undefined; projectDir: string | undefined; namespace: string; env?: NodeJS.ProcessEnv; }): DiskCache |
ParamContractEvidence | type | 参数契约证据(quickfix 侧车发射面): - array:参数被当数组方法接收者调用(items.reduce(…));element 为 回调元素位合成的元素契约(无证据 → array(any())) - shape:参数被成员读取(既有 body-read 字段面) - scalar:参数本体直接用法(1 + tax → number())——多参函数只收窄 一个参数仍消不掉 L2(残余 may-throw 来自其余未约束位) 优先级:array > shape > scalar(数组方法读是最强形态证据)。 | ParamContractEvidence = | { kind: "array"; element?: ParamContractEvidence } | { kind: "shape"; fields: BodyReadField[] } | { kind: "scal... |
ParamContracts | type | fnName → paramName → 契约证据(参数按声明序插入) | ParamContracts = Map<string, Map<string, ParamContractEvidence>> |
parseIgnoreThrows | fn | --ignore-throws / package.json#nudo.check.ignoreThrows 解析的 单一实现(CLI / LSP / vite-plugin 三面共享)。 | parseIgnoreThrows(raw?: unknown): string[] | undefined |
pathEnvPreloadFingerprint | fn | 预载状态指纹(已驻留的 path env 文件:路径 + mtimeMs)。 | pathEnvPreloadFingerprint(): string |
PathError | type | 路径错误(--json 信封的 pathErrors 面;非 JSON 面走 usage error)。 | PathError = { path: string; code: PathErrorCode; message: string; suggestion: string; } |
PathErrorCode | type | 路径错误码(与 CLI 的 PathError 码集一致)。 | PathErrorCode = | typeof DIAG.pathNotFound | typeof DIAG.pathEmptyDir | typeof DIAG.pathNotTarget | typeof DIAG.pathMissingCallsite | typ... |
pathNotFoundError | fn | 路径不存在(CLI 同口径文案)。 | pathNotFoundError(path: string): PathError |
projectConfigMemoStats | fn | 诊断/测试:memo 条目数 + 实际读盘(readFileSync+JSON.parse)次数 | projectConfigMemoStats() |
projectFunctionDts | fn | 为单个函数生成 .d.ts 投影(JSDoc + 单一 widen 主签名)。 | projectFunctionDts( fn: FunctionAnalysis, contract?: DtsContractFace, surface?: DtsModuleSurface, ): DtsFunctionProjection |
projectModuleDts | fn | — | projectModuleDts( surface: DtsModuleSurface | undefined, entries: ReadonlyArray<{ fn: FunctionAnalysis; projection: DtsFunctionProjection; contract?: DtsContractFace; }>, extras?: DtsModuleExtras, ): DtsModuleProjection |
QuickfixPlan | type | — | QuickfixPlan = { titleKind: QuickfixTitleKind; title: string; edits: TextEdit[]; sidecar?: { path: string; newText: string }; openPath?: ... |
QuickfixTitleKind | type | — | QuickfixTitleKind = "fix" | "silence" | "review" | "adjust" | "scaffold" |
ReferenceInfo | type | — | ReferenceInfo = { name: string; loc: SourceLocation; uri?: string; } |
relativizePath | fn | 稳定逻辑根相对化(磁盘缓存路径维):树内相对 root,树外取 node_modules/<pkg> 段、monorepo root 或 pnpm store 内容哈希; 绝对路径明文绝不进 key。 | relativizePath(p: string, root?: string): string |
resetAllAnalysisCaches | fn | 比 clearAnalysisSessionCaches 更彻底:再丢 AST LRU(测试 / 进程复用场景) | resetAllAnalysisCaches(): void |
resetSessionCacheLimitState | fn | 测试:清空显式 / package.json 层(env 每次调用现读,无需重置) | resetSessionCacheLimitState(): void |
resolveModule | fn | — | resolveModule(source: string, fromDir: string) |
resolveRelativeSpec | fn | 相对说明符 → 相对 from 文件的规范化 posix 路径;非相对说明符 → undefined | resolveRelativeSpec(from: string, spec: string): string | undefined |
RootDeriveOpts | type | — | RootDeriveOpts = { loadModule?: LoadModule; autoBind?: boolean; fnNames?: string[]; refreshExistingOnly?: boolean; } |
RootDeriveResult | type | — | RootDeriveResult = { roots: string[]; derived: DerivedExport[]; hasRoot: boolean; graphError?: string; } |
safeLoadModule | fn | loadModule 容错包装:读失败当 miss,避免 I/O 错误炸穿指纹/图遍历。 | safeLoadModule( loadModule: (spec: string, fromFile: string) => string | undefined, spec: string, fromFile: string, ): string | undefined |
SchemaDialect | type | — | SchemaDialect = "zod" |
SchemaNode | type | — | SchemaNode = | { k: "lit"; value: import("@nudojs/core").LiteralValue } | { k: "prim"; type: "number" | "string" | "boolean" | "bigint" |... |
SchemaProjection | type | — | SchemaProjection = { source: string; dialect: SchemaDialect; dropped: string[]; } |
SchemaProjectionScope | type | 模块面作用域(BUG-051):shadowedGlobals = 本模块里被用户绑定(类 / 导入 / 顶层声明)遮蔽掉的全局构造器名。 | SchemaProjectionScope = { shadowedGlobals?: ReadonlySet<string>; } |
SchemaRefinement | type | — | SchemaRefinement = | { kind: "numBound"; op: "gt" | "ge" | "lt" | "le"; n: number } | { kind: "int" } | { kind: "strMin"; n: number } | {... |
serializeCaseArg | fn | 单个 Abs → parseCaseArgExpr 可解析回去的表达式文本;不可表达返回 null | serializeCaseArg(a: Abs): string | null |
serializeCaseJson | fn | — | serializeCaseJson( result: AnalysisResult, file: string, ): CaseJson |
SessionCacheLimits | type | 会话级内存 LRU 上限(进程内,非磁盘 cache)。 | SessionCacheLimits = { maxFiles: number; maxFns: number; maxEvalRuns: number; } |
setAnalysisSession | fn | 测试:替换默认 session(返回旧值以便恢复) | setAnalysisSession(session: AnalysisSession | undefined): AnalysisSession | undefined |
setEnvHarvestConflictCollector | fn | Install conflict collector; returns the previous one so nested/concurrent analyzeFile callers can save/restore (scoped fallback: inside runWithCollectorScope each analysis gets its own slot, no cross-talk). | setEnvHarvestConflictCollector( collector: ((c: EnvHarvestConflict) => void) | null, ) |
setSessionCacheFromProject | fn | package.json#nudo.sessionCache 层(findProjectConfig / 宿主接线) | setSessionCacheFromProject(partial: PartialLimits | null | undefined): void |
setSessionCacheLimits | fn | 显式覆盖(宿主 / 测试)。传 null 清除显式层 | setSessionCacheLimits(partial: PartialLimits | null): SessionCacheLimits |
sha256Hex | fn | — | sha256Hex(data: string | Buffer): string |
shapeDslFromFields | fn | shape({ type: string(), loc: shape({ start: … }) }) 文本。 | shapeDslFromFields(fields: BodyReadField[]): string |
shouldAnalyzeFile | fn | 是否应对该文件跑分析(自动路径,如 LSP validate)。 | shouldAnalyzeFile( filePath: string, source: string | undefined, config?: AnalysisConfig, ): boolean |
sidecarDraftPath | fn | lib.js|ts → lib.nudo.draft.js|ts(不进 ambient sidecar 表) | sidecarDraftPath(filePath: string): string |
sourceHasNudoDirectives | fn | — | hasNudoDirectives(source: string): boolean |
SourceLocation | type | — | SourceLocation = { start: { line: number; column: number }; end: { line: number; column: number }; } |
stablePathKey | const | — | — |
stablePathKeyGraph | const | — | — |
StandardSchemaFunctionSpec | type | 标准面函数级装配描述(入参面 + 返回面)。 | StandardSchemaFunctionSpec = { fn: string; inputs?: ReadonlyArray<{ name: string; abs: Abs; optional?: boolean }>; formals?: ReadonlyArra... |
StandardSchemaInputEntry | type | 标准面入参条目:整参(param)或解构形参的字段(field)。 | StandardSchemaInputEntry = | { kind: "param"; name: string; abs: Abs; optional?: boolean } | { kind: "field"; name: string; abs: Abs; opt... |
StandardSchemaIssue | type | — | StandardSchemaIssue = { message: string; path?: ReadonlyArray<PropertyKey>; } |
StandardSchemaModuleProjection | type | — | StandardSchemaModuleProjection = { source: string; dropped: string[]; } |
StandardSchemaResult | type | — | StandardSchemaResult = | { value: unknown; issues?: undefined } | { issues: ReadonlyArray<StandardSchemaIssue>; value?: undefined } |
stripGeneratedCaseDirectives | fn | 从源码剥离所有本模块生成的 @nudo:case 指令(名字以 call@ 开头,整行删除)。 | stripGeneratedCaseDirectives(source: string) |
Summarized | type | check 报告的最小可并入形状(CheckReport / CheckJson 都满足)。 | Summarized = { issues: CheckIssue[]; ok: boolean; summary: { errors: number; warnings: number; infos: number; functions: number }; } |
SYMBOLIC_BUDGET_NOTE | const | call@symbolic(预算聚合见证)× actionable 提示(精度悬崖 UX):报告里出现 call@symbolic = 该函数的调用点数超过了 callSiteBudget(默认 3, package.json#nudo.analysis.callSiteBudget,1–64),超预算的调用点被折进 一条宽化聚合见证(#widened,可解释降级)。两条恢复路径,与 check 面 nudo:recursion-truncated 的建议句式同构(「事实 — 动作 A or 动作 B」): - 抬预算:package.json#nudo.analysis.callSiteBudget(1–64); - 固化精确见证:@nudo:case(limitations §3.2.2 同款口径——递归函数的 精确见证用指令固化,不要依赖 call@:预算只保住前 N 个调用点)。 | const SYMBOLIC_BUDGET_NOTE |
SymbolInfo | type | — | SymbolInfo = { name: string; kind: "function" | "variable" | "class" | "parameter"; loc: SourceLocation; uri?: string; } |
SymbolTable | type | — | SymbolTable = { definitions: Map<string, SymbolInfo>; references: ReferenceInfo[]; } |
targetPathError | fn | 「分析目标」闸门(与 CLI resolveTargetsCollect 的文件分支同口径): 侧车契约模块(*.nudo.js / *.nudo.draft.*)、类型声明(.d.ts)、 JSX(.jsx / .tsx)不是分析目标——把它们送进分析器会得到 「0 个函数 ⇒ 0 error ⇒ 判绿」的假绿(或把契约 DSL 构造器当成真实 调用点报成 case)。 | targetPathError(path: string): PathError | undefined |
TestReport | type | — | TestReport = { file: string; passed: number; failed: number; unchecked: number; outcomes: CaseTestOutcome[]; caseLines: string[]; } |
TestReportOptions | type | — | TestReportOptions = { entryContractNotes?: ReadonlySet<string>; } |
TextEdit | type | — | TextEdit = { startLine: number; startCol: number; endLine: number; endCol: number; newText: string; } |
topoSortDirty | fn | Topological order with dependencies before dependents (only imports edges internal to dirty; cycles tolerated — remaining files appended in arbitrary order). | topoSortDirty(imports: Map<string, Set<string>>, dirty: string[]): string[] |
trimAnalysisFileCache | fn | 立刻压到当前 maxFiles(调低上限时收内存) | trimAnalysisFileCache(): void |
trimEvalCache | fn | 立刻压到当前 maxEvalRuns(调低上限时收内存) | trimEvalCache(): void |
trimFnAnalysisCache | fn | 立刻压到当前 maxFns(调低上限时收内存) | trimFnAnalysisCache(): void |
tryEvalCall | fn | 求值引擎求值具名导出(仅成功结果) | tryEvalCall( source: string, filePath: string, fnName: string, args: Abs[], opts: { envNames?: string[]; mocks?: Record<string, Abs>; phi?: Phi; loadModule?: LoadModule; depKey?: string | null; keepNeverThrows?: boolean; } = {}, ): Abs | undefined |
tryEvalCallFull | fn | 求值引擎求值具名导出(结果 + throws);opts.collectCalls 时附带调用点记录。 | tryEvalCallFull( source: string, filePath: string, fnName: string, args: Abs[], opts: { collectCalls?: boolean; collectMemberDiags?: boolean; envNames?: string[]; mocks?: Record<string, Abs>; phi?: Phi; thisArg?: Abs; loadModule?: LoadModule; depKey?: string | null; } = {}, ) |
tryRunEval | fn | 模块图 + runTranspiled(默认 analyze 模式) | tryRunEval( source: string, filePath: string, opts: { maxLoopIters?: number; mode?: "exec" | "analyze"; envNames?: string[]; mocks?: Record<string, Abs>; lenientGlobals?: boolean; loadModule?: LoadModule; depKey?: string | null; composed?: ComposedEvalModules; fresh?: boolean; } = {}, ): EvalRunResult | undefined |
TypeBinding | type | — | TypeBinding = { name: string; type: string } |
typeExprToDirective | fn | agent 面类型表达式 → @nudo:as 文法(认不出的表达式落到 unknown) | typeExprToDirective(expr: string): string |
unifiedDiff | fn | — | unifiedDiff(a: string, b: string, path: string): string |
writeContractDraft | fn | 写入 *.nudo.draft.js(覆盖草稿文件本身;不碰正式 *.nudo.js)。 | writeContractDraft( filePath: string, draftSource: string, opts: { dryRun?: boolean; projectDir?: string; entries?: ReadonlyArray<Pick<ContractDraftEntry, "dsl" | "skipped">>; draftable?: boolean; } = {}, ): WriteDraftResult |
WriteDraftResult | type | — | WriteDraftResult = { draftPath: string; written: boolean; changed: boolean; draftable: boolean; draftSource: string; skipped?: "hand-edit... |
writeFileAtomic | fn | tmp + rename 原子写(同目录 temp ⇒ 崩溃/磁盘满时目标要么旧要么新,不会 半截)。随机后缀用 randomBytes(不是 Math.random/Date.now):防可 预测 tmp 路径被预置符号链接劫持。 | writeFileAtomic(path: string, data: string): void |
ZodModuleProjection | type | — | ZodModuleProjection = { source: string; dialect: SchemaDialect; dropped: string[]; } |