Full release history
Generated by
pnpm run docs:genfrompackages/*/CHANGELOG.md— do not edit. Breaking entries carry**BREAKING**and a one-line migration.
Full history (including archived older versions). Current snapshot: Releases.
| Package | Current version |
|---|---|
@nudojs/core | 1.20.1 |
@nudojs/service | 1.12.3 |
nudojs (CLI) | 1.9.3 |
@nudojs/parser | 1.5.11 |
@nudojs/lsp | 1.10.3 |
@nudojs/env | 0.5.11 |
@nudojs/harvester | 0.6.3 |
vite-plugin-nudo | 0.7.4 |
nudo-vscode | 0.3.59 |
Jump to package: @nudojs/core · @nudojs/service · nudojs (CLI) · @nudojs/parser · @nudojs/lsp · @nudojs/env · @nudojs/harvester · vite-plugin-nudo · nudo-vscode
@nudojs/core 1.20.1
1.20.1
Patch Changes
-
795e322: Close the 34 bugs from the ABS-15 audit, grouped by root cause rather than patched one at a time.
check— one judgment per decision, so the faces cannot disagree:- a
.tsconstructor annotation (including parameter properties) is now the instance field's domain, soconstructor(private size: number)+area() { return this.size * this.size }reportsnumberinstead of anany-arithmeticnudo:entry-may-throwerror while the dts face already saidnumber; - definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero,
inon a primitive right-hand side, and calling a member an object literal does not have; - the call-site local binding table records every declaration shape (parameters,
catch,for-of/in,let/var, destructuring) as an explicit "no information" entry, so shadowing no longer reads the module-levelconst(false red) and destructured declarations reach the obligation check (false green); - a classic
for (const i = 0; …; i++)head is aconstagain, so the always-throwing step is reported instead of staying green; nudo:capability-deniedjoins the check-face diagnostic whitelist, sonudo checkcan report the cause ofunknownlikenudo test— gated on the report actually showing an inference failure (nudo:unknown-inference), so a plainmodule.exports = …file does not grow a warning about themoduleglobal while the same exports written asexports.xreport nothing.- cross-file evidence from
--fromnow resolves the default export name on both sides, so a renamed default import,import { default as g }andns.default(...)are no longer silently dropped.
nudo export— the publish gate is a semantic judgment (degraded evidence on the published surface AND a declared contract) instead of a three-code whitelist, with declaration truth taken fromeffectiveContract's own resolution. Contract-face diagnostics always block; general degradation (nudo:internal/nudo:unknown-inference) blocks only when it is attributed to an entry that declared a contract (or carries no function, i.e. is module-level). Compatibility: a module whose contract fails to parse (nudo:contract-syntax) now blocks the export (exit 1, no artifacts, diagnostics surfaced) instead of publishing an "accepts everything" validator with exit 0; unannotated modules — and unannotated sibling entries — keep publishing and only see the degradation surfaced.dts projection — one resolvability predicate for type names (TS tokens, runtime globals, local classes, mirrored
interface/type, imported names) plus the missing branches it exposed:export =for single-value CJS modules, member-wise types forexport default {…}and arrays, real re-export statements for imported bindings,extends/type-parameter clauses on namespace members, and destructured parameters that render as a pattern the source can actually write. Compatibility:<fn>Inputkeys a destructured parameter by its field names rather than the internal_p0placeholder, which is not a public name and made the published validator reject the only legal call shape. Two boundaries are pinned: a module that exports a type (export interface/export type) alongsidemodule.exports = valuekeeps the named-export projection (TS forbidsexport =next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than onereturnprojectsunknowninstead of the first return's type (a single-return pick would be narrower than the runtime value).LSP — completion decides the lexical context with a per-character scanner (line and block comments, quotes, templates with
${}nesting, regex bodies and character classes), so a continuation line inside a multi-line template or comment no longer offers rewrites of the literal; member completion merges the instance/static class member table from core's single class-body scan.The
checkentry census behind these runs on the semantic binding index (ADR 0001 stage 1), and stage 1 slice 4.3 replaces the publish gate's shadow comparison with the semantic verdict it was measuring. The public.export surface is unchanged. - a
-
161d156: Switch the
checkentry census to the semantic binding index by default (ADR 0001 stage 1, slice 3). This closes the audit's false-green export shapes: destructured exports, default object literals, anonymous default classes, CJS / ESM class expressions are now real entries. Two index-precision fixes land with it: getters / setters are no longer treated as callable entries, and nested function declarations are no longer mistaken for module-level entries (previously produced falsenudo:opaque-result). The legacy census remains reachable via an internal fallback switch, and the index-face state is part of the check memo and service file/function cache keys so flipping it cannot replay stale results. The public.export surface is unchanged. Stage 1 slice 4.1 adds an internal, off-by-default publish-gate shadow comparison between the existing diagnostic-code whitelist and the typedEvidenceverdict; it only records divergences and does not change any export decision. Stage 1 slice 4.2 switches only the diagnostic surface:nudo exportnow prints degraded evidence codes (nudo:internal,nudo:unknown-inference, …) instead of silently dropping them; blocking and exit codes still followEXPORT_BLOCKING_CODES, so no export decision changes.
Version history (62)
1.20.0
Minor Changes
-
aff6b7c: Add
number().finite()and sound relation-complement narrowing.number()includesNaNand±Infinity, so a sequential guard such asif (x < 1) return 0; return x + y;cannot assumex >= 1on the fall-through path (NaN < 1is false).number().finite()adds the missing non-NaN evidence; when it (or any numeric bound) is present, the evaluator refines the fall-through / else arm with the complement of the relation guard at runtime ($refineRelComplement, fail-closed without evidence; the arm's Phi and$refineNotNaNalso count as evidence). NaN guards (Number.isNaN(x),x !== x,x === x,!Number.isNaN(x)) establishne(x, NaN)on the arm where that holds;Number.isFinite(x)is one-sided (true arm only). Aconst/let/varalias such asconst ok = Number.isNaN(x); if (!ok) { … }is resolved in the same function body or at module top level (a written alias name or guarded variable, loop-header shadowing/assignment, catch parameters and function boundaries drop the alias). A user-shadowedNumberdisables the builtin guard fact (fail-closed). De Morgan spellings (x < 1 || y < 2) are complemented per disjunct. The previous unproven results for barenumber()are unchanged.Literal
NaN/±Infinityarguments (including0/0,Number.NaN,Number.POSITIVE_INFINITY) now violate afiniteprecondition instead of passing silently;NaNand±Infinityglobals are modeled as literals.兼容性:新增 builder 方法与非 NaN 证据下的精度收紧;未使用
.finite()的 既有契约输出逐字节不变。
Patch Changes
-
c93a32d: Cache directive-scope scanning per AST and version facet keys.
listFnDirectiveScopeswas re-walking the whole AST for every function query (findFnDirectiveScopeis called per function bycheckSource), i.e. O(functions × nodes). A WeakMap keyed by the parsed AST makes it one walk per file:@babel/parser/lib/index.js(0.49 MB) check 13,179ms → 4,675ms (-64%). The AST is immutable during analysis andparseSourcereturns the same object for the same source, so caching cannot change results; a regression test pins the identity.facetKeynow carries av1:prefix (FACET_KEY_VERSION = 1) so future kind/prefix/order semantics changes get a fresh key space; empty facets still encode as"". Facets are also pinned as observation-only (not part ofleqAbs/formatShape) — promoting a slot to value semantics requires the Shape migration gate (gold + real-package zero-FP + differential corpus).兼容性:内部缓存键与性能变化;未使用 facets 的 Abs 键逐字节不变。
-
190761e: Propagate the source filename into parse-mode selection for pure-JS paths.
parseSourcealready skips the strip-types pass for.js/.mjs/.cjs/.jsx(structurally a no-op there), but service / transpile / module-graph / fingerprint / directive-scan call sites omitted the filename, so JS sources were parsed in ts mode and paid two extra full-AST walks. ThreadingfilenamefromanalyzeFile,transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors andlocalNamedExportsdrops a 9.14 MB self-contained JS file from 20,755ms to 14,594ms (-29.7%); the remaining strip-types share in the profile is ~2% (checkSourcepath 1.7%).兼容性:解析模式由文件扩展名决定(缺省仍为 ts 模式,未知扩展名行为不变);
.js里的 TS-only 语法仍是 syntax-error(Bug 114 / Bug 451 口径不变)。
1.19.1
Patch Changes
-
86bc56e: Fix: conjunctive guard facts now accumulate across parameters (issue #185), without weakening the NaN complement red line.
matchRelIdentLitCompositekeeps every guarded name in a relational conjunction (x >= 1 && y >= 2), exposing the non-first names asRelGuard.others;narrowRelArmThunkapplies them all as$refineRelshadow rebindings in the fact arm. Same-name bounds stay inextra(tightest per operator, unchanged).&&short-circuit cons arm (right operand) now receives the left operand's relational guard (relGuardOf(expr.left)) —x >= 1 && (y >= 2 ? x + y : 3)keepsx's bound inside the right side.- New
relGuardOfNegation/narrowRelNegationArmThunk: when the test is!(A ∧ …), the false arm (early-return rest path,ifelse arm, ternary alternate,||right operand) soundly asserts every relational conjunct ofA—!is exact boolean negation, so NaN cannot slip through (!(x < k)false ⟺x < ktrue). Bare relational complements (if (x < k) return …;rest path) remain un-narrowed per Bug 1115. - Result:
x >= 1 && y >= 2 ? x + y : 3,if (x >= 1 && y >= 2) { return x + y } return 3, andif (!(x >= 1 && y >= 2)) return 3; return x + ynow dischargereturn number().ge(3); the sequential guard-clause and De Morgan spellings staynudo:unproven-returnbecausenumber()admits NaN (add6(NaN, 5) = NaN), which is the correct verdict.
1.19.0
Minor Changes
-
09d49af: Feat: architecture debt A6 — fn shapes carry an optional overload set, and calls dispatch by argument shape (closes the Bug 827 / A5 false red).
Shapefn branch gains optionaloverloads?: FnOverload[]({ paramTypes, returnType }[], declaration order = TS resolution order). Absent ⇒ every existing shape, key, and projection is byte-identical.instantiateReturndispatches on overloads: first arm in declaration order whose arity matches and whose params accept the arguments (per-paramleqAbs, α bound/substituted per arm) supplies the return face; zero hits fall back to the union return face (no invented may-throw). Union face (paramTypes/returnType) stays the authoritative extensional face —leqAbs,formatShape, dts/schema/guard read only it; overloads are a dispatch refinement, not assignability.- Harvester: top-level function overloads and interface/class method overloads both snapshot arms before the union-face merge (shared
collectOverloadArms; Bug 807 two-path parity preserved).HarvestSiggainsoverloadsso disk-cache round-trips keep the dispatch face;HARVEST_DISK_ABIv13 → v14 (old entries miss cleanly instead of silently losing overloads). absKeyincludes overloads (distinct overload sets no longer share memo/fingerprint);substShapesubstitutes arm Abs data;snapshotAbsdeep-copies overloads and now carries the fn impl side table (A7 mirror — snapshots no longer degrade to shape-only).- Evidence: types-only package with
convert(x: string): string; convert(x: number): number;—nudo checkgoes from 2 L2entry-may-throwfalse reds (method 'toFixed' missing on string receiver/ symmetric) to OK, matchingtsc --strictexit 0;useNum() => string/useStr() => stringexact. Gold/recall/real-package gates 223 green; harvest + emit + differential 1434 green.
-
e1e6892: ABS-01: constraint / lemma grammar — arithmetic relations, dependent return contracts, and contract-internal binders.
@nudo:assumeand@nudo:invariantaccept simple arithmetic expressions (name,number,name ± number):@nudo:assume i + 1 <= n,@nudo:invariant i < n. Multiplication / division / parentheses stay malformed with the existing fail-closed diagnostics.@nudo:contract return <rel> <expr>builds a dependent return obligation on the return term (return > x). IEEE-sound proof rule added for non-strict offset comparisons (round(b + c) >= b,c >= 0); strict>/<on unbounded operands report an honest unprovable warning (2^53 + 1 = 2^53 is a real counterexample), never a false red.- Contract-internal binders:
bind(name, constraint),ref(name),ref(name).at(path)with scope = one constraint tree.EffectiveContractcarries a cross-slot binder table sofn({...}, array(ref("b")))can reference a binder declared in a callback slot. Unbound refs fail closed (nudo:contract-load) and never degrade toany(). - Refs are resolved before proofs / instantiation / entry-Abs projection, so a ref slot cannot pass as an obligation-free
any(). - Public surface additive:
bind/ref/relbuilders plusBinderTableand resolver helpers (public API snapshot updated).
-
ca8005b: ABS-02: explain where
unknown/anycame from (observation-only side channel).- New
buildUnknownExplanations/formatUnknownExplanations(core) derive a stable, deduped reason list from existing observation faces (signatures, issues, budget, eval fallbacks) — no Abs field, no cache-key orleqAbschange; cold/warm results are untouched by construction. - Reasons:
budget/missing-env/unsupported/eval-failure/no-contract/explicit-any/inference-failure, each with an actionable suggestion. Cycle truncation says explicitly that@nudo:budgetcannot help. nudo check --explain-unknownprints the list after the human report; default output is byte-identical and--json/--gitlabmachine contracts are unaffected.
- New
-
869f22d: ABS-07: sound implication upgrades — order closure, square lower bounds, DNF, oracle caching.
- Order closure (the provable difference fragment): pure order facts between single atoms (
x <= y/x < y, no arithmetic shift, no rounding) are stored as a graph and closed with a BFS that tracks strictness. Transitive goals (x<=y ∧ y<=z ⇒ x<=z), strict chains, and dual directions now prove; unsound directions stay unproven. - Simple non-linearity:
A*A >= cproves whenAhas non-NaN evidence (c <= 0), or a non-strict lower boundL >= 0withfl(L*L) >= c(monotone rounding). Strict targets stay unproven —x > 0 ⇒ x*x > 0is false atx = 5e-324(underflow). - DNF rewrite for conjunctions with nested disjunctions (
A ∧ (B ∨ C)) is an equivalence-preserving expansion (cap 32) — only fewer misses, no new proofs of invalid goals. - IEEE counterexamples are pinned as must-stay-unproven:
x <= y ⊬ x-y <= 0(Inf - Inf = NaN) andx >= y+1 ⊬ x-y >= 1(2^53 + 1 = 2^53). - Optional implication oracle: answers are cached per oracle identity and
(phi, pred)(512 entries, deterministic-oracle contract). Default remains fail-closed with no oracle. - Gold suites (recall = precision, real-package zero-FP) stay green.
- Order closure (the provable difference fragment): pure order facts between single atoms (
-
09f5ff8: ABS-08: automatic loop-invariant candidates (phase 1 — observation only).
- The loop widener records numeric bounds of scalar loop-carried bindings across observed iteration snapshots. When widening actually happens, these become candidates surfaced as
nudo:invariant-inferredinfo diagnostics with the observed bound and sample count. - Candidates never participate in proofs: an observed extreme over a bounded number of iterations is one-sided evidence, not a proved invariant. Only an explicit
@nudo:invariantdeclaration enters the proof (audited vianudo:invariant-relied) — so inference cannot introduce false greens. - User declarations override candidates for the same binding (no duplicate hints).
- Bounded loops that never widen produce no candidates (no noise).
- Diagnostics docs updated (EN + zh).
- The loop widener records numeric bounds of scalar loop-carried bindings across observed iteration snapshots. When widening actually happens, these become candidates surfaced as
-
df56e83: ABS-09: coinductive
leqAbsfor recursive types.leqAbsnow keeps a path-scoped(src, tgt)assumption set: a pair already being checked is assumed to hold, which is the maximal-fixpoint semantics of equirecursive subtyping. Recursive lists/trees, mutually recursive shapes, and recursive brands no longer fail withleq depth exceeded.- Assumptions are removed on exit (including failed branches), so a failure in one branch can never be rewritten as success on retry (no false greens).
- Genuine mismatches still report the shortest field path (
field value: ...), not a depth failure. - The depth guard stays as a bounded safety net for non-recursive deep structures (raised 32 → 64, since real recursion now terminates coinductively).
- New fixtures: isomorphic-but-distinct recursive lists, value-domain mismatch, mutual A/B recursion, recursive brand inner, and the deep-nesting safety net.
-
af8173b: ABS-10: cross-instance post-summaries for function instantiation (conservative phase).
- New summary layer (
key/fn-summary.ts): the postAbsof a body evaluation plus its α variable order, keyed by function identity (source hash + name + deps fingerprint + sidecar fingerprint) × instance key (α-normalized args + Φ, including the conf digest). - A new
PolyFninstance (same function/context, e.g. re-generalized with a different display label) can hit the summary instead of re-running the body; results are α-renamed back to the caller's names and are byte-identical to the body path. The instance-level memo stays the first layer. - Only pure contexts participate:
refine/inject/ custom budgets (unhashable closures that change body semantics) bypass the store entirely; seeded analysis windows neither read nor write it. resetGeneralizeMemo()clears the summary layer too (explicit invalidation hook; no cross-round object reuse).- Bounded at 4096 entries (oldest evicted); stats exposed on the internal module for observability.
- New summary layer (
-
61c22d5: ABS-11: contract conjunction and projection precision.
and()(andC) now conjoins structural forms: shape ∧ shape (field-level, missing fields preserved, same-field constraints recursively conjoined), array ∧ array (element-level; node preds such as length bounds kept), union ∧ union (member cross-product, capped at 16), and fn ∧ fn (per-parameter and return conjunction; throws merged as a union). Contradictory forms stay fail-closed: prim mismatch, structural × incompatible prim, different structural kinds, and binder/ref/rel conjunction conflicts throw the same conflict path as before.formatConstraintrenders structural nodes' own predicates and optional flags (array(number()).min(2),shape(...).optional()), so length obligations are no longer invisible in diagnostics/derivation output.- dts projection treats contract and derived HOF relations as a conjunction: when a hand-written contract covers some parameters, HOF α variables are structurally unified with the contract Abs (elements / tuple slots / object slots / fn params+returns) and uncovered parameters plus the return position keep their β links instead of degrading to
unknown(e.g.processItems<B_transform>(items: number[], transform: (x0: number) => B_transform): B_transform[]). - Discriminant exhaustiveness warnings are intentionally deferred: the plan requires zero false positives, and no low-noise heuristic is available in this batch (documented in the test header).
-
c8aac63: ABS-14: bounded function-level summaries (5 commits on branch
abs-14, soundness gate revised 2026-11-13).- Single summary cache:
key/fn-summary.tsnow carries optionalformals/argKeys/bounds/pre/effand a per-function entry (fn\0<scope>) on the SAME Map;fnSummaryStats()keeps its instance-level meaning, function-level hits/rejections are exposed byfnSummaryFnLevelStats()(hits= entry found,applied= actually substituted). - Simple bounds with one-way alpha dependency (
key/summary-bounds.ts): reverse deps, unbound vars and complex app terms fail closed;TypeParam.boundsis additive and write-only in this phase (no product consumer yet). - Fast path (
key/summary-fastpath.ts): a hit requires all of- positional formals (
formals[j]= the top-level var of the j-th argument; non-var or aliased arguments fail closed) — storing the sortedvarOrderused to transpose arguments (f(z,y)→f(p,q)returnedq - p); - arg isomorphism: per-position α-normalized
absKeyWithConfkeys (shape × term × pred × conf) — a kind-only signature used to reuse{x:1}summaries for{y:"s"}, length-2 summaries for length-3 tuples, andDatesummaries forRegExp; - full precondition: the formation-time Φ (
pre, renamed formals → current argument vars) must be implied by the current Φ — checking only the simpleboundsprojection droppedapp-term conjuncts, sox % 2 === 0-formed summaries leaked to unconstrained calls. ThensubstAbs(post, map)is applied instead of re-running the body.boundsstays as observable metadata only.
- positional formals (
- All three conservative channels are on by default (
crossModule,bodyUnavailable,budgetTruncated); the degraded channels are verified independently (abs14-degraded-channels.test.ts), gated offsymbolicruns on the read side as well, and their substituted results stay in the instance memo only (cross-instance summaries keep "came from a real body evaluation" provenance). - Equivalence gate:
abs14-equivalence-baseline.test.ts(7 pinned body-path samples) plusabs14-fastpath.test.tscallingdiffAgainstBodyBaseline. The fast side now clears the cache stack, uses a fresh PolyFn and a witness Φ (ABS14_GATE_PHI), so layers 1/2 must miss and the test assertsappliedgrew — the earlier version re-read the same memo entry and never exercised the function-level path. - dts projection: HOF signatures no longer emit type parameters that are not referenced by any parameter or return position (
abs14-dts-reachable.test.ts).
- Single summary cache:
-
897b19f: > 版本定性(2026-11-05 产品裁决):本批不判定为 breaking 变更 ⇒
changeset 不写 BREAKING / Migration 标注;下方「兼容性」段落只是升级时的 注意点,不是迁移要求。发布级别仍按此前决定走 minor(additive 能力 + 暂无外部用户),不占 major、不触发
scripts/gate-major.mjs。Abs现在携带可选facets槽位容器(callable/protoOwnKeys/brand),三个槽位均已在引擎内启用。缺省不出现 ⇒ 旧Abs的键、投影与leqAbs接受集逐字节不变;但带上槽位的值在以下面给出比以前更精确的判定:callable:类值裸调用判据不再只靠class-mark.ts的 WeakMap 与_rest形参启发式 ⇒ 快照 /substAbs/ 重铸后的类值仍定抛TypeError。该槽位表达「无new的 [[Call]] 定抛」,不是规范IsCallable。protoOwnKeys:原型对象的自有键集随值携带(Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols),不再只能按 brand 名查固定表。brand:生成器对象身份随值携带,dts 的iteratorTSType不再只靠next/@@iterator槽启发式 ⇒ 丢了内部协议槽的重建产物仍投影Generator<T>(泛型实参照旧推导,不输出裸名以免 TS2314)。
兼容性:直接构造
Abs字面量 / 只读取既有字段的代码无需改动 ——facets缺省即旧行为。用Object.keys(abs)、结构化克隆或自有实现的序列化器枚举Abs全部字段的内部代码,需容忍新增的可选facets(不读它即与旧行为一致)。absKey只对非空容器进键 ⇒ 带槽位的值会自然得到不同的 memo / 指纹,无需手工清缓存。coreformatShape的展示面不发布生成器身份(既有契约,逐字不变)。残余批次(同批发布):
- A2 声明/收割面:
declare class类值挂callable:false;JSON.stringify(obj, 类构造器)由may-throw升为确定抛 TypeError。HarvestSig.fn新增callable字段、HARVEST_DISK_ABIv14 → v15(~/.cache/nudo/deps/旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs的absFunctionmock 重建也整包搬运槽位。 - A10 内建原型:
Array/Object/Map/Set/Promise/String/Number/Date/RegExp等的Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols由保守string[]/boolean/symbol[]升为与宿主动态对拍的精确面(键集随 Node 版本给出各自真实值,不写死清单)。 - A10 用户类原型交错定义序:
EvalClassSpec新增可选protoMemberOrder(transpile/class-emit.ts按类体源码序登记、declare.ts::rekey同步换名)。Object.getOwnPropertyNames(用户类.prototype)对「方法与访问器交错定义」的类由保守string[]升为与宿主对拍的精确有序表;静态 / 私有成员不列入。手写 spec / mock 桥 / 旧产物无该字段 ⇒ 回落旧保守域(零回归兜底)。 - A11 TReturn / TNext:
AbsFacets新增可选genReturn/genNext,dts 输出Generator<T, TReturn>/AsyncGenerator<T, TReturn>(恒带类型实参,无 TS2314)。本轮进一步接通 TNext 保守域:makeGenObject填unknown(引擎不建模.next(v)入参 ⇒ 与 TS 该类型形参默认值等价,不是精度承诺),iteratorTSType仅当facets.genNext存在才输出第 3 实参 ⇒Generator<T, TReturn, unknown>;三实参仍恒带<…>,无 TS2314。手工构造 / 无genReturn的旧 Abs 输出逐字不变;填真实 v 域依赖 A1 步骤 4 真挂起(明确停点)。 - A1 步骤 2 骨架(零语义):
exec/match-iter.ts把 7 个元素面读出函数收口到模块私有的幂等触发器表,生产侧不登记 ⇒ eager 时序与全部值面逐字不变;不进任何 barrel,公共 API 冻结不变。为后续「首消费点触发」预置接线,不改变任何对外行为。 - schema / standard / guard 生成器身份投影:已实施,另立 patch changeset(
.changeset/generator-identity-validator-fix.md)。产品裁决「收紧是 bug、不判定为 breaking 变更」⇒ 三面按facets.brand统一收紧;emit-bug-130的无 brand 夹具仍逐字不变(负控制)。z.instanceof路径经运行时实证仍不可行。实施记录见docs/design/architecture-debt.md,生产接线回归见emit-generator-identity-poc.test.ts。
兼容性(补充):① 自行解析磁盘收割 JSON 或依赖
HARVEST_DISK_ABI的下游需接受HarvestSig.fn.callable新字段(旧缓存按 v15 自动失效);② 枚举Abs.facets全部字段的代码需容忍新增的genReturn/genNext(不读即旧行为);③ 曾断言内建原型gOPN为string[]/hasOwn为boolean的内部测试需改为与宿主对拍的精确断言;④ 解析生成器 dts 类型实参的下游需容忍三实参Generator<T, TReturn, unknown>(无genNext的旧手工 Abs 仍两实参 / 一实参,逐字不变);⑤ 自行构造EvalClassSpec的下游可忽略新增的可选protoMemberOrder(缺省即旧两表拼接口径),但曾断言交错类gOPN为string[]的内部测试需改为精确有序断言。Evidence: 三槽各独立全仓回归 0 新增失败;最终 2159 文件 / 17191 用例 0 新增失败;金标 1.0/1.0、真包 0 FP、差分语料 0 回退、公共 API 冻结未变。发布级别按 2026-11-05 产品裁决:整批不判定为 breaking 变更 ⇒ 不写 BREAKING / Migration 标注,仍以 minor 发布(
scripts/gate-major.mjs不触发);一旦有外部用户依赖这些包面,即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」。 -
4fc7e19: Rename the remaining Nudo
interfaceterminology tocontractend to end.- Core:
effectiveInterface→effectiveContract,InterfaceSource→ContractSource,InterfaceTierInfo→ContractTierInfo,interfaceTierOf→contractTierOf,takeInterfaceDiags*→takeContractDiags*, and thealgebra/interface/directory →algebra/contract/. - Service:
emitInterface/draftInterface/interfaceSurface→emitContract/draftContract/contractSurface;interface-*.tsfiles →contract-*.ts;ifaceCacheKey→contractCacheKeyand the disk-cache namespaceiface→contract. - Diagnostics:
nudo:interface-*→nudo:contract-*(no alias layer). - CLI/LSP: CodeLens titles
⚡ persist contract/↻ update contract/⚡ draft contract; agent messagesno contract found/no contract changes;CheckIssueactions and hover/inlay fields usecontractSource/contractDisplay/contractActive. - Docs, examples (
contract-derivation/,contract-draft/), API snapshots, and website references updated.
TypeScript's
interfacekeyword, Babel ASTTSInterface*, and historical release notes are intentionally unchanged. - Core:
-
533c8c6: A1 步骤 3 落地:生成器体从构造期挪到首个消费点(
docs/design/generator-laziness.md§5.3)。此前$gen在构造期一次性跑完整个体收集 yield 序列;现在构造期只产一个空壳并登记一次「待跑体」触发器,next()/.return()/.throw()与 7 个元素面读出任一先触达才跑体,把完整结果 in-place 合并回壳。- 值面收益:body thunk 捕获活绑定(实验 D)⇒ 跨函数消费读到消费时刻的外层绑定,与原生一致(
yield n在n = 9后消费得9,此前给0)。构造点 c1/c2 从步骤 1 的0 | 1/"" | "ab"过近似收敛为精确的0/"";容器 mutator 的长度域过近似也收敛为精确0。 - 副作用只跑一次:触发按 Abs 身份幂等 + 同一延迟体族的
ensureFresh缓存 ⇒ 绕开实验 E 的「重跑重复副作用」;n++在构造 + 多次消费后仍只加一次。 - 两条不变量保障:① core 求值入口
callTranspiledExportFull在收口时排空未触发的壳 ⇒ 「构造后从不消费」的既有 eager 值面契约(Bug 212 / 族 01 数字下标)与 service 侧.d.ts纯投影的元素域都不退化(端到端Generator<number | string>等与改前逐字一致);② 触发器按族广播到snapshotAbs/$copy的所有别名,副本先消费时原对象与副本的元素面 /genElements都完整。 - 改动面:
runtime/async.ts(collectGenBody抽出 + 空壳$gen+mergeDeferredBody+ 协议三方法首调转发)、exec/match-iter.ts(触发器带目标身份、别名广播、pending 排空)、exec/run.ts(求值收口排空)。公共导出形状未变,registerGenTrigger/fireGenTrigger/drainPendingGens均不进任何 barrel。 - 已知边界:步骤 4「真挂起」未做 ⇒ 首 yield 之后的写仍在首次消费时一次跑到底(§5.5 的 c3/c4 不逐点精确);
eval-generator-cross-function-consume.test.ts保留 1 条it.todo作验收清单。
回归:新增
exec/__tests__/gen-deferred-body.test.ts(5 例,直接钉构造期零体求值 / 只跑一次 / 幂等 / 别名广播 / async 同编);eval-generator-cross-function-consume.test.ts由「现状钉 + 3 todo」升级为 4 例 R3-b 验收;Bug 212 的 5 条精确断言与步骤 2 骨架的 2 条负控制按新语义重订(全部为精度提升或契约前提变更,无精度回退)。全仓结果见当日工作日志。按整批裁决发 minor,不写 BREAKING / Migration 标注。 - 值面收益:body thunk 捕获活绑定(实验 D)⇒ 跨函数消费读到消费时刻的外层绑定,与原生一致(
-
951b256: 静态元素域通道(「第三种」):把生成器的元素域从「隐式编码在
shape数字下标槽、dts 靠CANONICAL_INDEX正则反推」升级为随Abs值携带的 显式承载位,并把源码返回类型注解从「可覆盖观测」降级为一致性校验。core
AbsFacets.genElements?: Abs[]:makeGenObject填$gen的完整 yield 序列(full,不是$arr之后可能 widen 的els;Bug 53 点名前者才是 权威数据)。shape数字槽并存不替换,消费点 / 族 01 口径不变。cloneAbsFacets拷贝数组(Abs 元素按引用共享)⇒snapshotAbs/substAbs/renameAbs/join四处经统一 clone 自动搬运,副本不串台。facetKey新增ge:段(逐项absKey)⇒ 元素域不同的生成器不共享 memo / 指纹;无genElements的旧键逐字节不变。
service
iteratorTSType优先读genElements,严格 fallback:字段为undefined(手工构造 / 静态收割 / 旧 Abs)时仍扫数字槽 ⇒ 旧产物逐字不变。 端到端实测 fork 分支if (f) yield 1; else yield "s"从Generator<unknown>恢复为Generator<number | string>;只有genElements、无数字槽的手工 Abs 也能投影出精确元素类型。FunctionAnalysis.declaredReturnType透传nudoReturnTypeText(此前全仓 只有写入、无读取点);新增nudo:return-annotation-mismatch台账: 声明与观测同为单一基类型且互斥时留痕,产物恒用观测口径(不覆盖、 不用声明兜底)⇒ 不重演 BUG-168 在形参位修掉的「两面相反裁决」。 联合 / 泛型 / 字面量 /unknown一律不判,避免 widen 口径差异被误报。
兼容性:
genElements是可缺省槽位;静态声明收割(harvest)不构造生成器 运行时值 ⇒ 不进HARVEST_DISK_ABI,冷 / 热产物一致。公共导出符号名不变 ⇒ 公共 API 冻结不受影响。已知边界:不解锁 A1 步骤 3 ——
genElements仍由构造期跑体填充, 体延后到首消费点 ⇒ 字段也空,而 dts 是纯投影、导出期无消费点。本变更 只预置了承载位与「未填充」语义;步骤 3 仍需静态 yield 域推断通道或产品 接受Generator<unknown>降级。详见docs/design/generator-laziness.md「dts 元素域通道 · 第三种已落地」。版本定性:新增诊断码 + additive API ⇒ minor;按整批裁决不判定 breaking,无 BREAKING / Migration 标注。
回归:
gen-elements-facet.test.ts(7 例)/emit-gen-elements-facet.test.ts(9 例);全仓1658 入口,20 失败 = 基线 20,0 新增 / 0 消失。 -
0331e00: A1 步骤 4 落地:生成器挂起点绑定回放(Bug 212 c3/c4 逐点精确)(
docs/design/generator-laziness.md文末「步骤 4 实施记录」)。步骤 3 把体延到首个消费点后,体仍一次跑到底 ⇒ 首个yield之后的写会在首次next()时提前落地(native1/"a",引擎0 | 5/"" | "ab")。本步把 native 的挂起点语义在外层自由写绑定的值面精确复现。- 机制:四个
$gen发射点在自由写名集非空时追加可选第三实参{ capture, restore };capture用$copy+ 共享 memo 读快照(容器深拷贝、const 别名组身份不分裂),restore用$rebindable守卫写回。$yield/$yieldStar在每个挂起点把快照推进帧的timeline;next()交付第 k 个 yield 后回放到timeline[k-1];next()耗尽与迭代 drain 推进到终态格(体跑完、步骤 1 的 join 已折回)⇒ 最后一个 yield 之后的写不被抹成 wrong-exact。回放单调(lastApplied)⇒ 耗尽后的next()不回卷。collectGenBody每次调用都压帧(无钩子时压undefined哨兵)⇒ 嵌在外层体里的内层生成器不会污染外层时间轴。名集为空时零发射 ⇒ 绝大多数生成器的转译产物逐字不变。 - 值面收益:c3
1 #exact、c4"a" #exact;连续两次next()得5/"ab";分段读取"1:1:2:5";与步骤 3 的消费期活绑定叠加得"9:9:5";迭代整体 drain 得"5:2"。§1.6 四行 native 值全部精确。 - sound 守卫:路径敏感(fork 臂序列是 join 而非线性时间轴)、体内延迟异常、
yield*委托三类形态整帧禁用回退,严格保留步骤 1 的join(事前, 事后)过近似;未启动生成器上的.return()/.throw()不推进时间轴(原生体根本不跑,推进会产 wrong-exact)。三类实测均0 | 5 #exact,无「自信的错值」。 - 不变量:体仍只跑一次、只捕获一次序列(步骤 3 的幂等 + 缓存不动);元素面 /
genElements/.d.ts投影与改前一致;$gen只新增可选形参,公共导出形状未变,无新增导出符号。
已知边界(诚实台账):这是绑定值面的挂起点精确化,不是把体降成真 JS generator。转译产物的分支/循环臂是宿主箭头(真
yield进去即 SyntaxError),抽象 fork 一次跑完双臂又无法只挂一臂 ⇒ 字面方案要求$fork/$whileSeq/$for/$switch/$try*全改 generator 变体并跨next()续接 ALS 帧,属求值模型 CPS 级改造。故宿主调用、may-throw 收集、容器外部引用等非自由写绑定类副作用的时序仍整体落在首次消费点。求值隔离按约定搁置。回归:新增
exec/__tests__/gen-suspend-replay.test.ts(8 例机制钉,含嵌套帧隔离与终态格);eval-bug-212-generator-body-eager.test.tsc3/c4 断言重订 + 2 例推进用例(14 例全绿);eval-generator-cross-function-consume.test.ts的步骤 4it.todo升级为 5 例验收(9 例全绿)。按整批裁决发 minor,不写 BREAKING / Migration 标注。 - 机制:四个
Patch Changes
-
9a087f9: Fix: architecture debt A1 (Bug 212, step 1) — generator bodies no longer write outer bindings to values that hold at no native observation point.
- Transpile-side free-write isolation around the
$genbody (all four emission sites: declaration, function expression, object method, class method): snapshot the outer free-written bindings ($copywith a shared identity memo) before the eagerly-collected body, fold backn = $join(before, after)in afinally(body throws fold too). ReusescollectFreeAssignedNames(same analysis as the fork protocol, minus param pattern names and bodyvarhoist names — those are generator-local) plusexpandAliasNames(const alias partners snapshot together).$copy/$joinare existing runtime exports — no public-surface change. - Symptom rows go from wrong-exact to sound over-approximation: construction-point
n1→0 | 1,log"ab"→"" | "ab"(native construction values0/""are in the join); same for theit.next()observations (5→0 | 5,"ab"→"" | "ab"). Residual (needs true suspension, doc §5.4): the first-yield suspension-point intermediates (native1/"a") are still not in the join — the Abs domain has no timeline axis. - Load-bearing eager collection untouched: element face and
confstill baked at construction (generator object pins{ "0": 1, "1": 5 } #exactunchanged) —Generator<any | number>signature face does not degrade. Generators that write no outer bindings transpile byte-identical; body-localvar/let/params never enter the snapshot set (no TDZ). - One pinned expectation updated:
exec-generator-consumption.test.tsnested-generator Bug 52 case — theleakcarrier is now the sound joinundefined | 77(native:undefinedat construction,77after drain) instead of exact77; the semantic point (inner bare.return(77)not polluted by the outer try context, no"f"leak) is preserved and re-pinned. - New regression nails in
eval-bug-212-generator-body-eager.test.ts: the four symptom rows as exactformatAbspins, all four emission sites, element-face preservation, and negative controls (protocol/yield sequence, destructuring lowering, no-outer-write, body-local var/param).
- Transpile-side free-write isolation around the
-
c6cf8fa: Fix:
substAbsno longer drops the fn impl side-table when rebuilding a fn shape (architecture debt A7, engine half of Bug 810).- α instantiation (interface type-argument substitution in the harvester, and
instantiateReturn's return-type instantiation in the engine) rebuilt fn shapes without carrying theattachFnImplside-table, silently degrading every substituted fn to a shape-only relation: the D path lost impl-exclusive data (relation.inferFrom/condFallback/throws/fingerprint), so generic method calls folded toany/unknownwhere the un-substituted signature was precise. - Carrying discipline (
substFnImplinhof.ts): behavior facets (apply/body/ closure env) and scalar facets (params/kind/fnKind/length/optionalParams/bindThis/strict/effectFree/closed/pureName/fingerprint) are α-independent and carried verbatim (fingerprintsharing matches the documented same-signature budget-key semantics); therelationslot is Abs data and is substituted by the map, sharing references with the substituted shape slots (therelationFndouble-write discipline). - The whole-α replacement path (map value is itself an impl-carrying fn) also keeps the impl instead of degrading to shape-only.
- The fn shape rebuild no longer drops
optionalParams(Bug 399 per-position optionality) andslots(dual-facet callable-with-members), matching thesnapshotAbsfn-branch discipline; slot values are substituted by the map.
- α instantiation (interface type-argument substitution in the harvester, and
-
fb54d1a: ABS-05:
confand cache-key audit — instantiate memo no longer shares results across confidence levels.- Added
absKeyWithConf(internal): the defaultabsKeyplus a recursiveconfdigest over the same traversal order. The defaultabsKeystays conf-free (structural equality / join dedupe / env dedupe depend on that and are byte-identical). - Audited key faces and documented them in
abs05-conf-key-audit.test.ts:absKey,relationFingerprint,checkMemoKey,pureValueKey,analysisFileCacheKeydo not depend onconf;instantiateMemoKeydoes. - Fixed the consumer instead of widening the default key:
instantiateMemoKeynow includes the conf digest, so an identity function instantiated with a#widenedargument returns#widenedinstead of inheriting a cached#exactresult. Same-conf calls still share (memo hit by object identity). - Cold/warm equivalence pinned: a repeated
checkSourcerun produces byte-identicalCheckJson.
- Added
-
9886482: Fix ABS-14's
TypeParam.boundsalways being empty.entryReqs[].predcomes frominstantiateConstraint(c, paramName)and therefore uses argument names (typeof x = number,x > 0), while the bound registration validated it againstTypeParam.id/ formals in alpha space (A1,A2). Every variable was rejected as unbound, soboundswas never written.key/summary-bounds.tsgainsalignSimpleBounds: renameparams[i] -> ids[i]viarenamePred, then apply the existingcollectSimpleBoundssimple-condition / one-way-dependency checks. Unmapped names (binders, undeclared vars) andappterms stay fail-closed and are dropped.generalize.tsnow registers bounds through that helper.entryReqsand Phi keep their original argument-name space (display and body monotonicity propagation depend on it), sodisplay,symbolic,checkandexportoutput are byte-identical.- With
fn({ x: number().gt(0) }),typeParams[0].boundsgoes fromundefinedto[typeof A1 = number, A1 > 0]; with two parameters the bounds land onA1andA2respectively. - Covered by
abs14-bounds-integration.test.ts(11 cases: end-to-end generalize, pure-function negative cases, and proof that the bounds are well-formed α-spacePreds thatimpliescan decide directly and that behave correctly when used as a summary entry'spre). Reverting the rename makes 8 cases fail.
TypeParam.boundsis write-only in this phase — no product consumer reads it. The fast path is gated on the full formation-time Φ recorded in the summary entry, not on these bounds; the fixture above only proves the metadata is well-formed and directly consumable by a future consumer. Design boundary, intentionally not changed:opts.refinestill disablessummaryScope(ABS-10), so contract-bearing functions do not write function-level summaries.attachHofSnapshotnot passingrefineis correct design, not a defect. -
3ddcb81: ABS-14 follow-ups (rest-param soundness, degraded channels, dts bounds).
- Soundness fix (core): rest parameters were emitted as
const name = $restBind(...), but fork-arm restoration and member-write lowering rebind that slot (name = ...). Real CJS code such asdebug/src/common.js'sfunction debug(...args) { args[0] = ... }therefore threw V8's nativeTypeError: Assignment to constant variableduring module evaluation, makingnudo checkfail closed withnudo:module-throw. Both emit sites now uselet(native rest bindings are mutable). Regressed byeval-rest-param-rebind.test.ts; reverting toconstmakes all 9 cases fail. - ABS-14 degraded channels enabled:
bodyUnavailableandbudgetTruncatednow default on alongsidecrossModule. The replacement logic is extracted tokey/summary-fastpath.ts#tryDegradedChanneland verified independently byabs14-degraded-channels.test.ts(10 cases): the filled result is byte-identical to the same function's real body result, and no summary / non-isomorphic args / unproven full precondition / formal mismatch / unmapped variable staysunknown #opaque. The read side is gated offsymbolicruns (same as the write side and the cross-module channel, so a priorinstantiatecan never rewrite a signature/dts input), and substituted results stay in the instance memo — cross-instance summaries only ever hold results of a real body evaluation. The equivalence gate is refined accordingly:crossModule≡ current body path, degraded channels ≡ the same function with an available body. - dts bounds (
extends) (service):emit/dts-generator.tsnow translates expressible contractPredleaves into type-parameter constraints — primitivetypeoftags,eq(var, lit)literals, and fully-expressibleorunions. Numeric bounds, lengths, negations andtypeof object|functionare honestly omitted; unbound declarations stay byte-identical. Projection readscontract.params[].abs.preddirectly, soAnalysisResultand its cache cloning are untouched. Covered byabs14-dts-extends.test.tsincluding atsc --noEmitround-trip. - Host-drift test baselines: Node 22 vs v26 globals (
Float16Array,Intl.DurationFormat,URLPattern,CloseEvent, …) and toolchain-injected__*_SHIM_LOADED__names are now handled through the existingVERSION_SKEW/ declared-reason discipline rather than hard assertions; supported hosts keep full coverage.fs.promises.stat(throwIfNoEntry:false)oracle tolerates the Node 22 ENOENT behaviour while engine-side assertions stay strict. - Example docs:
docs/examples/retire-debugnow states that the return face depends on whether the realdebugpackage resolves;verify:examplespins onlyOK/0 error/ export names, notnudo:opaque-result.
The
TypeParam.boundsempty-field debt noted in this changeset was fixed in a follow-up commit (Pred variable-space alignment viaalignSimpleBounds+abs14-bounds-integration.test.ts);attachHofSnapshotnot passingrefinewas re-checked and confirmed to be correct design, not a defect. - Soundness fix (core): rest parameters were emitted as
-
53d8248: Fix async-generator replay rejection. When a replayed
finallythrows during.return()/.throw()on an async generator, the runtime now returns the rejected promise directly instead of wrapping it again indeliver, so awaiting the call rejects like native. Fixture:async function* g() { try { yield 1 } finally { null.x } }+await it.return(0)now yieldspromise<"rejected">instead ofpromise<"resolved">. Side-effect finalizers keep resolving (promise<true>), pinned byabs13-abrupt-completion.test.ts(13 cases). -
792eb79: Fix: engine module loads in browsers without
SharedArrayBuffer(Playground crash).- Two module-level tables referenced the bare global identifier
SharedArrayBufferat evaluation:NAMESPACE_ONLY_HOST_CTORS(exec/runtime/members.ts) andNAMESPACE_GLOBALS(exec/runtime/containers/member.ts). In non-crossOriginIsolated contexts Chrome does not expose it ⇒ReferenceError: SharedArrayBuffer is not definedat import time ⇒ the whole engine bundle failed to load and the Playground error boundary rendered “This page crashed”. - Fix: both tables now use the existing
Float16Arrayguard pattern (typeof SharedArrayBuffer !== "undefined"⇒ entry included, otherwise omitted; lookups stay fail-closed for that name). Verified in headless Chromium against a production build served without COOP/COEP headers:/playground/loads, presets run with precise cases, share links and the tsc panel work (worker chunks emitted via relative-path entries); with isolation headers behavior is unchanged.
- Two module-level tables referenced the bare global identifier
-
949ddce: Restore call-site scan cost: one dependency fingerprint per scan instead of one per call site.
scanLiteralCallsaskedgeneralizeFromAstfor the same function once per literal call site, and each call recomputedrefineDepsFingerprint(a disk BFS overloadModuledeps + full-AST spec walk + per-dep hash) to build the L0 memo key. On real packages that is ~100 full BFS passes for a single 87 KB file —commandercheckSourceregressed 601ms → 2475ms since the call-site enforcement batch, which is what kept the OSS baseline gate red (commander: check all3.0–3.8x the envelope). The same-file(source, loadModule, fromFile)triple is constant within one scan, so the fingerprint is now computed lazily once and passed asdepsFpto the own-call and inline same-filegeneralizeFromAstsites; cross-file callees keep computing their own (their refine basis is the definition file). Memo keys are unchanged — same function, same arguments, only the redundant recomputation is gone.commandercheckSourcereturns to 678–881ms (baseline 601ms) and the OSScheck alltotal ratio drops from 1.73x to 1.00x of the envelope.Also classify Node 24's legacy
_stream_*internals (_stream_duplex/passthrough/readable/transform/wrap/writable) as denied node builtins: they are inmodule.builtinModuleson the CI runtime but were absent from the manifest snapshot, so the drift gate failed on Node 24 while passing on Node 26. -
56d8227: Add the
nudo:capability-denieddiagnostic (ABS-12 R12-D, strict by default). Host globals andnode:modules classified as denied now report this code — values stayunknownand are never executed natively — instead ofnudo:builtin-unknown; denied modules are reported at the import/require site. Module classification only covers builtins (node:prefix ormodule.builtinModules), so relative paths and npm packages keep their existing missing-module channel.NUDO_CAPABILITIES=trusted(orsetCapabilityMode("trusted")) restores the previousbuiltin-unknownsurface and limits runtime identity blocking to the hand-written high-risk list; unclassified names (typos) remainbuiltin-unknownin both modes. Docs updated (EN + zh-Hans). Pinned bycapability-diagnostics.test.ts(strict/trusted, globals/modules/typos). -
14cf89a: Add an explicit host capability manifest (ABS-12 R12-D, first slice) and use it for runtime identity blocking.
exec/capabilities.tsclassifies 188 host globals and allnode:builtins as allowed/denied with default-deny, plus snapshots for drift gates;neverExecHostNamenow blocks every denied host function by identity (aliases such asconst f = BroadcastChannelincluded), not just the hand-written fetch/timer list. Denied values still degrade tounknown(no native execution), and allowed values (e.g.Array,Buffer,structuredClone) are untouched. A new drift test fails when a Node upgrade or runner injects an unclassified global/builtin, forcing explicit review. Remaining for the capability work: thenudo:capability-denieddiagnostic code, module-resolution denial, and the--capabilities trustedopt-out. -
49cdb00: Fix whole-file
checkSourcememo thrashing on medium monorepos: raiseMAX_CHECK_MEMOfrom 256 to 1024 (aligned withMAX_GENERALIZE_MEMO). A sequential full scan over more files than the LRU capacity evicts the very next entry to be read, dropping the hit rate to zero — warmcheck alldegenerated into a full recompute (real corpus: 43.9s; a 200-file control run inside the old capacity was 433.7ms). The per-roundevalRunMemokeeps its own 256 bound. The cache stays bounded: the LSP resident-session memory discipline is unchanged. -
4e986cd: Speed up snapshot copies on object-heavy graphs.
copyWithMemonow checks the leaf shapes (prim/never/any/unknown) before the memo lookup: leaves are immutable and are never stored in the memo, so the result is identical but oneWeakMapquery is saved on every leaf (71.4% of calls in the ABS-17 reproducer). Theobj/fnslot loops also switch fromObject.entriestoObject.keys+ indexed reads (own-enumerable only, so inherited properties are never picked up) and reuse leaf slot values directly, removing one[k, v]array and one recursive call per leaf slot. In the ABS-17 object-export reproducer (single file, N object exports) N=800 drops from 5077ms to 3297ms and N=200 from 464ms to 339ms; combined with the earliersetSlotfast path the same file goes from 8524ms to 3297ms (-61%). Copy semantics (leaf sharing, fresh non-leaf copies, alias preservation, slot flags) are pinned bycopy-abs-leaf-sharing.test.ts; gold recall/precision, real-package zero-FP and the ABS-14 equivalence gate are unchanged. -
47463ae: DX: truncation / host-effect diagnostics now carry concrete fix values and pasteable mock skeletons (suggestion/action text only — severity and exit semantics unchanged).
nudo:fork-truncated: suggestion now carries a computed ceiling from the observed fork count —fix: package.json#nudo.analysis.maxForks=<N> (observed <K> forks this run), or @nudo:budget forks=<N> on the function — non-blocking, withN = max(20000, observed × 1.5 rounded up to the next thousand)(20000 default when stats are unavailable). Still Info / non-blocking. The ceiling helpers (suggestedForkCeiling/suggestedDepthCeiling/suggestedCallsCeiling) are exported on@nudojs/core/internalso the analyzer-side truncation diagnostics consume the same formula instead of a hand-copied one.nudo:host-effect-blocked: suggestion now embeds a pasteable single-line@nudo:mockskeleton per host family —fetchgets@nudo:mock fetch = (url) => ({ ok: true, json: () => ({ id: 1 }) }), the timer/scheduling family gets@nudo:mock <name> = stub().returns(0), and the constructor family (WebSocket/EventSource/XMLHttpRequest) getsstub().returns({ … })(an arrow mock is not constructible —newon it would trade the Info for athrows TypeErrormay-throw). All skeletons verified end-to-end: pasted verbatim into the calling function's JSDoc, the diagnostic disappears and the result regains precision. The structuredmockaction incheck --jsoncarries the same skeleton.nudo:recursion-truncated: the depth/calls arms of the suggestion (and the@nudo:budgetquickfix innudo check --fix/ LSP code actions) now carry concrete values derived from the observed depth/call counts —@nudo:budget depth=128/calls=40000floors (defaults ×2), e.g.raise the function budget with @nudo:budget depth=128 (or narrow the recursion base case / declare @nudo:contract return). The cycle arm keeps the code-level guidance (arguments must vary per level / narrow the base case /@nudo:contract; raising the budget cannot lift it) and never points at@nudo:budget. Legacy cache entries without areasonkeep the oldforks=64quickfix shape.
-
018bc20: Refactor: engine review clean-up batch — consolidate duplicated logic and add drift guards, zero behavior change.
- runtime: route
$forexit-join through the sharedapplyLoopExitJoinentry (container-widen hook parameterized); extractarrayFamilyElementDomainas the single source for the #156 element-domain convention (4 call sites); drop a dead rethrow arm in$for's catch chain; delete the hooks setter re-export relays (containers/member.ts,runtime/state.ts,runtime/containers.ts) so the "registrants must import hooks.ts directly" invariant is structural. - transpile: unify the five guard arm-shadow-binding emitters in
stmt/predicates.tsonto one parameterized skeleton; splitstmt/statement.ts(2619 lines) into module-stmt / loop-stmt / switch-stmt / try-stmt domain files; converge theemitMemberTargetAssignfallback arm onto amember-path.tsplanning function. - class: extract
resolveChainSpeccursor primitive (replaces 6 hand-copied BUG-172 chain walks); table-drive the Number/BigInt prototype radix/precision domains; splitclass/invoke.ts(2283 lines) intoprim-methods.ts+proto-borrow.ts; drop the dead no-hasExtendslegacy arm of$class. - guards: new
nudo-injection-namesdrift gate pinning the 12__nudo*host injection names against emitted code; newinvoke-arr-method-paritytest pinning the Array.prototype generic-borrow path againstinvokeArrMethod. - docs: kernel-merge.md collector-scope table — move yieldStack / genPathSensitive / genJoinOverride to the scoped row (matches
createScopedSlotreality).
- runtime: route
-
b4435ae: Refactor: engine review follow-up — file reorganization and naming hygiene, zero behavior change.
- transpile: rename
emitArrMutatorRebinds(historical name; array-mutator / defineProperty / delete rebinds have all moved off the statement pass —$invokein-place mutation under Bug 49/51, expression-position self-contained IIFEs) toemitStmtWritebackRebinds; its sole remaining duty is the Bug 96 statement-position RegExp state write-back ($reStateCall). Splittranspile/helpers.ts(2016 lines) into domain leaf files undertranspile/helper/behind the unchangedhelpers.tsfacade barrel (all existing import paths keep working). - class: split
class/declare.tsinto definition-time ($classspec + registration) and construction/lookup-time ($new/constructClass/findMethodfamily) modules; lift the ten duplicatedvalidateCallableArg(args[0], …)preflight checks ininvoke-arr.tscallback-family methods into one shared wrapper with byte-identical diagnostics; fix the staleregisterClassDeclreference in the class-registry header comment (current names:$class/registerEvalClass). - runtime: extract the brand static tables (
BUILTIN_BRAND_METHODS, typed-array / iterable / accessor tables, proto brand key faces) fromruntime/members.tsintoruntime/brand-tables.tswith re-exports preserving the import face. - deprecations:
registerEvalClasson the public face is marked@deprecated— the registry is internal machinery (core consumers importexec/class-registry.tsdirectly); the public export is retained for compatibility only. - docs: kernel-merge.md collector-scope table — classify the synchronous save/restore-paired flags
awaitUnsettledHitandloopSignalFromAbstractArmunder the retained row (finally-restored before any await window, no cross-analysis leak).
- transpile: rename
-
e4dc7df: Surface finalizer throws on generator abrupt completion. When a safely extractable
finallythunk throws during.return()/.throw()replay and the generator body has no outer free writes (no snapshot hooks), the exception now propagates like native instead of being skipped — e.g.try { yield 1 } finally { null.x }no longer reports a normal completion (pinned byabs13-abrupt-completion.test.ts). Async generators wrap replay errors into a rejected promise where the runtime path reaches it. Remaining follow-ups: finalizers withyield/return/throwstatements,for-of breakreplay by iteration index (the eager collector drains the generator before the loop), and the async-generator replay path. -
7ddd831: Let
checkSource's ambient-gated dependency fingerprint reuse the ungated fingerprint computed earlier in the same watch round.LoadDepsFingerprintnow exposes the existing root sidecars theambientAllowedgate could prune (gatedSidecars), andLoadDepsFingerprintOptsacceptsloaderIdentity/ambientLoaderIdentityso per-call guard/cache wrappers participate in the round memo through their underlying loader. When no sidecar is filtered out, the gated and ungated fingerprints are byte-identical and the extra disk BFS is skipped; custom loaders with different content keep their own identity and never share, and fingerprints are only memoized foropts === undefinedcalls (a gated result can never leak into an ungated key).check --watchhub rounds drop from 718ms to 456msanalyze(total 667ms) on the 48-file semver corpus, leaf 345ms -> 210ms. Default (no epoch) behavior is unchanged; pinned byload-deps-fp-epoch.test.ts. -
06bd8ee: Stop reporting native-impossible fixed values for generator abrupt completion. When
.return(),.throw(),for-of breakoryield*forwarding terminates a generator insidetry/finally, the enclosingfinallyruns natively; the eager model left outer bindings at the suspension snapshot, so reading a binding written by the finalizer could return a precise value native never produces (e.g.falsewhere native istrue). Abrupt completion now joins the suspension snapshot with the terminal frame per captured binding (joinGenSuspendTerminal), which is sound: case results widen fromfalsetofalse | true. Precision (replaying the finalizer itself) remains a follow-up; no-finally generators and normal exhaustion are unchanged, pinned byabs13-abrupt-completion.test.ts. -
f7d105a: Replay safely extractable
finallyblocks on generator abrupt completion (ABS-13 plan A-narrow). The transpiler now emits a finalizer thunk when the try/catch body contains a yield and the finalizer has no control flow of its own (no yield/return/throw/break/continue/await/var); the thunk runs on the normal path as before, and active thunks travel to$yield/$yieldStarso.return()/ non-catch.throw()can restore the suspension snapshot and execute them innermost→outermost. Results tighten from the soundfalse | trueguard to native-exact values for.return()and.throw()through side-effectfinally, including nested finalizers ([true, true]),yield*outer finalizers, and repeated.return()(finalizer runs once). Unsupported finalizers (control flow /var) and catch-absorbed throws keep the plan-Cjoinfallback.for-ofiterator close and async-generator finalizer throws remain follow-ups. Pinned byabs13-abrupt-completion.test.ts(11 cases). -
fdc0a5a: Replay
finallyforfor…ofexits over generator objects.$forOfeagerly drains a generator's elements before the loop, so abreak(orthrow/returnin the body) previously closed an already-done generator and the finalizer never ran at the suspension point. A leaf registry (runtime/gen-return-at.ts) now attachesreturnAt(k)to each generator object: it rewinds the consumption cursor to the k-th yield, restores the suspension snapshot, replays the finalizer (and forwards throughyield*), and falls back to the sound join when the timeline frame is unavailable. The registry is carried over when the lazy trigger upgrades the shell to the freshly evaluated body. Result:for (const v of g()) breakacrosstry/finallynow yields the native-exact cleanup value;yield*-delegated breaks and finalizers with their own control flow keep the plan-C over-approximation. Pinned byabs13-abrupt-completion.test.ts. -
c9c39e8: Fix: analysis never mutates host globals (B1/B2) — fork/switch/generator fold-back and member-write root rebinds are gated on the runtime
$rebindablepredicate.- Free identifiers (host globals that were not env-injected:
process,Math,Error, host functions…) hold host values in transpiled units, while local bindings always hold Abs (includinglet x = $lit(void 0)). The fork/switch/generator binding join ($join($copy(host), …)) and the member-write root rebind used to write anasAbsValwrapper back intoglobalThis:debug/src/node.js(top-levelObject.keys(process.env)+save()'sprocess.env.DEBUG = …inside if/else) replaced the hostprocessobject (process.exit/prependListenergone → tsx preflight crash), and@changesets/cli's lazy error-code classes (Error.stackTraceLimit-style host-function member writes) replacedglobalThis.Errorwith a facade Abs (every latererr instanceof Errorcrashed). - Fix: emit
name = $rebindable("name", name) ? <join / rebind> : nameat every binding join (fork, switch pack, generator free-write fold-back) and at member-write root rebinds (single-layer, propagation, read-modify-write, delete).$rebindableis exact at runtime: Abs bindings (locals, env-injected globals) and local host functions (function declarations/expressions hold real JS functions until bridged —F.prototype = {}must still rebind, Bug 205) are rebindable; values identical toglobalThis[name](host globals) are not — self-assignment no-op. No static scope analysis needed. - New runtime op
$rebindable(exec/runtime/ops.ts, facade +RUNTIME_IMPORT_NAMES+exec/index.ts+ public-api snapshot); runtime-import-surface corpus/must-cover extended; Bug 59 transpile pins updated to the guarded emission (rebind channel preserved). Regression pins:host-global-purity.test.ts(4 — hostprocess/Erroridentity & shape unchanged across top-level if/else member writes, host-function member writes, generator bodies; local fork join still applies). - Evidence:
analyzeFileover all ofdebug(4 files) and@changesets/cli(22 files) leavesprocess/Errorintact (previously corrupted after the first file).
- Free identifiers (host globals that were not env-injected:
-
b6cdf66: Stop invalidating the whole dependency chain for inert edits. Dependency contents now enter every cache key through the same
stableAnalyzeKeySourceprojection the entry file already used: trailing comments/whitespace that carry no@nudodirective no longer flip the dependency fingerprint (check disk keys, evaluator memo, generalize L0, per-fn memo), while real code, line shifts and@nudodirectives still do.check --watchnow evicts only the files that actually changed; dependents rely on the content fingerprints to miss (semantic edit) or hit (inert edit).Measured on the 48-file semver corpus (dist, clean
NODE_OPTIONS): hub editanalyze3313ms → 2597ms, leaf 1009ms → 875ms. A single dependent'sanalyzeFileAsyncdrops from ~663–734ms to 9.9ms after an inert dependency edit, while a semantic edit still misses (172ms). The residual watch cost is thecheckverb's owncheckSource(~500ms/file, memo keyed by module-map identity), tracked as the next ABS-18 item. Pinned byload-deps-fp-stable.test.tsandabs18-watch-inert-eviction.test.ts. -
1316e42: Fix: frozen/sealed array-like receivers now enforce the mutator integrity gate; add async-plan drift gate.
$arrMutContainer(arr-methods.ts): hoist the extState integrity gate (frozen → TypeError on any mutator; sealed/non-extensible → TypeError on structural extension) ahead of the tuple/arr vs array-like dispatch — the generic-borrow path (Array.prototype.push.call(frozenArrayLike, …)) previously bypassed it and silently succeeded where native semantics throw. Extend the Bug 223 sealed pop/shift analysis with an array-like obj arm (own-slot analysis mirroring the tuple formula; unmodelable shapes record a conservative may-throw). Parity test pins updated from "documents the gap" to "asserts the gate".- New
async-plan-drifttest (92 cases): pins every row of the async-plan gen/thunk classification table and uses the V8 compiler itself as the emitter-alignment oracle — bodies classified all-safe must produce host-form output that compiles undernew Function(a mis-classified await yields inside a nested arrow ⇒ SyntaxError, the Bug 1139 failure mode); thunk bodies pin the sync fallback path stays compilable. All fourasyncBodyPlanconsumers covered (function / object method / class method / top-level await).
-
4ea0cbc: Speed up slot writes on the object-copy hot path.
setSlotno longer callsObject.definePropertyfor every key: plain assignment has the same semantics for an engine-owned slot record (own, enumerable, writable, configurable data property), and__proto__keeps thedefinePropertypath so it still creates an own slot instead of rewriting the prototype. In the ABS-17 object-export reproducer a single module drops from 8427ms to 5077ms at N=800 (-40%) and from 620ms to 464ms at N=200 (-25%); the 120-file synthetic corpus cold analyze drops from 13635ms to 9776ms (-28%).setSlotself-time in that stack falls from 33% to noise. Semantics are pinned byset-slot-semantics.test.ts(own/enumerable/writable/configurable,__proto__, prototype-shadowing keys, null-proto tables). -
ead77d6: Bug 修复(非 breaking):
snapshotAbs重建 Abs 时只搬了 fn impl 侧表,漏掉exec/match-iter.ts的身份侧表 ⇒ 生成器 / 模板标签 / matchAll 迭代器 / 用户 迭代器 / Proxy 的迭代元素、drain 视图、延迟异常在快照副本上整体丢失: 副本消费点查不到条目,元素面折空、definite 体异常被静默丢弃(L2 假阴)。$copy(fork / switch 臂重绑)早有copyMatchIterTables,本次把同一迁移补到snapshotAbs(A7「重建不得静默抹掉侧表面」纪律的同口径延伸)。algebra/hof.ts末尾调copyMatchIterTables(a, out);match-iter.ts只依赖 algebra 顶层叶子(abs / objects / may-throw)、不依赖hof.ts⇒ 无环。- 与
$copy同口径共享视图引用,不是深拷贝 ⇒ 副本消费会推进原对象状态 (生成器是「一次消费」的有状态值,副本代表同一次创建事件;负控钉已固定该行为)。 - 公共 API 形状不变、不新增导出;无 BREAKING / Migration 标注。
回归:
snapshot-match-iter-tables.test.ts(6 例:元素面 / drain / 延迟异常 / 手工登记 / 共享视图负控 / 非生成器零开销);全仓1656 入口,20 失败 = 基线 20,0 新增 / 0 消失。备注:本次修的是 WeakMap 侧表迁移,不等于 A1 步骤 3 的「首消费点补写
shape.slots对快照副本失效」——snapshotAbs对 obj 槽仍是深拷贝,后者 仍是架构债(见docs/design/generator-laziness.md的 2026-11-06 前置复核)。 -
cd7c6e2: Fix: symbolic execution normalizes non-Abs results at the boundary (B3) —
checkSourceno longer crashes on bundles that return host globals.generalize's symbolicrundeclaredAbsbut could return a leaked host value (a function bodyreturn process/return JSON/ a host object flowing out of the transpiled unit) ⇒formatPoly→formatShapeSlotread.shapeof a non-Abs and crashed (Cannot read properties of undefined (reading 'k'), reproduced bycheckSourceon@babel/types/lib/index.js).- Fix: after
runCore, non-Abs results go throughasAbsVal(host functions → stable facade Abs, other host values → wrapper Abs) — the same host-bridge normalization already used by$call/ member reads.undefinedkeeps the existing fail-closedunknown+opaque path. - Regression:
checkSourceover the full@babel/typesbundle completes; covered by the OSS-corpus candidate re-check.
-
f66e104: Speed up Abs key serialization on cold full-tree analysis:
termKeynow accumulatesapparguments in a loop instead of allocating an intermediate array withmap().join(","). Output is byte-for-byte identical, pinned byterm-key-serialization.test.ts. On the synthetic 120-file corpus with a clean host env, one coldanalyzeFilepass drops from ~13.3s to ~10.0s (about 25% faster) with unchanged RSS. A WeakMap memo of term keys was evaluated and rejected: despite a 75% repeat-call rate, lookup cost plus resident strings made it slower (21.6s) and raised RSS to 881 MiB. -
5267658: Fix: architecture debt A3+A4 — the declared throws face now survives the relation face (no apply) and the construct paths (
new X()/ bind products).- A3 (relation throws channel):
relationFngains an optionalthrowscarrier (impl.relation.throws— same representation asAbsApplyResult.throws,never/absent = no throw; not written into the fn shape, which has no throws consumer). The$callrelation arm routes it through the singlerouteApplyThrowsentry (may-throw →pushThrowExitinto the caller frame;returnType = never+ throws →NudoThrow). env declarations whose host throws but which declare no apply no longer read as "never throws" (false green) —envFn's no-apply branch passesopts.throwsthrough (opt-in; no existing declaration changes behavior). - A4 (construct paths dropped the apply throws slot): the two bare-unpack sites —
$new'simpl.applybranch (exec/class/construct.ts) and the bind-product[[Construct]]facet (exec/class/invoke.ts) — now route throughrouteApplyThrowsinstead of peeling.abs, so constructor-declared throws take effect onnew X()too (previously call-face only). Under@nudo:env node,new URL(<invalid or abstract>)now records may-throwTypeErrorinstead of silently succeeding; definite always-throw constructor applies surface asNudoThrowat the construct point. A source gate forbids reintroducingisAbsApplyResult(x) ? x.abs : xpeeling in the class dispatch layer. - Regression pins:
abs-apply-throws-channel.test.ts(A3/A4 sections + cross-module gold + source gate),env-bug-s0-mechanism.test.ts(A3 env-face section incl. ctor-shape relation), and the former false-green pinenv-bug-642.4 rewritten as a positive assertion.
- A3 (relation throws channel):
-
21ffc28: Tighten generator abrupt completion around delegations and finalizer throws.
- The A1 timeline guard no longer disables the suspension timeline for every generator containing
yield*; aligned delegations (same Abs per delegated element, no overlapping ranges, indices in bounds) keep the timeline, while fork-drifted ones still fall back.returnAt(k)also works for generators without snapshot hooks (no outer free writes).for (const v of outer()) breakacrossyield*/finallynow yields the native-exact cleanup value. - Finalizers containing
throware replay-safe: conditional throws observed at the suspension point propagate exactly (sync throw / rejected promise for async generators). When replay is unavailable the runtime recordsmay-throw(YIELD_FINALLY_THROWS) instead of folding a possibly-throwing finalizer into a definite normal completion. Remaining: finalizers with their ownyield/returnstatements still need true suspension. Pinned byabs13-abrupt-completion.test.ts.
- The A1 timeline guard no longer disables the suspension timeline for every generator containing
1.18.0
Minor Changes
-
5cd4106: Dedup batch 2 (jscpd + hand-sync-comment audit): single-source the remaining cross-file / cross-package copies that were pinned together by comments or mirror tests instead of code.
- String-aware scanners (
splitTopLevelArgs/findTopLevelColon/stripJsdocContinuation→ newcore/algebra/text-scan.ts, exported via@nudojs/core/internal): the check face (case-arg split) and the parser directive face each kept verbatim copies — Bug 1009 was exactly this pair drifting (check face treated\as an escape ⇒ one arg fewer ⇒ L2 witness silently skipped).scanWithStringswas dead after the move and is gone. - bigint operand predicates (
isNullishLitOperand/isKnownNonBigintNumeric/isMaybeBigintOperand):surface.tscarried a forked copy ofarithmetic/coerce.ts— itsisMaybeBigintOperandlacked the Bug 946arr/tuplearms and only stayed sound by accident of the catch-all throw. Single source in coerce;foldNumericBinOpnow mirrors foldBigintBinOp's explicit arr/tuple hard-throw so1n & []still throws deterministically. - Bug 946 member-level fix (behavior):
isMaybeCoercionThrowOperandnow recurses intosummembers and skipsarr/tuplemembers —x & 1/1 - xwithx: number | []no longer records a false TypeError may-throw (native never throws; the old member scan dragged arr members into the may-throw channel ⇒ potential L2 false red). Regression-pinned in the Bug 946 suite, including the sound positive control (1n + xon the same union still records may-throw: the number member genuinely throws). collectNestedBodyRangeswiring completed: core exported it via@nudojs/core/internaland its comment claimed parser reuse, but parser still ran a full local copy.file-directives.tsnow consumes the single source.parseIgnoreThrows/configIgnoreThrows: service is the declared single implementation (CLI / LSP / vite-plugin); the CLI kept its own verbatim copy and the LSP test suite used that copy as a mirror oracle. nudojs now re-exports from@nudojs/service; the tautological mirror assertion is replaced by direct-value assertions.absShapeForTsTypeTextvia@nudojs/core/internal: service'stsAnnotationShapewas a hand-synced table replica ("勿单边扩表") with a drift-gate test holding the two copies together; both the replica body and the drift-gate file are gone.- emit section extraction:
interface-derivation-emit.tsandinterface-emitter.tsduplicated the export-statement →{names, bindings}extraction (31 lines) andstripSections(14 lines); both now shareservice/emit/export-section-scan.ts. ScanLiteralCallsOptions: the thin shell's inline opts literal type was a documented structural mirror of the named interface; the shell now consumes the interface directly.
- String-aware scanners (
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
7d7abe4: Dedup batch 4 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the three remaining comment-pinned manual-sync pairs and the largest in-file twins. Pure refactor — outputs byte-identical (vitest --changed 15548 passed, verify:examples 251 checks, public-api freeze 9/9).Comment-confessed sync pairs now single-sourced:
- lsp hover
formatEntryParamShapeLike→ coreformatEntryParamShapevia@nudojs/core/internal(the old comment claimed "core adds no export"; the internal face is the sanctioned route). - lsp
server-code-actionsnorm/resolveRelcopy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) →@nudojs/service/emitexportsnormPosixPath/resolveRelativeSpec; the lsp-only extensions stay at the call site. - standard-schema brand ctor list:
GLOBAL_BRAND_CTOR_NAMESlocal array + Set → schema-generatorRUNTIME_GLOBAL_CTOR_NAME_LIST(single array source; Set +isRuntimeGlobalCtorNamepredicate derive from it; the embedded validator serializes the same array, byte-identical).
In-file twins single-sourced:
- core
hof.ts:predUsesMappedVars/mapHasShapeOnlyVar→ parameterizedpredAnyVarwalker. - core
scan/literal-shapes.ts: 21 structurally identicalconstraintViolatedissue pushes →pushPrecondIssue(message/suggestion templates byte-identical). - core
builtins/promise.ts: then/catch rejected-arm microtask twins →definiteRecoveryPromise/unsettledRecoveryPromise; then-microtask dual reject arms →joinRejectedArm;Promise.alldual reject faces →allRejectFace. - core
check.ts: handwritten return-contract recording block (skip branch + main branch) →recordReturnContract. - core
leq.ts/postcondition.ts: duplicateprimOfsingle-sourced in leq. - core
builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) →taOwnKeysTuple; gOPD class/Error/.prototypeslot→descriptor arms →ownSlotDescriptor; 8 identical nullish-receiver guards →throwIfNullishRecv. - core
builtins/array.ts+template.ts: tuple join folding loops →tupleJoinParts(recv, onSymbol)(symbol element: throw vs abstract — the real semantic fork, parameterized). - core exec runtime:
$whileSeq/$forOfapplyExitJoinclosures → new pureloop-exit-join.tsapplyLoopExitJoin(the discoveredexhausted && widengate difference is an explicit parameter;$forOfpassesexhausted: true, provably equivalent). - core
directive-scan.ts↔ parserfn-directives.ts:CASE_TAG_REGEXscan loop → coreiterCaseTags(text, caseArgSpans)via@nudojs/core/internal(Bug 978 diagnostic actions and downstream regexes stay consumer-side). - service
dts-generator.ts:DtsClassMemberSurfacebase interface —scanClassSurfacereturn type no longer re-declares the member fields (BUG-168/151 docs live once). - lsp:
replay.tsasync env-preload twins sharepreloadEnvsThen, function scope walkers sharewalkFnScope;server-navigation.tsreferences/rename share the gate+parse prologue;hover.tsgeneralize blocks sharetryGeneralizeEnclosing.
Skipped as intentional parallel data or non-identical semantics: env node/web table clones (MessagePort ports, dual Storage, exec options), dts obj-slot widen pair (Bug 240 selective flags vs whole-slot spread), object methods string char-tuple pair (values vs entries elements).
- lsp hover
-
5769211: Dedup batch 5 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the four remaining comment-pinned manual-sync obligations and the seven whole-function twins. Pure refactor — outputs byte-identical (vitest --changed 16815 passed, verify:examples 251 checks, lint + lint:tests clean).Comment-confessed sync pairs now single-sourced:
- transpile
stmt/statement.tsyield try-context bits (raw1|4|8/& 2/~(16|32|64)literals pinned by a "钉死同步" comment to runtimecontrol.tsYIELD_* constants) → new zero-dependency leafexec/yield-bits.ts; runtime (control.tsre-export removed,async.ts) and transpile (statement.ts) both import the named constants. - parser
case-arg.tsTYPE_EXPR_CHAIN_METHODShand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exportsCONSTRAINT_CHAIN_METHOD_NAMES(public barrel, next toCONSTRAINT_BUILDER_NAMES); parity pinned byconstraint-chain-methods.test.ts(method-face drift ⇒ CI red). - service
builtin-prototype.tsBUILTIN_ERROR_CLASSESverbatim 8-name copy of coreERROR_CTOR_NAMES→ imported via@nudojs/core/internal(the dead module-level re-export is removed; no public face change). - core
promise.tsaggregateErrorAbslocal error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated ineval-bug-293-promise-combinator-settle.test.ts(slot-key set / non-enumerable flags / inherited name vserrorBrandAbs).
Whole-function twins single-sourced:
- core
builtins/error/binary.tsmakeArrayBufferAbs/makeSharedArrayBufferAbs→ parameterizedmakeBufferAbs(brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved). - core
transpile/member-path.tsmemberWriteIfe/memberWriteRootIfe→ sharedmemberWriteIfeImpl(only real difference: return written value vs new root). - nudojs
version.tsthree walk-up-to-package.json loops →findPkgDirUpwards+readVersionAt. - nudojs
migrate.tsplanWorkflowRewrites→ delegates toplanWorkflowRewritesIn(findWorkflowDir(from));readPackageJsonDetailed/readMarkerFile→ sharedreadJsonObjectDetailed(path, label)(missing / invalid / unreadable / ok grading unchanged). - service
emit/quickfix-edits.tssidecarClearsEntryThrow/sidecarClearsConstraintViolation→ sharedsidecarClearsDiags(input, codes)(Bug 556 dual-code gate preserved). - core
generalize.tsctorParamCountOf/ctorFormalsOftwin class-ctor walkers → singlectorParamNodesOfwalker (Bug 1031 null-declaration skip lives once; count still raw param length, formals stillformalParamsFromNodes— thethis-param skip semantics unchanged). - lsp
server-commands.tshandleSelectCase/handleSelectContract~20-line resolve→read→caseTargets→knownFunctionNames preamble →resolveCaseTarget(error strings byte-identical).
- transpile
-
6eaf219: Engine review batch: harden the transpile↔runtime ABI, converge class-graph identity, and add compile/emit guard rails. No public API changes.
ABI single-sourcing (#1):
$-prefix semantics (rt.ts module param face + analyze-strip strip-keep predicate) now consume one explicit table (isRuntimeOpName/MODULE_FACE_ONLY_OPSin transpile/runtime-import.ts); a drift guard pins the binding-table$-key set ≡ truth table (the 4 internal helpers that accidentally rode the prefix filter are now explicit).Runtime state (#2/#8/#9/#12): state.ts split into phi.ts / host-bridge.ts / exit-stacks.ts with state.ts kept as a byte-identical re-export facade (75 value exports + type face verified unchanged); load-time setter injections for the member/class dispatch cycle converge into exec/hooks.ts (removes the
var-hoisting TDZ defense); may-throw's AsyncLocalStorage + module-level syncCtx dual-write and the bare newTargetStack now run on collector-scope slots; isHostGeneratorFn checks the Bug 325 fnKind stamp before the source-shape regex (regex kept as hoisting-window fallback, documented); narrow.ts sum-filter boilerplate ×5 collapsed into filterSumMembers; guardedPrologueEntry factory covers $in/$del/$delRes; toIOIArg no longer routes through toIOI's absent-folding (private ioiNumberOf core, both helpers derived).Class graph (#3/#4): inheritance-chain walks (statics/method lookup, super family, error-family and JSON-face walks) prefer the per-value
superSpecreference resolved at definition time — multi-module same-name parent classes no longer cross-contaminate via the last-wins bare-name registry (name table kept for display/builtin fallback, collision observation unchanged); all brand-rebranding sites ($super, $new exit) route through a singlerebrandClassAbsprimitive that transfers the full side-table set (inventory + per-table rationale in rebrand.ts header).Transpile (#5/#6/#7): TranspileOptions' 44 fields regrouped into BaseEmitOpts/FlowCtx/NamingCtx/InjectCtx (type-level only, zero call-site churn); new transpile-output-hygiene test parses generated output for the full differential corpus and asserts every
__-prefixed binding comes from the allocator whitelist (9.5k bodies / 7.8k declaration sites); new async-gen compile guard transpiles+compiles all 39 await-position shapes without the disableAsyncGen retry (pins the Bug 1139 false-green class).Service (#10/#11): eval-cache 6-dim key comparison unified into a single evalCacheEntryMatches predicate (read-hit + write-back shared); CJS member dispatch exception handling pinned by a drift-gate test (shares no skeleton with core's export-slot path — rationale documented); stale TypeValue / ast-eval "fallback path" comments rewritten to describe the actual single-engine behavior, write-only dead sets removed.
-
c48fd48: Engine review batch (evaluation-engine design audit; 3 concurrent domains, behavior-preserving except where noted). Full suite green (2113 files / 16579 tests),
verify:examples251 checks green, build + lint + lint:tests clean,public-api-freezegreen (internal face +1:isAbsLike).core transpile:
- Per-unit emit state: the five module-level mutable counters/stacks in
stmt/statement.ts(switchBodySeq/switchBreakSeq/curSwitchBreakLabel/forInRecvSeq/forLoopVarSeq) moved intoTranspileOptions.stmtEmit(StmtEmitState), created fresh per transpile unit. Fixes cross-unit counter bleed: transpiling the same source twice in one process now yields byte-identical output (was 5/6 samples drifting on second pass). Single-module first-transpile output byte-identical vs HEAD (6-sample corpus,cmpclean;__nudoLv*/__nudoSw*/__fir*/__swBody*base names unchanged). - PrivateName key extraction unified: new
privateNameKeyOf(bare#nameor null) is the single extraction point;privateNameKeySrcbuilds on it. The three inlined copies (expr/call.ts,expr/optional-chain.ts,class-emit.tskeyOf) now call it. The dead|| undefinedbranch in optional-chain (#${… ?? ""}is always truthy) deleted. transpile/stmt-predicates.ts→transpile/stmt/predicates.ts(statement-domain file now lives understmt/).userIdentCache: whole-table clear at 64 →BoundedLruMap(64).
core runtime:
isAbsLike(shape+conf) added toabs.ts, exported via@nudojs/core/internal; DEC-006 fail-closed fallback table documented at the definition. ~40 inline"shape" in …guards across exec/** replaced (branch bodies and fallbacks verbatim);check-may-throw.ts's localisAbsValre-definition now aliases it. Behavior delta (bugfix): host objects that merely carry ashapedata property are no longer misdetected as Abs values — they now take the host branch as DEC-006 intends. The one inline check insiderun.ts:712generated-code string is intentionally kept (not a TS-surface check; changing it would alter the runtime injection face).- Collector dual-track residue closed:
yieldStack/genPathSensitive/genJoinOverride(runtime/control.ts) andcallLocStack/absOrigins(member-diag.ts) migrated tocreateScopedSlot+registerCollectorScopeParticipant; module-global fallback behavior unchanged (generator evaluation is synchronous, push/pop paired). $assumeAnchor(≈80 lines) moved out ofruntime/ops.tsintoruntime/assume.ts; ops.ts back to pure arithmetic delegation. Export surface unchanged.runtime/containers.tsis a pure re-export barrel again: the five isomorphic guard wrappers ($idx/$idxSet/$get/$set/$iterCheck) collapsed intoguarded-entry.ts'sguardedEntryfactory (BUG-173 this-access gate / BUG-217 accessor split / BUG-215 iterator-slot guard moved verbatim).
service:
- Three hand-rolled LRU caches (
analysis-file-cache.ts,fn-analysis-cache.ts, eval-run'sevalRunByFile) replaced withBoundedLruMap; the three "matches BoundedLruMap.set" sync comments deleted. Key semantics (stablePathKey / fn-cache prefix / file×mode slot keys) unchanged. - Dead dual-engine capability flag removed:
absModulesOk(constant true since the single-engine merge) deleted fromanalyzer-abs-eval.tsand the@nudojs/serviceexport face; its four call sites constant-folded. This is the only public-API removal in this batch. - Parallel assembly sequences unified:
buildEvalInjection's graph-assembly segment (the historical 5→2 leftover) now parameterizes and callscomposeEvalModules; the real differences (mock seeds enter the graph on the analyzer face vs runtime injection on the inject face, fileDirectives vs from-source, structuredmockModuleErrors) are explicit parameters. Deep-structure probe diff vs HEAD: zero. eval-run.ts(922 lines) split: env/harvest merging →env-modules.ts(pure data face), eval LRU + fingerprints →eval-cache.ts; eval-run keepstryRunEval/tryEvalCall*/cjs dispatch + re-exports. Public face unchanged (no package imports eval-run directly outside service).- Mock fingerprint write-side single source:
mockFingerprint(kind, payload)factory inmock-abs.ts; all five stamping sites go through it, seed-fn entries now stamped too; the reader (absSeedPart) consumesimpl.fingerprintonly (single"nofp"marker when absent, no format-string reconstruction). Cache keys change once (harmless miss).
- Per-unit emit state: the five module-level mutable counters/stacks in
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
-
01a550b: Dedup batch 6 (same-file fragment twins from the jscpd
--min-tokens 70audit; batch 5 closed the cross-file sync obligations and whole-function twins). Pure refactor — outputs byte-identical (vitest --changed green, verify:examples 251 checks, lint + lint:tests clean, defineEnv deep structural dump parity vs HEAD for the env change).- transpile
expr/optional-chain.ts:invoke/invokeKeyhop arms share the emission tail (contOf IIFE wrap, fnOptional double fork with Bug 187 whole-chain short-circuit + BUG-216 single-Get preRead, recvOptional short-circuit, bare tail) — extractedemitInvokeTail; the two arms now only definecallOf($invokevs$invokeKey) and the method-value read ($getvs$idx). Emitted code text unchanged. algebra/term.ts:surviveMulOne/surviveSubZeroverbatim-twin closures → sharedtoNumberDomainTerm(Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).algebra/check.ts: assume / invariant segment processing sharesanchorSurfaceOf(#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) sharepushEntryMayThrowIssue— only theactualline differs.- transpile
stmt/statement.ts: for-loop fallback path and init-declaration path share the body-prep block (forBodyPrep: body local decls → body opts with alias filtering → body statements → loop-carried assignment names); paths inject constScope shadowing and the initName exclusion. Emitted code text unchanged. builtins/json.ts: tuple and arrayView branches of the stringify walker sharemapElements(index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).builtins/object/methods.ts:Object.keys/Object.entriesstring- literal receiver arms sharestringIndexTupleAbs(code-unit indexing, exact conf; element construction injected).algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk sharewalkChildren.arithmetic/muldiv.ts:div/modshare the numeric leading (divModLead: builtin-brand ToPrimitive re-entry, Symbol TypeError, bigint fold + abstract-bigint domain with 0n RangeError per Bug 106); 0-divisor semantics after the leading remain per-op.env/src/node.ts: the three verbatim MessagePort slot tables (MessageChannel.port1 / port2 / standalone MessagePort brand) single- sourced asmessagePortSlots(same cross-brand sharing pattern as the existingstreamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.lsp/src/symbols.ts:FunctionDeclaration/FunctionExpressionvisitor bodies merged into a single"FunctionDeclaration|FunctionExpression"visitor key (babel traverse alias syntax), bodies were verbatim twins.
- transpile
-
fd0fb09: Dedup batch 7 (jscpd
--min-tokens 70re-audit after batch 6: residual same-file fragment twins + one drifted manual-sync pair). Pure refactor — defineEnv deep structural dump (sorted + insertion-order preserving) byte-identical vs HEAD, verify:examples 251 checks green, lint + lint:tests clean.- env
node.ts: Storage slot table ×3 (ctor brand + localStorage + sessionStorage) → singlestorageObjconst (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → sharedexecSyncOptions; Request / Response body-mixin slots (clone/arrayBuffer/blob/formData/json/text, clone returns the respective brand) →bodyMixinSlots(self)factory; EventEmitter core on/once/off/emit →emitterCoreSlotsshared by the EventEmitter brand and theprocessglobal object. - env
node.tspath family — the drifted manual-sync pair: the top-levelpathModuleinlined the whole member table next to theplatformPathMethods(posix/win32)factory and had already drifted (join.requiredonly on the top-level copy).pathModulenow consumes the factory; member order canonicalized to the top-level key order;join's required-arity enforcement is now identical across path/posix/win32 (Bug 877 case 6's claimed parity now real). - env
web.ts: URL.searchParamsslot table and the global URLSearchParams constructor sharesearchParamsCoreSlots(toString / iterator face / size stay per-site; insertion order preserved). - core
builtins/error/binary.ts: DataView ctor andmakeTypedArrayFromBuffersharebufferByteLengthLiteral(brand→inner obj→byteLength slot fold);TypedArray.of's inlined copy of the number-domain item enforcement now callsenforceTaItem(the.ofcause variant is unified into the shared text — no pins). - core
builtins/object/methods.ts:getOwnPropertySymbolsobj arm and brand-inner arm share theownSymbolsTupletail (open/index → undefined, closed → counted tuple). - core
exec/transpile/helpers.ts: the MemberExpression root-identifier walk (assignment / update / stateful-call faces, ×3) →markFreeMemberRoot. - core
scan-call-graph.ts: dynamic-import and require ObjectPattern destructure binding loops →bindPatternImports; top-level class scans (findClassDecl+ module-frame class bindings) shareunwrapExportDecl. - harvester
harvest-dts.ts:resolveIfaceDeclsinner-first relative namespace resolution loop (qualified arm + short-name arm) →addRelativeNsHit;absExtends' twoes.k === "sum"member folds →foldSumFlags(thecs.k === "sum"fold is intentionally different and untouched). - service
analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) shareactualSlotTable(obj direct / brand inner-obj unwrap). - lsp
server-navigation.ts:onDefinitionnow uses the sharednavigationIdentAtpreamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept. - lsp
agent-tools.ts:suggestCase/traceshare theanalyzeToolFilepreamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
- env
1.17.2
Patch Changes
-
51e69f8: Fix bug-report category 01 (predicate algebra / arithmetic / constraint・leq / postcondition).
- BUG-001: a same-prim literal union used as a return contract is no longer reported violated when the value's predicate already proves membership — the union branch now tries the aggregate (arm ⇒ merged-disjunction) implication before falling back to per-member checks.
- BUG-002:
number().int()'s return obligation is enforced for non-literal returns; failure is reported asnudo:unproven-returninstead of silently staying green. - BUG-027:
export --format dtsno longer widens a non-same-prim literal union to its base type, so the published.d.tsmatches the enforced contract. - BUG-088:
.optional()'s omittable / may-be-undefined semantics survive the contract ⇒ entry-Abs projection; call-site and return positions agree, and the check signature and.d.tsnow express the same optionality. - BUG-208: sidecar
fn()'sthrowsslot splits separators like@nudo:throws, sothrows: "TypeError, RangeError"no longer silently becomes one unknown kind. - BUG-209:
pick()/omit()/partial()preserve theoptionalflag, so legal calls are no longer judged violating anddtskeeps the?.
Regression tests:
core-bug-001-*,core-bug-002-*,core-bug-088-*,core-bug-208-*,core-bug-209-*,service-bug-027-*.追加:BUG-077 / 083 / 106 / 200 已修(IEEE 舍入不再是实数环)+ 4 处授权重钉
根因族:线性区间层把
+ - *当实数环运算、比较归一精确抵消常量 ⇒ 舍入(吸收 / ties-to-even) 被抹掉 ⇒ 假证。修法是统一机制,不是逐例特判:pred.ts的Lin新增rounds(舍入运算次数)与addConstMag(参与舍入的加性常量最大量级);applyCmp把界按舍入前像区间外扩slack = rounds × ½ulp(max(|k|, addConstMag)),方向保持 (gt → lo−、lt → hi+、eq → 两侧);rounds === 0(纯 var/lit、2 的幂缩放、x+x精确加倍) 仍是精确点反解(BUG-077,取 section 方案 B:保真且不丢信息)。proveInCtx在linInterval后按同一 slack 把端点外移(nextDown/nextUp各再退一格), strict 语义保留 ⇒x>0 ⊬ x+1>1,而x>0 ⊨ x+1>=1(直接比较路径)与x>1 ⊨ x+1>1仍可证 (BUG-083)。linInterval按 atom key 稳定排序后累加 ⇒x+y与y+x同结论(BUG-200 的独立根因,Map插入序曾让同一加法换序得出相反结论);linFormsEqual要求两形都精确 (rounds === 0)⇒x*6与x+x+x+x+x+x不再判「同值」(BUG-106,此前把 IEEE 加法当结合律 / 分配律,抛臂被消 ⇒ L2 假绿)。- 「有限证据 ⇒ 环语义」闸门:
atomsFinite(ctx, lin)(所有原子有assumeFinite,或typeof=number ∧ 双侧有限界自动导出)成立时 slack 归零、linFormsEqual的ringOk放行 —— 与linOf既有的ieeeOk口径一致(@nudo:assume-finite的环消去 / 分配律契约不变)。
重钉 4 处(依据 section 声明,不是放宽断言):
文件 原断言 新断言 依据 pred-linof-ieee.test.tsy>1 ⊢ y+1>2truefalseBUG-200:136 触发形态; (1+2**-52)+1 === 2(ties-to-even)pred-assume-finite.test.ts同款truefalse同上 arithmetic.test.tsx>0 ⊢ x+1>1truefalseBUG-200:14-16,27,30;反例 Number.MIN_VALUEexample0.test.tscmp("gt", x+1, 1){ok:true,value:true}{ok:false}(另新增ge⇒{ok:true,value:true}、lt⇒{ok:true,value:false}对照)同上; {ok:false}是真·不可判定(Φ 内既有x=MIN_VALUE的 false 也有x=1的 true),「确定 false 可判定」的口径由新增lt断言单独钉住回归:
core-bug-077-rounding-preimage/core-bug-083-goal-const-cancel/core-bug-106-linforms-eq-ieee/core-bug-200-strict-endpoint-const-cancel(45 例)。 全量packages/core/src/algebra/__tests__:967 文件 / 10 368 测试 / 0 失败。未改动:
arithmetic/cmp.ts:88的造值点本身无错 —— 假事实消除后它自然不再折true。 遗留提示(docs 面,本轮未改):docs/design/cli-semantics.md:347、docs/examples/README.md:29、docs/examples/constraints/README.md:4仍把x>0 ⇒ x+1>1当示例口径。追加:BUG-005 / 006 / 224 / 225 / 010 已修(返回通道漏评 + 端点见证步进 + 项化简域守卫)
- BUG-005(
array(...)的长度界在返回位不执法 ⇒ 假绿):assertImpliesSingle的element分支只对账元素域就proved();array(...)/shape(...)无prim⇒ 约束自身的preds(ge(length(self), n))永远走不到assertScalar。修:新增assertStructuralPreds—— 结构对账 通过后只实例化约束自身的preds(摘掉fields/element/members/prim/fn,否则instantiateOnTerm的 fields 分支会把 preds 丢掉),把length(<返回项>)用已知结构长度 (tuple 元素数 / obj 自有非 internal/symbol/inherited 键数)接地后三值判定:真 ⇒ proved、 假 ⇒ disproved、接地不了 ⇒ unprovable(不再伪装 proved)。 - BUG-006(
lit(null)/lit(undefined)成员的 union 无法证违结构化返回值 ⇒ 只 warning):prim缺失让值相等义务落到「无证据」兜底,而 union 的「任一成员 unprovable ⇒ 整体 unprovable」 把已证伪的number()成员掩盖。修:isBoundedEvidenceMissing只对带界原子 (gt/ge/lt/le)保留「证据缺失」语义;新增valueEqualityDecidable——eq义务的字面量域与 返回项形状域不相交(结构形状 vs 任何字面量;prim vs 域外字面量 / nullish)即可判定 ⇒ 不蕴含即disproved。只认eq(ne在域不相交时是成立,纳入会造假红);同域eq仍是 unprovable(护栏有测试钉住)。 - BUG-224(端点合成丢「最紧可达值」⇒
(x+x)/2假红):Endpoint增加attain?,synthEndpoint用a.attain ?? nextUp(...);新增attainEndpoint只对可精确反解的缩放形态 给可达下界(t + t⇒2·nextUp(E/2);t × 2^k⇒k·nextUp(E/k),上侧对偶),在 mul/div 两端点调用点接入(addsub.ts未改:x+x的 attain 由调用点从分子结构与分子自身 strict 界反解)。 - BUG-225(
roundingAbs丢 strict 见证步进 ⇒Math.ceil假红):strict 端点做见证步进impl(nextUp(lo))/impl(nextDown(hi)),结果记「可达」(不透传 strict,否则会宣称ceil(x) > 1造成新的假红)。 - BUG-010(
simplifyTerm的x - 0 = x缺 number 域守卫):加与surviveMulOne同口径的 守卫 —— 非 number 字面量走 ToNumber("abc" → NaN、true → 1、null → 0、"5" → 5、undefined → NaN),bigint 混型保留原 app;非字面量项仍走x - 0 → x。
回归:
core-bug-005-*/core-bug-006-*/core-bug-224-*/core-bug-225-*/core-bug-010-*(38 例);gold 面check-gold/check-recall-gold/check-shape-gold/engine-depth-gold全绿(248 通过 + 1 expected fail)。既有测试零改动、零重钉。 未改:interface.ts的formatConstraint仍不渲染 array/shape 长度链(违例文案在 postcondition 侧本地补length(return) ≥ n)。追加:BUG-245 / BUG-246 已修(union 源不得重跑聚合谓词;可选槽吸收 undefined)
- BUG-245:
leqWithPred在leqShape的 sum 源分支逐成员跑过leqWithPred(m, tgt, …)(各自含leqPred)后,又在尾部跑一次聚合leqPred(src = sum, tgt); 而 sum 不带顶层 pred(makeSum与constraintToCaseArgAbs都不产)⇒ 聚合检查走「源无谓词」 分支 ⇒ 目标带谓词时即 false ⇒union(number().gt(0), number().gt(5)) ⊭ number().gt(0)—— 假红,且两侧渲染成同一文本。修:sum 源且自身无顶层 pred (!src.pred || src.pred.op === "true")时跳过聚合leqPred。该 pred 守卫是必要的:narrow.ts的{...a, shape: sum}会保留a.pred,真正带顶层 pred 的 sum 仍需聚合检查。 - BUG-246(两面根因):①
leq.ts的 obj 槽分支只对缺失槽认slot.optional, present-but-undefined直接进leqWithPred⇒undefined ⊭ string。改为一条对称规则: 目标可选 ⇔ 源侧「缺失或 undefined」可赋;源槽可选对 required 目标仍失败,纯undefined对 required 目标仍失败。②scan/literal-shapes.ts的checkShapeAgainstAbs才是nudo check侧nudo:constraint-violated的生产者(实测:对该夹具leqAbs调用 0 次,而同族的 BUG-245 夹具 3 次),它同样只对缺失槽认field.optional,随后 prim 门禁报typeof o.a = "string"—— 与签名面a?: string自相矛盾。修:同一共享判定。 共享 helper(leq.ts导出,不经algebra/index.ts再导出 ⇒ 无公共 API / 快照变化):isUndefinedAbs(本仓PrimName不含undefined;undefined是shape unknown + term lit(undefined))、mayBeUndefinedAbs(含 sum 成员递归;null排除, 对齐strictNullChecks)、nonUndefinedAbsValues(剥掉 undefined 臂,[]表示全 undefined)。 两处都先剥后执法,因此{a: number | undefined}对 optionalstring仍失败(未放宽)。
回归:
core-bug-245-union-source-leq.test.ts(7 例)、core-bug-246-optional-slot-undefined.test.ts(13 例:9 代数 + 4 L1 门禁);gold 面 331 通过 + 1 expected fail;public-api-freeze9/9。e2e:optional 夹具nudo checkexit 0 且无nudo:constraint-violated(tsc 亦通过),required 夹具 exit 1 且有该码(tsc TS2322)—— 引擎与 tsc 结论一致。三面同源:check-case-scan.ts的witnessViolations字段循环(@nudo:case见证面) 也改用同一判定;并补真 CLI e2ecli-bug-246-optional-slot-undefined.test.ts(optional 夹具 exit 0 且零nudo:constraint-violated、required 夹具 exit 1 且恰好一条、required + 合法值 exit 0)。追加:BUG-082 / BUG-058 已修(契约 ∪ 默认值域;
String()走 string hint)- BUG-082:契约路径把形参 Abs 整体替换成
constraintToEntryAbs(...),默认值初始化式从未参与 ⇒ 形参域被收窄、返回面随之收窄 ⇒pick(s = "abc")配fn({s: number()}, number())在被调方 判绿(OK, exit 0),而同一契约在零调用点面正确报红。修(section 方案 1):契约绑定时把默认值 类型并入形参定义域(契约域 ∪ 默认值类型;默认值落在域内时保持契约域原样 ⇒ 合法形态零变化)。 实现为generalize.ts内三个纯函数:defaultInitAbsOf(AST 字面量 → Abs)、fnParamNodesOf(按名取最浅层函数节点的形参 AST)、惰性闭包defaultInitAbsOfParam+contractDomainOf(leqAbs(initAbs, entryAbs)通过则原样返回,否则joinAbs)。冲突经既有 L1 返回契约对账 通道执法,未新增诊断码。局限(如实记录):只并入字面量初始化式,s = compute()这类不猜 (避免假红)。.d.ts可省性在 HEAD 上已正确(pick(s?: number)),本次用测试钉住其上游事实 (契约路径下formals[0]仍是{kind:"default", optional:true})。 - BUG-058:
isNullProtoWithoutCoercer是 ToPrimitive 前置闸门的统一调用面,却把 hint 写死"default";String()复用它而没传"string"⇒ 原生不调valueOf的路径被调(用户副作用 凭空多出)。修:isNullProtoWithoutCoercer(a, hint: CoercionHint = "default")(默认值保持"default"⇒+面调用点无需改动、语义不变),builtins/global.ts的String()改传"string";"string"hint 下无自有toString钩子时绝不回退valueOf;用户toString返回非原语时仍回退valueOf—— 这是 ESOrdinaryToPrimitive的规定(node 实测String({toString:()=>({}), valueOf(){c++;return 1}})⇒"1", c=1),删掉回退反而偏离原生。
回归:
core-bug-082-contract-default-param.test.ts(7 例)、core-bug-058-string-hint.test.ts(8 例)。CLI 取证:viaString() => 10变为=> 0(native 0),only-viaPlus.js仍=> 10(native 10)。同族仍未改:methods.ts的String.prototype.concat与模板插值的降级点 (${o}现被降级成$add($add($lit(""), o), $lit("")),与用户写的"" + o逐字同形 ⇒ 信息在 降级处丢失,需专用$toStrop)。追加:BUG-058 模板插值 /
String.prototype.concat面已修(专用$toStrop)${o}原先被降级成$add($add($lit(""), o), $lit("")),与用户写的"" + o逐字同形;而+必须用 default hint(原生"" + o会调valueOf)、模板插值必须用 string hint ⇒ 信息在降级处 丢失,无法靠调用点区分。修:exec/runtime/ops.ts新增$toStr(a)—— 走isNullProtoWithoutCoercer(a, "string")+invokeToPrimitiveHook(a, "string");Symbol⇒ 抛TypeError;字面量 ⇒ 字符串字面量;否则string()并记 may-throw。exec/transpile/expr/atom.ts的TemplateLiteral插值位包一层$toStr;exec/index.ts导出并 在runtime-import.ts的RUNTIME_IMPORT_NAMES登记。另:methods.ts的String.prototype.concat是 ToString 面,也改传"string"。回归:
core-bug-058-string-hint.test.ts扩到含模板插值与concat的副作用计数;coercion 家族 (concat-spreadable、eval-arith-coercion-throws、core-bug-381、core-bug-1121、core-bug-261/262/402等)221 例全绿。追加:
public-api.snapshot.json记录./exec新增的$toStr模板插值的
$toStrop 是./exec的导出(exec/index.ts),快照面必须同步记录——public-api-freeze的./exec分母因此从 208 变 209。该条目属于快照正常演进 (导出面确实多了一个算子),不是放宽门禁。 -
51b510a: Fix bug-report category 02 (core check gate / L1 + L2) — 11 of 13 defects.
- BUG-023: call records are split into a top-level phase and a function-body phase, so a
call inside a sibling function body is no longer invisible to
nudo:interface-drift(the "unexecuted sibling body is not today's domain" rule is preserved).inner.jsnow reports the same three drifts astop.js. - BUG-029: drift comparison normalises union spellings recursively before
leqAbs, so a nested-literal union and its flat spelling stop producing a false drift (andhealthstops exiting 1). - BUG-030: a contract conflict between two disjoint finite literal sets is an error
that short-circuits the undecidable path, so
@nudo:assumebounds no longer produce a contradictory "not computable" warning alongside a green gate. - BUG-084:
@nudo:invariantattribution is driven by a consumption ledger, sonudo:invariant-reliedis emitted only for invariants actually consumed. - BUG-128: the
nudo:entry-may-throwsuggestion lists the gate's full remaining kind set (folding the Error family toError, else a comma list) instead of an arbitrary first kind, so acting on the suggestion clears the diagnostic. - BUG-137: a
sumcontaining a trueunknownmember is reported as inference failure, sonudo:unknown-inferenceis no longer missed inside a union. - BUG-138: a
ReferenceErrorsuggestion names the real unbound local / re-exported identifier in the file, or says the identifier is not bound at all. - BUG-210: declared throws are the union of
declaredThrowsForEntryandeffectiveInterface().throws.kinds(*wins), so a sidecar'sthrowsis no longer lost when the source carries@nudo:throws. - BUG-223:
interfaceTierOfclassifies only real top-level function bindings (same criterion as the LSP'stopLevelFunctionSlots), so an export alias is no longer given its own tier. - BUG-251: the generated segment is reported layer-agnostically, so drift candidates are
found even when a source-level
@nudo:contractexists (a persisted@generatedsection is no longer a dead artifact). - BUG-261: the return-position contract parse uses the same "is a valid constraint name"
test as the parameter side, so an invalid return segment yields
nudo:contract-syntaxinstead of silently evaporating.
Regression tests:
core-bug-{023,029,030,084,128,137,138,210,223,251,261}-*(11 files / 35 tests).Known follow-ups NOT covered here: BUG-099 (needs
service/src/analyzer-orchestrate-uncached-cases.tsornudojs/src/commands/test.ts—nudo testnever callscheckSource, sonudo:recursion-truncatedcannot reach it); BUG-247 (needs axiom seeding incore/algebra/generalize.tsor the LSPhover.ts/inlay.tscallers).追加:drift 与写盘面的域口径对齐(BUG-199 的 core 侧根因)
nudo:interface-drift的「今日重算」与contract --emit的写盘面此前不是同一 域口径 ⇒--emit把单点观测写成number()之后,nudo health立刻报 2 条永久 漂移(永不收敛、每次 refresh 后复发)。现两侧共用core/src/algebra/widen-observation.ts:widenObservationAbs—— 点观测 Abs 剥到基类型(从 service emit 移入 core, 经@nudojs/core/internal单点导出,杜绝两份实现分叉);isPointConstraint—— 「观测集只覆盖一个点」判据(无析取成员)。多值观测域 (union(lit(1), lit(-2)))不拓宽:它是真实观测域,被number()吸收是 真漂移(既有回归钉住的正是这一点);- 每个槽位的新鲜判据 = 「固化段 == 今日原始域」或「固化段 == 今日点拓宽域」,
即「
--emit会不会改写这一位」。既有 drift 套件(25 例,含 BUG-023/029/251/366) 语义不变、零改动通过。
追加:BUG-211 / BUG-197 已修(长度链构造期门禁 + 契约可省性进入元数面)
- BUG-211(
min/max/length用在数值 prim 上无法执法 / 两通道互斥):① 构造期门禁lengthChain(method)(与gt/ge/lt/le、.int()同口径):fields/members/fn/lazy直接抛;prim !== undefined && prim !== "string"抛;允许string()、array(...)(element在场、无 prim)与any()。lengthBound的顺序是finiteBoundArg→lengthChain→ 负界校验 (保住既有「有限数值界」提示的优先级,check-assume-directive-152的断言不变)。②decideLitCmp按左项分派:length(t)走长度语义(字符串字面量取.length;数字等 ⇒ 不可判定),非var左项 ⇒ 不可判定,纯var⇒ 原数值比较。③scan/literal-shapes.ts的checkReqs数值界分支跳过app(length, …)—— 长度谓词只由 length 通道裁决,argLen不可判时 不再当数值比较(修掉0 >= 1假红与3 >= 1假绿)。残留(诚实边界):数字 prim + 手写裸 pred 在返回位仍判 violated —— 该形态已无法经构建器构造。 - BUG-197(
nudo:arg-count不认契约.optional()):checkOneCall(本地)与checkExternalCall(跨文件)都在取effectiveInterface之前调checkCallSite()⇒arityFace只看实现签名,契约级constraint.isOptional从未进入元数面,而产物面把契约级当 可选性权威 ⇒「产物说可省、check 说必填」。修:arityFace(g, contractOptional?)让契约可选位 优先;checkCallSite透传;scan-literal-calls.ts新增contractOptionalIndexes(ei, paramNames, formals)(位次映射与interfaceToIndexed同一套, §3.3 只对handwritten生效),本地与跨文件路径都先算ei再走同一 helper ⇒ 两面同口径。 公共 APIcheckCall语义不变。
回归:
core-bug-211-min-max-prim-gate.test.ts(14 例,含手写纯数据约束与返回位同结论)、core-bug-197-arity-contract-optional.test.ts(5 例,本地 / 跨文件 + 真缺必填对照);mutation 反向验证(删掉那一行 / 退回旧调用 ⇒ 恰好对应断言失败)。相关面 363 通过 + 1 expected fail。 - BUG-023: call records are split into a top-level phase and a function-body phase, so a
call inside a sibling function body is no longer invisible to
-
aed8e00: Fix bug-report category 03 (evaluation engine) — verified subset.
- BUG-194:
$copy/$seton a host global no longer crash the engine with a bare TypeError (nudo:internalfalse red); the fork/copy path handles host objects. - BUG-218: Proxy
hastrap gains the ES invariant check, so a trap that violates [[HasProperty]] is a definite TypeError instead of a false green, and the engine no longer prints afalsethe host can never produce. - BUG-219:
delete <host global>.x/"x" in <host global>route through$del/$incorrectly instead of raising a bare TypeError. - BUG-243:
Array.prototype.indexOfno longer clampsfromIndextolen - 1;fromIndex >= lengthreturns-1like the host (the siblinglastIndexOfclamp was already correct). - BUG-244: array-like receivers are no longer mis-reported as may-throw for
sort/reverse/copyWithin/fill, and a comparator returning bigint is recorded asTypeError(host kind) rather than a genericError. - BUG-249:
strictEqAbs's "same Abs ⇒ same value" fold now honours the domain-sharing gate, soxs[0] === xs[1]over a contract-typed array no longer folds totrue. - BUG-254: env-global injection no longer splices names verbatim into
letbindings, so a strict-mode reserved word can no longer produce anew FunctionSyntaxError that fails the whole module closed.
Regression tests:
core-bug-194-*,core-bug-218-*,core-bug-219-*,core-bug-243-*,core-bug-249-*,core-bug-254-*.Known follow-ups NOT covered here (still reproducing): BUG-072, BUG-073, BUG-078, BUG-159, BUG-162, BUG-166, BUG-173, BUG-175, BUG-177.
追加:本轮求值引擎修复
已修复(
tmp/verify-bug.shexit 1 的标注为脚本实证;其余为观察型 fixture,证据是 CLI 签名与回归测试):- BUG-004:类静态方法走
$staticInvoke(D.s1 => 42、D.instance => 7、D => D)。 - BUG-020 / BUG-180:
@nudo:mock作用域收回到声明它的函数(scopeSelectedInject按函数自身的 mock 表过滤),依赖包内的函数同理 ⇒fa() => { from: "A" }、fb()不再误用 A 的 mock、callMock() => "mocked"。既有负控制service-bug-455-mock-scope.test.ts原先钉住「非冲突 mock 是文件级」——与 BUG-020 声明的正确行为相反,已改写为按函数作用域可见。 - BUG-072:
definiteModuleThrowOf认确定性的装载期抛错(IIFE 抛、顶层调用恒抛的 本地函数、nullish 成员读取、非法JSON.parse字面量、类静态块抛)⇒ error 级nudo:module-throw;typeof missing/ 条件分支 / 可选访问的负控制保持干净。 既有core-bug-1158-module-throw-failclosed.test.ts的负控制原先断言JSON.parse("{")/ null 成员读取不得上报——同样与正确行为相反,已改写。 - BUG-073:
evalFallbackOf把用户代码的原生异常归类为module-throw(不再是internal),fallback reason 直接断言。 连带的口径收口(不是放宽断言):模块级原生异常此前会让分析器产出一条 error 级nudo:internal("analysis failed for … engine internal fallback"),现在它是可裁决 的nudo:module-throwerror ——nudo check依旧红、--json依旧ok:false+ error issue、IDE 面依旧可见(lsp-bug-140与nudojs-bug-1145两个回归用例已改到新码,契约文案随之更新)。nudo health的 判据是 drift / case drift / path error / internal 回落,「代码本身必抛」属于 check 的职责 ⇒ health 对该 fixture 报 OK(internal→ FAIL 的反向仍由unsupported:*负控制与 CLI 内部路径守住)。 - BUG-078 / 159 / 166 / 175 / 177:
renameAbs保留optionalParams/holes(稀疏元组仍不可赋给稠密元组);new Storage()不再自信地判成Storage品牌; 用户URL/Error/Map/Date/Promise类遮蔽宿主全局;instanceof的 Proxy/箭头/方法 RHS 产原生TypeError(生成器 RHS 仍是布尔);派生构造器返回对象 时derivedReturnObj => { q: 1 }且无 may-throw。 - BUG-160 / 162:
TextEncoder的encoding/encode/encodeInto齐备、TextDecoder.encoding => "utf-8";web env 保留Event/CustomEvent/Request, node env 诚实报never throws TypeError。 - BUG-165:零
TypeError/entry-may-throw噪音;迭代器 symbol 调用产出迭代器面。 - BUG-173:派生构造器
super()前访问this⇒ 原生ReferenceError(exec/super-access.ts的访问门,构造器体执行期登记)。 - BUG-215 / 216 / 217:不可调用的
@@iterator槽确定抛TypeError;可选调用只读 一次 getter(1,不是"two");计算键成员读走访问器(o[k]→42)。 - BUG-242 / 248 / 259:
indexOf(3,5) => -1/lastIndexOf(3,5) => 2;二元自递归 走解释路径 + L2 α 项剥离(bin => unknown+nudo:recursion-truncated,快且不 OOM, 线性对照不受影响);symbol 键读写(读1、计算写读7、getOwnPropertySymbols().length => 1)。
追加:BUG-172 / BUG-220 已修
- BUG-172(同名类跨模块互相覆盖):注册表本体仍按裸名键(进程级
Map,清理语义不变), 但类规格改为随值携带:exec/class-registry.ts新增classSpecByValue: WeakMap+attachClassSpec/classSpecOfAbs/carryClassSpec,EvalClassSpec.superSpec记录父规格。exec/class/declare.ts去掉私有classImpl表,$class把规格挂到类值、superSpec取自父值身份(不再按名),$new把规格串进 构造与实例,findMethod首链规格优先;class/super.ts仅在携带规格的name等于 当前子类名时使用它(否则派生链会误取最派生规格);runtime/members.ts新增classChainLinks(首链规格优先、其后名字链,保留既有 last-wins 语义);containers/member.ts的静态/实例成员与ownSpec规格优先;containers/obj.ts的 fork 快照分支携带规格。回归core-bug-172-class-registry-scope.test.ts:3 模块图,两边同名Config各读各的(readA()===1/readB()===2,互不可见,kindA/kindB正确)。 残留(已在 changeset 声明):只拿名字、拿不到接收者值的面(Object.prototype.*、Reflect、JSON、denote.ts)保持既有 last-wins 口径。 - BUG-220(无界迭代代表元素 + IteratorClose):无界分支的代表元素由
「第一个具体元素」改为已收集元素的 join(
abstractIterItem+UNBOUNDED_ITEM_JOIN_CAP = 8;空集/超限 ⇒unknown),且在无界步之前只提升一次 ⇒ guard 不再被折叠成确定 false,break臂得以探索。IteratorClose经复核无需改动 (catch→isNudoBreak→iteratorClose(userIter)已可达,return()的写入能到达 循环出口)。回归core-bug-220-unbounded-iterator.test.ts(5 例:复现改"CLOSED"、 有界 break/自然耗尽、精度不受损、元素域为unknown而非字面0、两分支都探索)。 残留(代码内已注明):元素域永不满足 break 条件的无界迭代器仍分析成"CLOSED" #exact; 要让closed进循环 pack 需要把写改到循环体内,与验收口径冲突,故不做特例。
追加:回落分类改为「标签 × 来源 × 可见性」三维(BUG-073 收口)
EvalFallback现带origin("engine" | "host" | "module")与gateFatal(可见性):- 标签(
reason):module来源(transpiled 用户代码)⇒module-throw(BUG-073: 用户代码的原生 ReferenceError / TypeError 是程序自身抛,不是「引擎缺陷」);host(宿主apply钩子 / 宿主函数边界)与engine(引擎自身违约:编译体生成失败、 引擎产出非 Abs 值)⇒internal(DEC-006 canary 保留)。 - 可见性(
gateFatal):装载期逃逸 ⇒ 闸门无法裁决该文件 ⇒true(tryRunTranspiled/tryRunTranspiledDetailed/ 模块求值 catch 标{ loadFailure: true });能力边界unsupported:*与建模内的NudoThrow⇒false(不得假红);调用期异常 ⇒false(该次调用的throws面承载)。 runExportCallGuarded的 Abs-fn 分支按getFnImpl(fn)?.apply ? "host" : "module"传来源, 与$callDispatch的派发顺序(apply 先于编译体)一致;body-fn.ts的编译失败改记engine(否则 transpiler 失败会被误贴成用户代码的抛)。
run-export-guarded中一条既有断言钉的是internal ×1,与 BUG-073 直接冲突(编译体自由名 的原生 ReferenceError 是用户代码的抛)⇒ 重钉为module-throw ×1,并改成两个维度各 断言一条(internal 增量 0 / module-throw 增量 1);可观测面(result unknown + throws ReferenceError)不变。回归修复:
nudo health与nudo check的预算归因必须同源同一文件在
nudo check --json与nudo health两面必须给出同一预算归因(既有health-budget-truth断言)。根因:自递归「有界试算」
runEvalCallBudgetTrial用一次性预算实例跑探针,探针撞 depth/calls 时结果被丢弃(调用方回落 fail-closed),而「撞了预算」这件事只随探针实例一起 被丢弃(withSpeculativeEvalObservability还把截断观测静默了)⇒ 宿主预算面上只剩旁证的 cycle 归因:health 报「call cycle — not a budget limit」,而 check 面(证据域真跑到 64 层)报 「eval depth 64/64」——两面口径分裂,且把「抬@nudo:budget有效」的深递归误报成「抬预算也 解不开的环」。修法:探针截断后把「撞了哪条预算」重新记账到宿主预算实例上 (
CallBudget.noteTruncation,仅类型成员、无新增导出名 ⇒ public API 冻结不变)。 计数/上限取宿主实例的生效上限(@nudo:budget覆盖期间取覆盖值)——试算内部阈值 (depth=5 / calls=512)是实现细节,不上屏。状态机补 calls 截断现场(callsTruncCalls/Limit), 上屏计数必到顶,不出现「3/20000 却标 truncated」。重新记账只进预算面(实例 reasons + 共享原因集),不触发诊断 collector —— 诊断归因(cycle vs 预算,#158)仍由真正跑那条求值的 路径上报,否则会把service-bug-099钉住的 cycle 归因改写成「抬预算可解」。是否有重钉:无(未改任何测试断言)。
残留:① 诊断面措辞仍按各自求值路径分脸(分析器面 cycle / check 面 depth)——HEAD 既有 差异,本次刻意不动;② 重新记账的 depth 取宿主生效上限而非探针阈值;③ 探针阈值 (
generalize.ts,depth=5 / calls=512)未动 ⇒ 收敛半径 6..64 的自递归仍 fail-closed。 - BUG-194:
-
e4190b5: Fix bug-report category 04 (core builtins / collections) — 17 of 26 defects.
- BUG-007: a primitive's prototype method dispatches correctly instead of being reported as absent.
- BUG-008:
Object.getOwnPropertyDescriptor(fn, ...)models a function's ownname/length/prototypeslots. - BUG-009: a regexp literal's flags are canonicalised, so
/a/giand/a/igagree. - BUG-132: a boxed primitive's internal slot is modelled.
- BUG-157:
URLSearchParamsentries()/keys()/values()are no longer reported as carrying an internal slot. - BUG-164: the
Object.prototypelegacy accessor allowlist and the descriptor table are now the same source of truth. - BUG-176:
Reflect.constructon a user class is no longer reported as may-throw. - BUG-181:
Reflect.setwith a primitive receiver is a definiteTypeError, not a false red. - BUG-182: a host function's constructibility facet is decided by IsConstructor, not by
the presence of a
prototypeproperty. - BUG-230 / BUG-260:
Set/Mapcardinality from an abstract iterable is no longer a definite value, andMapTablecarries insertion order so key iteration matches the host andnew Set(xs).sizeagrees withArray.from(new Set(xs)).length. - BUG-276: class-instance enumerable flags are correct, so
getOwnPropertyDescriptor/Object.keysagree with the host. - BUG-277: a builtin brand's user-defined keys are enumerated (
entries/getOwnPropertyNames/getOwnPropertyDescriptors/JSON.stringify). - BUG-278: an
Errorsubclass's inheritednameordering matches the host. - BUG-281:
getOwnPropertyDescriptorson a brand instance matcheskeys/values. - BUG-282: a nested same-name
@nudo:casescope resolves to the nearest binding, and shape contracts fall back to a prototype-chainHasPropertycheck.
Regression tests:
core-bug-{007,008,009,132,157,164,176,181,182,230,260,276,277,278,281, 282}-*(16 files / 106 tests).Known follow-ups NOT covered here (root cause outside this category's file set): BUG-058, BUG-130, BUG-131, BUG-160, BUG-165, BUG-167, BUG-174, BUG-258, BUG-275; and BUG-163's
toJSONhalf (needsexec/runtime/members.tsBUILTIN_BRAND_METHODS.URL— itshosthalf is fixed and tested).追加:本轮内建面修复
已修复(带新回归测试):
- BUG-163(
toJSON半边,至此完整):BUILTIN_BRAND_METHODS.URL增加toString/toJSON,BUILTIN_BRAND_ACCESSORS.URL补组件访问器 ⇒urlToJsonIsUndef() => false、urlToJsonIn() => true(修复前true/false)。 测试:core-bug-163-url-tojson-brand-face.test.ts。 - BUG-174:
TextDecoder构造参数按宿主顺序校验(label 的 ToString → options 字典 → label 查找),抽象 prim / 全 prim 联合的 options 确定抛TypeError,any只记 may-throw。测试:core-bug-174-textdecoder-options.test.ts。 - BUG-183:
btoa/atob缺参确定抛TypeError(其余 6 个全局函数保持把缺参当undefined)。测试:core-bug-183-btoa-atob-missing-arg.test.ts;tmp/verify-bug.sh BUG-183→ exit 1。 - BUG-275:
Object.create(proto)的基对象镜像 proto 自有槽为Slot.inherited(只表示存在性,值为unknown),自有键视图(Object.keys/values/entries、for-in、 spread、JSON)排除inherited⇒ 与原生一致。测试:core-bug-275-object-create-inherited-slot.test.ts;verify-bug.sh BUG-275→ exit 1。
追加:BUG-167 已修(构造点对齐 facet + 投影面读域判定)
- BUG-167:两个
$fnVal构造点(ObjectMethod简写与方法型FunctionExpression)改为发effectFree/closedfacet(getFnFacets静态保守判定,与expr/function.ts:366-373同口径) ⇒ 同一函数体写成方法 vs 写成函数字面量,在 sort 比较器闸门、promise 回调、访问器纯度判定上 不再得出相反结论。叠加的第二处根因:Object.defineProperty(o,k,{get})装的访问器占位槽是unknown,而三个投影面(format.ts、denote.ts、service/emit/dts-generator.ts#slotAbsOf) 会无条件执行用户 getter,把分析期末次读值冻结进签名与 guard ⇒ 签名自信错值、data.b === <literal>恒假。修法:投影面加读域不可判判定(占位槽无 term ⇒ 不执行 getter,presence-only)。判据必须用term === undefined而不是shape.k === "unknown"——$lit(void 0)的shape.k也是"unknown",按 shape 判会把所有访问器判死(首版即此错)。 回归core-bug-167-side-effect-getter-not-frozen.test.ts(10 例,含 Bug 191 / 152 的负控制); 验收组 11 文件 / 148 例全绿(含eval-call-position、eval-match-json-view、exec-join-accessors、exec-define-property-accessor)。 残留(如实记录):对象字面量get访问器的占位槽必须是$lit(void 0)(Bug 191 的读域投影 与 Bug 152 的调用点求值序钉住它,换$unknown()会同时打红两处),彻底修法需在 slot 上引入 显式「读域不可判」标记(abs.tsslot 类型 +exec/runtime/state.ts的$set选项 +descriptor.ts写入);projection.ts(zod / standard-schema 经absToConstraint取读域) 同样仍是执行 getter 的老路。BUG-167 section 的验收 repro 是Object.defineProperty形态, 本修复已覆盖。 - BUG-258(facet 已落地,投影面见 cat-05):数组视图信息原先由
builtins/regexp.ts的WeakSet侧表(按 Abs 身份)承载,只有Array.isArray/ JSON 序列化 / 数组方法派发消费,类型面 看不见。修:abs.ts的{k:"obj"}形状增加view?: "array"facet +markArrayView/isArrayView(不导出到公开面 ⇒ 快照零变化;markArrayView是替换 shape 而 非就地改共享 shape),regexp.ts删除侧表、markMatchArrayView/isMatchArrayView降为薄包装, 消费面(array.ts/json.ts/member.ts派发)只读 facet;运行形状仍是k:"obj"(未改 tuple) ⇒eval-call-position.test.ts:344-350的渲染钉不变。回归core-bug-258-array-view-facet.test.ts。未完成:dts / zod / standard / guard 四个产物面尚未按shape.view === "array"分支;多 case join 时joinObjects重建 shape 不带view(需一侧传递)。
-
6daa52e: Fix bug-report category 05 (rendering / projection / emit generators) — 11 of 17 defects.
- BUG-025: the standard-schema
promisenode testsinstanceof Promisein both the library and the inlined copy, so a non-promise value is rejected instead of accepted. - BUG-031:
litPredValuebecamelitPredValuesand recognisesor(eq(...arm), ...), so a literal-union contract renders as1 | 2 | 3in the signature face, matching the dts face byte for byte. - BUG-087:
showLitsrenders the type (3,"a") instead of leaking the contract DSL spelling (lit(3)) into signatures and slot displays. - BUG-092:
predAsJs/termIsValueemitNumber.isInteger(v)for a%1 === 0predicate and compare field items by value, so nested numeric bounds agree across all four faces. - BUG-095: the
arrbranch usesArray.from(v).every(...)(holes filled withundefined), matching the standard face —[1, , 3]is no longer accepted by the guard. - BUG-097: a slot named like an
Object.prototypeown member is read with bracket access, so the guard compiles undertsc --strict(TS2367 gone). - BUG-098: the
brandbranch drops observed literals deeply, so a brand built from an observed/abc/iornew TypeError("boom")accepts the real value. - BUG-145: a same-name slot produces no inlay hint (it previously rendered another binding's derivation).
- BUG-147: inlay hints cover anonymous default exports (arrow, function expression, and
a
FunctionDeclarationwithout an id). - BUG-158: an
Argumentsbrand no longer emits anArray.isArraypremise while keeping its length/index semantics, so the guard acceptsargumentsat runtime. - BUG-250: the guard declares
const data: anywhen the contract carries an identity clause, soinstanceofnarrowing no longer blocks index reads (tsc --strictTS7053 gone).
Also updates
core-bug-348-lit-literal-signature.test.ts, which pinned thef(x: lit(1))spelling that BUG-087 declares wrong, to the correctedf(x: 1).Regression tests:
core-bug-{031,087,092,095,097,098,145,147,158}-*,service-bug-{025,250}-*.Known follow-ups NOT covered here (root cause outside this category's file set): BUG-091 (needs
lsp/src/lsp-surface/completions.ts), BUG-096 (needsschema-generator.ts), BUG-108 / BUG-169 (needdts-generator.ts+schema-generator.ts), BUG-156 (needsschema-generator.ts), BUG-191 (needsdts-generator.ts:1986-1995).追加:BUG-096 / BUG-169 / BUG-191 已修 + BUG-258 的 facet 与投影面
- BUG-096(键存在性三面不一致):zod 面原生用
key in data(含Object.prototype成员), guard / standard 面减污染键 ⇒Object.create({toString:"s"})在 zod 面被放行。反向改 guard/standard 会改hasPropertyClause的子句文本,而该文本被eval-bug-191-accessor-projection与eval-bug-240-guard-internal-slots逐字钉住 ⇒ 只能把 zod 面补齐:schema-generator.ts对「必填且键名是Object.prototype自有成员」的槽追加.superRefine(沿用同文件__proto__槽的既有模式),子句与 guard 逐字同口径;非污染键不加码(z.object原生判据已与另两面等价)。 同时修正三处自述注释(denote.ts/standard-schema.ts/ 产物__nudoHasProperty)为「三面唯一 规则」。guard / standard 的代码未变。回归service-bug-096-key-presence-parity.test.ts。 - BUG-169(TS 可选形参
b?: T丢失):?在 strip-types 阶段被删(param 节点optional为undefined),formalParamsFromNodes的kind:"id"硬写optional:false;dts 的declaredParamscase"id"硬写hasDefault:false;standard 只认kind==="default"。 修:param-surface.ts的formalParamsFromNodes(params, source?)末尾接withOptionalParams(out, tsOptionalParams(params, source))(无 source 时集合为空 ⇒ 零行为变化,generalize.ts/exec/transpile等未传 source 的调用点不受影响);dts-generator.ts的case "id"改hasDefault: f.optional === true;standard-schema.ts的declarationOptional认kind === "default"∪ (kind === "id"&&optional)。服务面extractFormals(node, source?)与 3 处调用点只做 source 透传(无语义改动)。回归emit-bug-169-ts-optional-params.test.ts(差分口径:三面可省性 ≡ 源码 JS 默认值 ∪ TS?)。 - BUG-191(
export namespace缺失):scan-named-exports.ts的ExportNamedDeclaration声明分支只认 Function/Class/Variable ⇒TSModuleDeclaration落continue被静默丢弃;dts-generator.ts同款缺口且从不发射 ⇒ 消费端 TS2305,而求值器确实物化了NS。修:scan-named-exports.ts新增TSModuleDeclaration分支(登记NS+ 运行时成员键NS.x/NS.f/ 嵌套NS.Inner.y;interface / type 是纯类型不登记,addNamespaceMemberKeys只认export过的成员);dts-generator.ts增加namespaces面并发射export declare namespace NS { … }+ 别名导出(class 发空体;enum/interface/type 镜像原文; 嵌套递归;namespace A.B认尾段)。回归emit-bug-191-export-namespace.test.ts。 - BUG-258(数组视图 facet):数组视图信息原由
builtins/regexp.ts的WeakSet侧表(按 Abs 身份)承载,只有Array.isArray/ JSON 序列化 / 数组方法派发消费,类型面完全看不见 ⇒ 同一个值在 引擎内两个结论。修:abs.ts的{k:"obj"}形状增加view?: "array"facet +markArrayView/isArrayView(不导出到公开面 ⇒ 快照零变化;markArrayView是替换 shape, 不是就地改共享 shape);regexp.ts删除 WeakSet 侧表,markMatchArrayView/isMatchArrayView保留同名同签名降为 facet 薄包装;消费面(array.ts/json.ts/member.ts派发)只读 facet。 运行形状仍是k:"obj"(未改 tuple)⇒eval-call-position.test.ts:344-350的"0":"b"/index:1/input:"abc"仍成立。回归core-bug-258-array-view-facet.test.ts。 未完成(已定位):四个产物面(dts / zod / standard / guard 的 obj 分支)尚未按shape.view === "array"分支;多 case join 时joinObjects重建 shape 不带view,需一侧传递。
追加:BUG-258 四产物面 + BUG-169 zod 面
- BUG-258 产物面(facet 本体见 cat-04):guard 面(
denote.ts)obj 分支改判shape.view === "array"⇒Array.isArray(v)(取代typeof/object+!Array.isArray;槽判据一字 未动 —— exec 结果的0/1/length/index/input/groups全是自有属性);dts 面 (dts-generator.ts)数组视图投影成元组 + 其余自有槽的交集(length由元组隐含),widenParamAbs透传viewfacet(否则形参位会退回对象字面量);zod 面 (schema-generator.ts)SchemaNode.obj增arrayView?: boolean,渲染z.tuple(...)(z.object会拒真实数组),非下标槽记台账non-index slots not validated by z.tuple; standard 面(standard-schema.ts)库函数版与产物版都要求Array.isArray(value),arrayView随节点序列化,产物类型别名NudoSchemaNode补arrayView?: boolean—— 这是修产物类型,不是放宽emit-bug-519-989的 strict 编译门禁。 - BUG-169 zod 面:
nudojs/src/commands/export/contract-face.ts的unifiedParamFace常规形参 分支改为formal.optional === true || formal.kind === "default" || formal.index >= minArity——FormalParam.optional(已接通 TS?)成为唯一事实源;无?的声明仍按观测最少实参元数放宽。 回归用「一键实参」观测把minArity钉在 1,使下标 1 的可省性只可能来自 TS?。
回归:
core-bug-258-array-view-facet.test.ts(6 例)、service-bug-258-array-view-products.test.ts(5 例)、emit-bug-169-ts-optional-params.test.ts(5 例);service/src/emit/__tests__114 文件 / 798 例、core algebra 973 文件 / 10 431 例、 service 242 文件 / 1 318 例全绿。残留:多 case join 的joinObjectsfacet 传递(objects.ts)。 - BUG-025: the standard-schema
-
0650ef0: fix(service): 分析器 / 模块图 / 缓存面(BUG-011/012/070/089/101/127/129/139/152/170/171/205/206/207/238/239/240/241/267/268/269/270/273)
模块解析与缓存:
- BUG-238/240 — 裸包
import的 spec 现在携带mode并解析到真实文件(而非包名占位),模块图边与调用点记录据此建立。 - BUG-239 —
exports条件键按 package.json 声明顺序求值;browser仅作兜底,不再无条件优先。 - BUG-267 — pattern 键按 Node
PATTERN_KEY_COMPARE取最具体匹配(./x/*vs./x/*.js)。 - BUG-268 — 裸包解析在最近的已存在
node_modules停止;未命中的exports不再被上层包无声清空为exportsUnresolved=false。 - BUG-269 — 歧义
export *名称不再导出;导入方得到nudo:missing-export,与 Node 的「模糊即不存在」一致。 - BUG-270 —
exports数组回退只发生在 target 非法时;合法但文件缺失是终止态(ERR_MODULE_NOT_FOUND)。 - BUG-273 —
esm目录导入不再猜测index.*;legacy main保留该行为。 - BUG-241 — 磁盘缓存键的入口维度带项目根指纹,依赖维度仍可移植(跨项目不再互相污染)。
- BUG-012 — 函数缓存
envKeyFn补上@nudo:env内容指纹,与另外两层缓存口径一致。
调用点与报告:
- BUG-070/170/171 — 同名调用点仅在冲突时加列号(
call@L6C9);--from目录与重复调用点在合成前去重(先解析再按站点点位去重)。 - BUG-089 — 仅当本文件在该行列确实存在调用表达式时才附加
callSiteFile。 - BUG-127 —
dedupeCallRecords的键纳入调用点身份,不同站点的同名调用不再互相吞并。 - BUG-205 — 期望值判定统一走共享
inferenceFailed,并检查term:lit(null)/lit(undefined)是 exact,不是第三种「推断失败」态。 - BUG-206 —
never期望不再走「满足」短路。 - BUG-207 — 嵌套槽位谓词(
shape({ n: number().gt(0) }))参与判定并按递归formatExpected渲染;CLI 报告面改用 service 的formatExpected。 - BUG-011 — 空调用记录不再解引用
deduped[0]。 - BUG-101 —
isNudoTargetPath接受.cjs/.mts/.cts(排除.d.mts/.d.cts),migrate retire的nudo check .与VERIFY_TARGET_EXTS对齐。 - BUG-129 — 空
--from目录报nudo:path-empty-dir。 - BUG-139 — 静态成员扫描白名单化节点类型,
ClassProperty不再被当作方法。 - BUG-152 — 匿名
export default class注册到default槽位。
已更新的既有测试(原断言钉住声明的错误行为):
service/src/__tests__/resolve-npm-exports.test.ts— 数组回退改为「首个合法 target 即终止(即使文件缺失)」。service/src/__tests__/disk-cache.test.ts— 入口缓存键带项目身份,依赖键保持可移植。service/src/__tests__/target-path.test.ts—.cjs由拒绝改为接受,新增.mts/.cts。
已知未修(根因在本类文件之外,另行跟踪):BUG-019(行号重映射在
emit/case-emitter.ts)、BUG-022(entry 结算重入语义未定)、BUG-045(CJSmodule.exports成员导出面)、BUG-069(生成比较在emit/case-emitter.ts)、BUG-085(withAssumePremises未从 core 导出)。追加:本轮分析器面修复
- BUG-022:
settleEntryOnlyCandidates不再删除注册表条目;记录增长时先摘掉上次合成的 case 再按全量记录重合成 ⇒ 调用点先出现f(3)与后出现f(3)得到同一组见证 (3 witnesses,call@L5/8/11)与逐字节相同的--emit --dry-run契约。 测试:service-bug-022-callsite-domain-order.test.ts。 - BUG-045:
tryEvalCallFull走 core 的 cjs-member 语义(对exports["default"]做$invoke),并在合成调用记录里过滤无位置记录 ⇒obj.js(module.exports = {…})与dot.js(逐成员导出)在 dts/schema/guard 三面逐字节一致(dts 由unknown→number | string)。测试:service-bug-045-cjs-object-export-member、cli-bug-045-cjs-object-export-face。 - BUG-099(递归 / fork 两臂):分析器为整轮装截断收集器(串到
eval-run的嵌套 collector,否则单槽会被静默覆盖),标签映射到nudo:recursion-truncated/nudo:fork-truncated,文案与check同口径 ⇒nudo test与--json(summary.diagnostics)都可见。测试:service-bug-099-*、cli-bug-099-*。 循环臂(nudo:loop-truncated)此前缺 core 导出,现已补LOOP_TRUNCATION_LABEL(@nudojs/core/internal),接线待做。 - BUG-069 的发射侧(见证等价按「文件 + 实参载荷」)已由 emit 类修复并回归;
本条未修的是 CLI
--freeze新增模式的坐标(见 BUG-019)。 - BUG-085 已修:
runAbsView现把extractAssumeSegs的ok段折进前提槽 (withAssumePremises,不是phi),详见 cat-09 changeset。 - BUG-099 循环臂已修:
truncationDiagnostics增加label === LOOP_TRUNCATION_LABEL分支,且必须排在label.startsWith("#")兜底之前(兜底会把#loop-iterations静默吞掉)。nudo test/--json现报nudo:loop-truncated,文案与check面逐字一致 (「A loop did not terminate within its iteration budget …」),anchor 为文件起点 1:0 (事件不带函数归属,check 面同样无位置)。回归:service/src/__tests__/service-bug-099-loop-truncated.test.ts。 注:loop 迭代预算不在@nudo:budget覆盖范围内,故建议文案不提该指令。
追加:可见性判据(
gateFatal)与./internal快照analyzer-orchestrate.ts的 per-file 失败信号判据改为f.reason === "internal" || f.gateFatal === true(标签 ≠ 可见性):BUG-073 把装载期 逃逸改标module-throw后,原判据(只收internal)会让evalFailures变空 ⇒ 闸门丢掉 「模块装载失败 ⇒ 不得判绿」(BUG-072)。三条假红防线(unsupported:*/ 建模内NudoThrow/ 干净文件)不变。service/eval-run.ts的「引擎产出非 Abs 值」回落改传origin: "engine"(引擎自身违约 ⇒internal,与该 guard 的既有语义一致)。packages/core/public-api.snapshot.json追加 4 个./internal导出(引擎机件面,语义上 允许 minor 变动):LOOP_TRUNCATION_LABEL、extractAssumeSegs、isPointConstraint、widenObservationAbs,以及类型AssumeSeg;public-api-freeze测试随之复绿。
- BUG-238/240 — 裸包
-
250f0ba: Fix bug-report category 09 (
nudo checkgate) — 10 of 15 defects.- BUG-046: a variadic flag no longer silently consumes the following path; a value the
flag cannot accept that exists on disk is reported as a usage error, so
check clean.js --only <code> broken.jsno longer exits 0 withbroken.jsunchecked. - BUG-047:
check --fixadvances its plan text outside the--writebranch, so a second hunk is@@ -1,2 +1,3 @@instead of a conflicting@@ -0,0 +1,2 @@, and dry-run output matches--write. - BUG-048:
--onlyvalues are validated against the diagnostic registry (unknown codes are a usage error; valid-but-unmatched codes are reported) instead of silently producing0 edits. - BUG-049: a sidecar write failure is reported (
check --fix cannot write <path>) instead of aborting the whole run with a bareEACCES. - BUG-066:
--quietis evaluated before--abs, so--abs --quietprints one line instead of the full signature block. - BUG-067:
--fixrefuses to write a sidecar that would conflict with a sibling file (.js/.mjs,.ts/.mts) and names the sibling. - BUG-115: the
--jsonenvelope gains an unambiguoussummary.pathErrors, so path failures are readable from the summary (the green shape is unchanged). - BUG-264:
sidecarPathOfstrips.dafter.nudo, so a.d.tssource yieldsapi.nudo.ts(and a.nudo.draft.ts-style draft) instead of a.d.name that TypeScript treats as a declaration file. - BUG-284: hard errors (input read failures / syntax errors) feed both CI channels, so
--gitlabalways emits exactly one parseable array and--ghaemits::error. - BUG-285: GHA annotations move to stderr when GitLab owns stdout, so
--gha --gitlabemits its::errorlines instead of dropping them.
Regression tests:
cli-bug-046-*,cli-bug-047-*,cli-bug-048-*,cli-bug-049-*,cli-bug-066-*,cli-bug-067-*,cli-bug-115-*,cli-bug-284-*,cli-bug-285-*,core-bug-264-sidecar-dts-name.Known follow-ups NOT covered here: BUG-014 (needs
commands/test.ts), BUG-015 / BUG-114 (needmigrate.ts, handed to the migrate category), BUG-262 (needspackages/lsp/src/validation.ts), BUG-056 (needs per-round module isolation;checkstill printsbump() => 2).BUG-056 诊断追加(未修复,定位已收窄)
同文件在同一进程被求值两轮时,闸门读到被上一轮写脏的结果(
bump() => 2,原生1; 连带main() => 11、once() => 1、nudo:interface-drift把干净侧车判成陈旧)。已排除(逐一实测,均无效):
- service
evictAbsModuleCacheFiles/evictEvalCacheForFiles:驱逐前后getAbsModuleCacheSize()都是0、getEvalCacheSize()由1归0,闸门仍是2; - core
evictGeneralizeMemoForPaths:仍是2; - core
resetNudoModuleExecCache(侧车模块执行表):仍是2。
已定位的方向:
checkSource的整文件 memo(packages/core/src/algebra/check-memo.ts)。 探针(同一进程内先跑分析器再跑闸门)在每次checkSource前resetCheckSourceMemo()后结果稳定为1(不重置则2,且第二次调用仍2)⇒ 陈旧CheckReport被跨轮复用, 不是模块实例泄漏。收口方向 = 在 CLI 轮边界按路径驱逐evictCheckSourceMemoForPaths([filePath])(该 API 已从@nudojs/core导出,无需动 public-api 快照);未落地的原因是上述探针全部跑在修复前的dist/上(@nudojs/*经 packageexports解析到dist),需要在源码构建上复核后再改 —— 否则无法区分 「memo 陈旧」与「模块实例脏」两种成因。追加:BUG-056 已修(根因与落法)
根因(实测确认,不是推测):
packages/core/src/algebra/generalize.ts与check-may-throw.ts各有一张evalRunMemo,缓存的是活的 run 表——模块级let状态 和对象身份都住在里面;键只有 source(+ mock scope + inject 指纹),没有路径、 没有轮次。后果:- 分析器一轮 generalize 与闸门一轮共用同一实例 ⇒
bump() => 2/main() => 11/once() => 1(同一文件在同一进程里被读作 1 / 2 / 3,字节相同的两个不同文件也共用); contract --emit写分析器的干净值、check打印被污染的值 ⇒nudo:interface-drift永不收敛(health 永久假红,重跑--emit无法自愈)。
落法:引入单调求值轮次(
collector-scope.ts),最外层runWithCollectorScope创建 作用域时涨轮;两张 run 表的键都带轮次前缀 ⇒ 跨轮不复用活状态;不做整表作废(整表 作废会让轮内的对象身份变化,递归泛化的 term 指纹随之坍缩成unknown);resetGeneralizeMemo同时清 run 表。已排除的无效方案(逐条实测):serviceevictAbsModuleCacheFiles/evictEvalCacheForFiles、coreevictGeneralizeMemoForPaths、resetNudoModuleExecCache、 按路径驱逐checkSource报告 memo —— 全部无法触及这两张表。回归:
core-bug-056-eval-round-identity.test.ts(3 例:分析器轮之后闸门仍读 1、字节相同的 第二个文件各自读 1、同一文件重复分析每次读 1);CLI 侧cli-bug-056-check-single-eval.test.ts钉住bump() => 1、once() => never throws Error、无nudo:interface-drift。追加:BUG-085 已修(
--abs观测面吃@nudo:assume前提)根因不在 core 的假定折叠,而在 CLI 观测面没喂前提:
nudojs/src/commands/shared.ts:: runAbsView直接tryEvalCall(...),@nudo:assume d <= max从未进入求值。落法(关键点:喂前提槽,不是
phi):每个待观测函数先从extractAssumeSegs(source, fnName)取ok段,折成ale(v(lhs), v(rhs))后withAssumePremises(phi, () => tryEvalCall(...))。div的关系折叠只读assumePremiseList(assume)(core/algebra/arithmetic/muldiv.ts:141),而前提槽在调用边界 会被清空;折进phi会既拿不到谓词、又把前提泄漏给被调方(不健全)。回归:
nudojs/src/__tests__/cli-bug-085-abs-assume-premises.test.ts(3 例)——check --abs打印pred: /(d, max) ≤ 1(此前缺失而--json已给出where,两面不一致)、 无 assume 行的对照两面都无谓词、nudo test --abs同源同结论。追加:CLI fail-closed 判据改为「可见性」,诊断按标签分两条通道
packages/nudojs/src/commands/check.ts:per-file collector 由「只收internal」改为 「internal或gateFatal === true」(plain check 与--fix两处采集点同口径), 并把诊断拆成两条:internal(引擎 / 宿主边界违约)⇒nudo:internal+ 「报引擎 bug」文案(既有);- 装载期逃逸的用户代码异常(标签
module-throw且gateFatal === true)⇒nudo:module-throw+ 指向用户代码的文案(BUG-073:不得让用户去报引擎 bug)。
这补上 BUG-072 在 CLI 侧的最后一个缺口:无句法证据的装载失败(模块顶层
JSON.parse(userInput)、顶层调用会抛的导入函数)此前零诊断 + exit 0(假绿),现在按gateFatal判红。unsupported:*(能力边界)与建模内NudoThrow的gateFatal === false⇒ 仍不入闸门(假红防线不变,1145 的 unsupported 用例守反向)。重钉:BUG-264 带来的落点改名(
.d.ts源的草稿名不再含.d.)BUG-264 修了「
.d.ts源的侧车 / 草稿名含.d.⇒ TypeScript 判成声明文件 ⇒ TS1254」, 把落点从api.d.nugo.draft.ts/api.d.nugo.ts改成api.nugo.draft.ts/api.nugo.ts。 该修复落地时只更新了 core 侧自己的钉,漏了 3 个 nudojs 侧的旧断言 ⇒ 它们的期望仍写着旧拼写。按 BUG-264 的权威规格重钉(保留旧拼写等于把 BUG-264 重新引回来):
cli-bug-659-from-dts-usage-order.test.ts:types.d.nudo.draft.ts→types.nugo.draft.ts(「CWD 里的同名草稿不存在」那条断言未动)。cli-bug-944-from-dts-write-path.test.ts(3 处):落点、next提示里的侧车名、拒绝覆盖提示里的路径 全部改成types/index.nugo.draft.ts/types/index.nugo.ts(CWD 无同名草稿、既有草稿逐字不变 等行为断言未动)。nudojs-bug-1147-contract-cli-text.test.ts(3 处):共享的draftPathOf辅助函数改成新落点 (拒绝提示双口子 / 人工改过永不被覆盖 /--force覆盖成功三条的语义断言未动)。
新增
cli-bug-944-from-dts-draft-invariants.test.ts(7 例):钉规则而不是拼写 —— 落点贴着源.d.ts且 basename 不含.d.、「next」侧车名不含.d.(旧名不得出现)、目标已存在 ⇒ 拒绝覆盖 (exit 1 +--force与NUDO_DRAFT_FORCE双口子 + 提示含hand-edited+ 既有草稿逐字不变 + 不谎报wrote)、内容未变 ⇒ 不拒绝、--force与NUDO_DRAFT_FORCE各自可覆盖机器原稿、 人工改过的草稿--force也不放行。零源码改动:实现的落点、拒绝、双口子与「人工改过不覆盖」规则本就符合 944/1147 的规格 (逐条手测复核过),只有断言的拼写过时。
残留:①
--from-dts --write在没有package.json祖先目录时无项目根守卫, 而--draft --write在同场景要求NUDO_DRAFT_FORCE=1—— 944/1147 夹具(无package.json)钉住 前者成功 ⇒ 对齐会与被钉住的行为冲突,故未动; ②--from-dts --write --dry-run在既有草稿不同时拒绝(exit 1)而非给 diff 预览, 与--draft --write --dry-run不一致(未动)。 - BUG-046: a variadic flag no longer silently consumes the following path; a value the
flag cannot accept that exists on disk is reported as a usage error, so
-
d4ab7fb: Fix bug-report category 13 (
nudo migratestatus / strip / verify / retire) — 20 of 21 bugs, plus two defects that were filed under other categories but live inmigrate.ts.- BUG-234:
migrate striprewrites an enum's computed member references toE["KEY"](reference-position aware) instead of leaving the initializer verbatim, so the stripped product no longer throws ReferenceError; string-valued computed members skip the reverse mapping like tsc. AenumComputedMemberRewrittenreport flag records the rewrite. - BUG-050:
striprefuses to write when a TS-only construct survives the stripper (namespace,import x = require(...)) instead of writing a.jsthat failsnode --check/nudo checkwith exit 0. - BUG-226:
migrate verify's env merge usesmergeHarvestUnderEnv(thecheckpath), so harvest-only exports are no longer dropped ⇒verifyno longer reportsunknownwherecheckreports a precise type. - BUG-064:
migrate verifyresolves project-level env against the project root and file-level env against the file's directory, and surfaces env load errors asnudo:env-unresolved. - BUG-061:
migrate verifyinstalls the eval-fallback collector, so an internal analysis failure is an error-levelnudo:internal(same code/severity ascheck). - BUG-114:
migrate verifyruns the strict, extension-aware parse first, so TS-only syntax inside a.jsfile is a per-filesyntax-errorinstead ofverifysayingnudoOk: true. - BUG-015:
migrate'signoreThrowsuses the same lenient parser ascheck. - BUG-051 / BUG-052 / BUG-103 / BUG-117 / BUG-118: retire batch semantics — a mixed batch
retries the work-bearing targets and reports the skipped ones;
retire --allsharesretireScopewith the single-target path; a leftovermigrate-retiring.jsonis recovered; a repeat run reportsalready retiredwith a zero delta (the ledger no longer leaks into this run's result); a multi-root failure reports every bad root. - BUG-053 / BUG-112 / BUG-179: JSON/human faces — dry-run results carry
dryRun; an unknown action emits a JSON error envelope instead of empty stdout; the human face prints only this run's deltas. - BUG-062 / BUG-063 / BUG-065 / BUG-102 / BUG-116: retire/status plumbing — the gate
script test is command-text based and reports the real
from; the workflow dedup key includes the line so the rewrite count is exact; a corrupt marker fails closed and is left byte-identical;statusandretireshare the same workflow scope; the product specifier is tried verbatim before candidate rewriting. - BUG-178:
migrate statususes retire's gate/compiler split for blockers and reports apreservedfield;next:branches on state instead of being unconditional.
Regression tests:
migrate-bug-{015,050,051,052,053,061,062,063,064,065,102,103,112,114, 116,117,118,178,179,226,234}-*andcore-bug-234-*.Known follow-up NOT covered here: BUG-017 (
--jsontop-level shape) is blocked because existing tests pin both an object envelope for failures and an array for success; a single shape breaks at least two ofcli-bug-696-migrate-strip-json-envelope,migrate-bug-cli-wiring,cli-bug-56-cli-face,cli-bug-675-migrate-retire-json-shape,migrate-bug-1028-marker-json-same-shape. Every failure path now uses the same object envelope (including the previously empty-stdout unknown-action path).追加:BUG-017
migrate --json顶层形状恒为数组成功路径早已是数组,动作级失败路径却输出对象信封(
{ ok:false, action, targets, error })⇒ 消费方JSON.parse(stdout).map(...)在失败路径抛异常。现统一为 数组:失败/正常终止信封一律包成单元素数组([ { ok:false, … } ]),status/verify/strip/retire四个 action 与未知 action 分支同口径。已有测试更新(原先钉住对象信封):
cli-bug-696-migrate-strip-json-envelope.test.ts(失败面读[0],并断言Array.isArray)migrate-bug-cli-wiring.test.ts(Bug 1006 失败面同上)cli-bug-56-cli-face.test.ts(正常终止信封failedTargets同上)
成功路径的数组形状(
cli-bug-675/migrate-bug-1028)不变。 - BUG-234:
1.17.1
Patch Changes
-
d726525: Fix the OSS real-package benchmark regressions (perf) and the
nudo:assign-mismatchfalse positive.Perf — the analysis pipeline repeated whole-file work per candidate:
localNamedExports(source → local export-name table) is now memoized per source text and computed once per candidate loop instead of once per candidate. It parses witherrorRecovery, which deliberately bypasses the AST LRU ⇒ a single-file analysis re-parsed the whole file 5 151 times (451 MB of repeated parsing; the TS strip pass alone 36.6 s). A singlecommander/lib/command.jsanalysis went from 59.2 s → 4.1 s.- Function-directive scopes (
listFnDirectiveScopes) are memoized per AST object (the scope walk was repeated per function × per refine site). - The source-level lexer scan (
scanSource) and the file-level directive gate ranges (bodyGateRanges) are memoized per source text — the three file-level directive extractors each re-walked the whole AST. - The TS strip pass is skipped for JS-mode sources: the
jsx-only plugin set cannot produce TS-only nodes, so the pass was a structural no-op that still paid two full AST walks per parse. - The
@nudo:directive count inside the strip pass now runs only when the caller asks for a report (it was dead work on every parse).
Fix —
nudo:assign-mismatchno longer fires on function parameter reassignment. A JS parameter has no declared type: the analysed "previous value" is the shape of the actual argument at that call site, so normalising a parameter (global(globals) { globals = [].concat(globals); … }in yargs) was reported asarr ⊭ prim string— a false positive on the OSS corpus. The check keeps its obligation for bindings with a declared value (let n = 1; n = "str"still reports).
1.17.0
Minor Changes
-
6ebf5a4: Evaluator engine correctness, host transpile cutover, and dedupe.
-
Fix
Object.assignsecond-class calls (const g = Object.assign; g(target, src),.call/.apply) so obj/tuple targets are mutated in place with native alias visibility; direct and builtin paths now share oneperformObjectAssigncore. Frozen targets only reject a real[[Set]](empty/null/undefined sources no longer report a false TypeError; unknown key sets become may-throw), and sealed targets dispatch own accessors through$set(setters still run; getter-only still rejects). -
Fix function-value join/dedupe: branch-dependent expando slots, nested function values, anonymous/named same-shape functions,
optionalParams/ctor/paramTypes/returnTypedifferences no longer fold to a wrong exact value.$copysnapshots fn shapes independently and migrates impl/slot ownership, null-proto, and fresh-instance identity. Alias groups are scoped lexically, so fork snapshots ($copy) no longer breakconst b = aalias identity across nested functions or shadowed blocks. -
Make
renameShape/snapshotAbsstructure-preserving: tupleholes/rest, fnslots/optionalParams/ctor, obj slotsymbolKey/internal/inherited, brand/eff metadata. -
Fix compiled-body lexical scope and strictness: block-scoped
let/const/for/catch/class/static-block bindings no longer hide enclosing closures;strictis threaded from ESM/CJS source through core/service/parser Abs-fn constructors, and class bodies are always strict. An explicit"use strict"directive prologue now marks a CJS script source strict, and CJS class-method bodies compile as strict too. -
Replace the transpile→ESM-text→regex-rewrite round-trip with
transpileModule()metadata + host-target emission (__nudoBindImport/__nudoExport*, no runtime import line, no generated-code re-parse). Analyze-mode top-level stripping now happens during emission. Namespace-onlyimport * as nsnow emits valid ESM. -
Fix
$setfail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of usingundefinedas a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on.shape. -
Fix
$switchimplicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading tounknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-locallet/const/function/class(including nested blocks,forheads andcatchparams) never enter it, so an arm-local name can no longer copy/rebind a same-named outer binding and break its alias identity. -
Fix free-write collection for nested functions: hoisted
var/ function-declaration names of a nested function body now shadow writes inside that body instead of being recorded as free writes of the enclosing unit (previously emitted$copy(<name>)for a binding that does not exist there, yielding a falseReferenceError/neverand an error-levelnudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-blockletno longer drops a legitimate sibling write from the fork set. -
Module top level is now an alias-group scope boundary:
const b = aat module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object. -
Object.assignonto a sealed / non-extensible brand (prototype) target now rejects a new own key with TypeError (native parity) while existing writable keys, own setters and owner-class members still assign. -
Dedupe shared machinery: fork-arm wrapper, structural Abs keys, dependency-aware memo store + module identities, class-instance bridge, numeric bounds, internal-slot visibility, env-skip derivation from
NAMESPACE_GLOBALS, proto walk, path projection, sum-arg dispatch,undefAbs, RegExp brand predicate, export-call exception skeleton. -
BREAKING: Remove the dead public engine symbols instead of deprecating them: the module-level
phistack (currentPhi/pushPhi/popPhi/resetPhi/withPhiConstraint/describePhi),$while/$forIter/$asyncReturn/$staticInit/$thisGet/$thisSet, the HOF promotion helpers (createHofCollectCtx/promoteParamShape/tryPromote*/HofCollectCtx/AstEnv.hofCollect), the dead relation helpersalphaOf/betaOf, andgeneralizeAll.$staticInvokealso leaves the public surface (previously exported from.and./exec): it is now engine-internal, still implemented for thecheck-may-throwclass bridge. Retire dead internallanguage.tsexports (keepgetClassChain/wrapPromise).Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from
@nudojs/core/@nudojs/core/exec;$staticInvokeis no longer reachable from a host. -
Rename
exec/class-regex.tstoexec/regexp-runtime.tsto match its RegExp-brand role.
-
Patch Changes
-
0438f10: Fix evaluator correctness and remove duplicated machinery:
- Respect user bindings named
undefined/NaN/Infinity(module bindings, parameters) instead of unconditionally folding them; keep exact literal folding for unshadowed reads, suppress undefined-literal narrowing facts when the name is bound, and honor the same bindings in callee position (NaN(1)) and at the expression entry (declarations inside the expression itself). - Separate private top-level functions from the module export surface:
export *precedence is restored, private named imports now reportnudo:missing-export,transpileSourceno longer emitsexportfor private functions, and analysis keeps a non-enumerable local-function table (so same-name re-exports/CJS exports do not shadow analyzed locals). - Make the generated runtime import list a single source of truth (it is now self-consistent with
@nudojs/core/exec), dedupeRUNTIME_IMPORT_RE, and share thenew Functioncompile scaffold. - Dedupe the A/B call budgets and the two
@nudo:purememo caches behind shared factories; either public clear API now invalidates both. - Single-pass, memoized function facet analysis; dedupe Error/mutator/class-chain/nullish tables; remove dead service evaluator modules.
- Split the evaluator's largest dispatch functions (
$invokeInner,$get/$set,invokeArrMethod,transpileStatement) and move narrowing ops out ofruntime/async.ts.
- Respect user bindings named
1.16.0
Minor Changes
-
f896290: BREAKING: 类成员的调用点参数契约补齐三条保守边界(与普通函数 / 具名导入 同一口径)。
nudo check此前对以下类成员调用点零义务(违约代码判绿):- 未导出的本地类:
class L { @nudo:contract m }的const c = new L(); c.m(-1)/new L().m(-1)/L.s(-1)。普通未导出本地函数本来就在调用点执法 ⇒ 类成员与 本地函数规则不一致(同一义务两套口径)。 - 匿名
export default class { m(a){} }:import K from "./lib.js"后new K().m(-1)解析不到类(具名export default class K已可用)。匿名类没有 本地名 ⇒ 契约键用导出槽名(default.m,侧车键default_m;@nudo:contract的 指令 scope 同口径)⇒nudo check现在报fn: default.m。 - 命名空间导入:
import * as ns from "./lib.js"的new ns.K().m(-1)/ns.K.s(-1)(const m = require(...)的m.K同路径)。类解析与具名导入共用 同一套类 AST 事实(classBindingOf),不另写模块解析器。
修法:模块级本地类的 own 方法名并入调用点扫描的 knownFns(签名普查面 / L2 入口表 不动 ⇒
nudo check的签名列表不因本地类扩面);匿名默认类绑定名 =default; 命名空间模块按词法作用域解析(内层同名声明遮蔽 ⇒ 不解析)。谁不会坏(守卫,全部保持零新诊断):继承而来(非 own)的方法;构造器
this.m = …/ 同名类字段覆盖;getter / setter / computed 成员名;静态 / 实例交叉 调用(K.m调实例方法、new K().s调静态方法);接收者被形参 / 局部声明遮蔽; 重新赋值(失效范围从「当前作用域帧」改为沿作用域链——函数体内L = …之后不再套旧类契约);未声明契约的类与方法(未导出本地类的侧车不绑, 与未导出本地函数同口径)。有意保持不执法(与普通函数 parity,不发明更宽义务):
export { K as J } from "./lib.js"的别名再导出、import { K } …; export { K }、 以及命名空间经再导出 index(普通函数的ns.f同样不执法)。再导出环(a ↔ b)有 深度上限,终止且零诊断。 - 未导出的本地类:
-
a069994: fix(core,cli): 类成员的参数契约在导入类实例 / 内联
new/ 静态调用形态下 不执法(假绿)nudo check此前只对「本地类实例 + 同类文件里的const c = new C(); c.m(…)」做 调用点契约执法。以下形态解析不出被调方 ⇒ 整条调用被跳过 ⇒ 违约代码判绿:- 导入类:
const c = new K(); c.m(-1)(import { K } from "./lib.js") - 内联构造:
new K().m(-1)(导入 / 本地都) - 静态方法:
K.s(-1)(导入 / 本地都)
修法:类成员的调用点解析改由类声明 AST 的 own 成员事实驱动 —— 实例 / 静态分开 判定,
K.static.s沿用静态 / 实例同名时的既有 scope 名(@nudo:contract侧)。 本地类仍以nudo check的签名普查面为闸门(未导出的类保持零诊断、不扩面);导入类 按定义模块 + 定义文件侧车绑定契约(K_m/K.s等同既有侧车键)。BREAKING:
nudo check现在会对上述形态新报nudo:constraint-violated(及调用点前置条件违例)⇒ 此前依赖这些调用点静默的 CI 流水线会开始非零退出。 这些调用点本来就是 L1 义务的覆盖空洞:同一份契约在c.m(…)上执法、在new K().m(…)上放行,属于同一义务的两套口径。谁不会坏(守卫,全部保持零新诊断):继承而来(非 own)的方法;构造器
this.m = …或同名类字段覆盖的方法;getter / setter / computed 成员名; 静态 / 实例交叉调用(K.m调实例方法、new K().s调静态方法);接收者被形参 / 局部声明遮蔽或被重新赋值;未声明契约的方法。 - 导入类:
-
b37321b: 新增诊断码
nudo:module-unreadable(模块存在但不可读)⇒ 新诊断码属 增量(additive)⇒ minor。The engine keeps the module semantics and the declared types of a TypeScript source.
- An import cycle made the first call inside the cycle return a wrong value and made the same export answer differently depending on the order of the calls. Live import bindings are refreshed when a call enters, not only after it returns, and the refresh registry no longer drops the bindings of a module that is still alive.
- A dependency that exists but cannot be read escaped the check as an
uncaught error that killed the whole run. The read failure is classified
(absent / unreadable) and reported as
nudo:module-unreadable. - The TypeScript type annotations of a source were removed before the
analysis saw them, so every parameter of a
.tsfile was unconstrained and the file was reported as possibly throwing. The declared types are kept now, and a parameter declareda: stringis analyzed as a string. - An
export default function f() {}was looked up under its local name and not found, because an ESM default export lives underdefault. The lookup falls back to the default slot now. - A
module.exports = { f: fn }export was not reachable by name, so the function's return type degraded tounknown. - The type annotation of a rest parameter (
...rest: string[]) was read from the wrong node and was always lost.
-
a069994: BREAKING:
nudo check的 L2 入口 may-throw(nudo:entry-may-throw)fail-closed 归因改为按可达性:转译器拒绝的构造(unsupported:*)现在也归因到经顶层辅助函数 / 类可达该构造的入口。此前只认「构造落在入口自己的源码跨度内」⇒ 同一段代码内联在入口里是红的,拆到顶层 helper 就绿:
export function f(g) { return g().x++; }报 error,而export function f(g) { return h(g); } function h(g) { return g().x++; }零诊断 (exit 0)。归因面同时补齐:- 类:入口
C用整个类声明跨度;入口C.m并入构造器与同类字段初始化器 (实例方法:构造器 + 实例字段;静态方法:静态字段 + 静态块)。 - CJS 入口形态:
exports.f = function …/module.exports.f = …/module.exports = { f: … }(与入口枚举同一批形态,不新造入口)。
不可达的入口仍不背账(同模块的陪葬入口不会凭空多出 may-throw)。
谁会坏:把不支持构造拆进 helper / 类 / CJS 赋值来「绕过」L2 的代码。这些文件本来就因为 引擎无法分析整个模块而没有任何入口结论,此前的绿是假绿。 怎么迁移:把构造改成可分析形态,或用
@nudo:throws Error/--ignore-throws Error显式放行该入口。 - 类:入口
-
ed4d259: BREAKING: 模块顶层必然抛(装载期无条件
throw)现在 fail-closed:新增 error 级nudo:module-throw(check 默认 error、可放行),不再「导出全丢 ⇒ 零诊断 + exit 0」。此前
throw new TypeError("boom"); export function f(){ return 1; }的求值回落module-throw⇒ 导出全丢(签名退化f() => unknown)、L2 无证据、CLI 打OK/ exit 0 —— 引擎完全没能分析的模块被判绿(附录 A#1)。现在报一条模块级nudo:module-throw(定位 = 顶层throw,文案带抛出类型名),nudo check非零 退出;--json/ LSP / vite-plugin 走同一条 issue 通道(无 CLI 特判)。判据只认句法证据:顶层语句序列(只穿过裸块)里无条件执行的
throw。 为什么不用引擎的「抽象上必抛」:真实包实测(node_modules 的 6 个文件:typescript/lib/_tsserver.js、react-dom/cjs/*、vitest/dist/chunks/*)顶层 没有throw语句却回落module-throw(缺失依赖 → 闭合对象 → 方法不可调用 = 宿主 API 近似;react-dom 的两个 cjs bundle 原生require()实测成功)⇒ 拿 引擎结论做门禁 = 假红。条件抛(if (typeof window === "undefined") throw)、try/catch吸收的抛、引擎近似抛不报(现状不变;零 FP 语料库check-real-packages的 10 个包 / ~1060 个文件触发 0)。抑制口径与 L2 同源:
--entry-throws off(或package.json#nudo.check.entryThrows) 关闸、--entry-throws warning降档、--ignore-throws <Kind>按抛出类型名放行 (Error盖整族)。每个模块一条诊断,不按入口重复。谁会坏:模块顶层无条件
throw(含 React Server entry stub、vitest/index.cjs这类「import 即拒绝」的守卫文件)此前判绿,现在 error。这些模块原生根本无法 导入(导出本来就不可用)⇒ 此前是假绿;若装载即抛是有意行为,用--ignore-throws <Kind>或--entry-throws off显式放行。 -
f896290: BREAKING:
nudo check的调用点契约执法补上非标量字面量实参:函数 / 箭头 / 类表达式、new Date(0)/new Map()/new Set()、正则字面量、Symbol(...)、NaN/Infinity/-Infinity、模板字面量、void 0不再对形参契约零义务。此前这些实参在函数体内的调用点被整条跳过(
parseCallArgs落兜底absUnknown()⇒hasInfo=false),同一个实参在顶层调用却报违例 ⇒ 同一义务两套 裁决。例:/** @nudo:contract x positive */ function u(x){…}+u(() => 1)⇒ 0 条(假绿)u(new Date(0))/u(/re/)/u(new Map())对number()/string()⇒ 0 条u(NaN)对number().gt(0)/u(Infinity)对number().lt(10)⇒ 0 条
另外
brand包装(new Date(0)/ 正则 / boxed prim)在typeof通道不拆壳 ⇒ 即便实参 Abs 到了分类器(顶层执行态回退),裸 prim 契约仍零义务;而同一typeof判据在 union 面会拆 brand。现在两条通道同口径,shape通道也拆 brand(new Date(0)对空 shape = 任意对象不再误报「object shape」,对带必填字段的 shape 报 missing field)。只报确定事实(宁漏勿错):函数/箭头/类恒为 function,正则 / 内建
new恒为 对象,模板恒为 string,Symbol()恒为 symbol,未遮蔽的NaN/Infinity恒为 number 字面量;NaN仍是number(裸number()放行),Infinity > 0放行。 未知形态(任意用户构造器的new——new可能返回原语、动态模板、被遮蔽的内建名、 无法求值的表达式)仍落 unknown ⇒ 不猜。谁可能坏:此前依赖「函数体里的非标量字面量实参静默」的 CI 流水线会开始非零退出。 这些调用点本来就是 L1 义务的覆盖空洞(同一份契约在顶层调用上已执法)。
-
ebe909e:
@nudojs/core新增公开可选项TranspileOptions.disableAsyncGen(async 生成器路径的安全网开关)、@nudojs/service新增公开导出analyzeFileWithEvalFailures/analyzeFileAsyncWithEvalFailures/FileEvalFailure⇒ 均为纯增量 ⇒ minor。nudojs的闸门口径翻转(模块级求值失败 ⇒ 不再静默放绿)按 minor 发布:nudo check以 error 级nudo:internal报出并以非零码退出,nudo health的Result不再报OK。这是闸门口径的翻转(详见下方「BREAKING」)。bump 级别说明:本项目尚无外部用户,本批 1.x 包的破坏性变更统一以 minor 发布并保留
**BREAKING**:标注(谁会坏 + 怎么迁移照旧写全)⇒ 不占用 major 跳版, 也不触发发布侧gate-major的人工确认闸门。一旦有外部用户依赖这些包面, 即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」政策。fix: review 报告 34 条缺陷收口(闸门假红/假绿 · 契约面宽松 · 机器面谎报 · 文档与 changeset 漂移)
本轮把一份 34 条缺陷的 review 报告逐条落地:每条都先在当前代码上复现(或判定为 非缺陷),再修,并逐条用回滚法自证「修前红 / 修后绿」。新增 39 个回归测试文件。
BREAKING:
nudo check/nudo health现在对引擎内部回落(模块求值失败 ⇒ 该文件 的导出全部丢失)fail-closed。此前这类文件零诊断 + exit 0 ⇒ CI 闸门假绿 (合法代码与违约代码都判绿)。现在:命中内部回落 ⇒ 报 error 级nudo:internal(消息含文件路径与原因)⇒nudo check非零退出;nudo health报Result: FAIL (engine internal fallback found)并非零退出。谁会坏:依赖「坏文件也能过闸」的 CI 流水线(此前引擎自己挂了就当无事发生)。这些文件 本来就是引擎缺陷的暴露面 —— 现在会显式报出来。
怎么迁移:修掉被报出的文件(消息里给了路径与原因)。注意口径边界:
unsupported:*(能力边界)与nudo:opaque-result(推断精度)不触发该失败路径;只有引擎内部回落 (internal)才 fail-closed。
高危(闸门级 · 5 条)
-
await的位置表与转译侧脱节 ⇒yield落进嵌套箭头 ⇒ 整模块编译失败 ⇒ L2 闸门假绿 (core/algebra/exec/transpile/async-plan.ts·core/algebra/exec/run.ts):async 体的 真挂起靠宿主生成器(function*(){…}+await发射yield)实现 ⇒yield必须落在 生成器体内联位置;而转译侧把若干操作数包进宿主 thunk ——yield落在里面是 SyntaxError ⇒new Function编译失败 ⇒ 整个模块的导出全部丢失 ⇒ 闸门看不到任何 入口 ⇒ 零诊断 + exit 0 ⇒ CI 闸门假绿。位置表此前只把「分支臂 / 循环体 / 短路右臂 / 三元两臂」判为 thunk,漏了:成员调用的实参(o.m(await 1))、成员赋值的接收者/计算键/ 右值(o.x = await 1)、成员自增的计算键(o[await k]++)、逻辑赋值的右值 (x ||= await 1)、循环判别式与步进式、switch 的 case 测试、早退守卫之后的后续 语句(if (!c) return null; … await …)。实测:export async function load(id){ if(!id) return null; const res = await fetch("/x/"+id); return res.json(); }修前 ⇒nudo checkOK / exit 0 / 签名全 unknown;修后 ⇒ error 级nudo:entry-may-throw(与 main 同结论)。 修法(两处,缺一不可):① 位置表补齐(上列位置判 thunk ⇒ 该 async 体回落$async同步 路径,产物是合法 JS);② 安全网:生成器模式编译失败时关闭asyncGen重试一次 ⇒ 纵有未来新增的脱节位置,模块也编译得出来 ⇒ 导出可见 ⇒ 闸门照常判定 (宁可少精确,不可整模块消失)。 -
模块级求值失败 ⇒ 闸门假绿(
service/src/analyzer-orchestrate.ts·nudojs/src/commands/{check,check-report,health}.ts):见上方 BREAKING 段。 修法:按文件收集internal回落(进程级计数无法定位到文件)⇒ 命中即产出 error 级nudo:internal(复用已注册码DIAG.internal,未新增第二套码表)⇒ok:false⇒ 非零退出;分析失败的降级产物不回写磁盘缓存(回写 ⇒ 下次命中缓存跳过求值 ⇒ 静默转绿)。 -
早返回的关系补集默认「x 不是 NaN」⇒ 契约被证成 ⇒ 假绿 (
core/algebra/exec/transpile/stmt/{fn-body,statement}.ts):¬(x <= k)还含x为 NaN 的情形(NaN 与任何比较皆假)⇒ 后续路径只该断定x > k ∨ x is NaN;此前直接断言x > k(排除了 NaN)⇒if (x < 0) return 0; return x;+return nonNeg判成立 (零诊断),而原生x=NaN时返回 NaN ⇒ 真违规被放过。且与三元写法 (x < 0 ? 0 : x)结论不一致(三元判unproven-return)。修法:撤销后续路径的否定界 窄化 ⇒ 两条路径同口径。 -
Bug 370 把「确定违规」降为 warning(
core/algebra/postcondition.ts):证据面判据 从「ret.pred有事实」改成「含界原子」⇒typeof级证据(@nudo:contract x num的 声明域参数)被判成「无证据」⇒ 返回义务降级成nudo:unproven-return(warning,且 warning 不改变 exit code ⇒ 门禁空转)。if (x === -1 || x === -2) return x;+return positive是确定违规(x=0 即违约),此前只出 warning。修法:判据回到「ret.pred有 事实」⇒ 声明域参数 ⇒ error 级nudo:constraint-violated。 -
契约合取的结构型义务被静默丢掉 ⇒ 假绿(
core/algebra/interface.ts):合取遇任一侧 结构型就直接返回前侧 ⇒ 源码 shape{id}∧ 侧车 shape{id,name}的name义务整条蒸发 ⇒ 契约面比声明面宽松 ⇒ 违约代码被放过。修法:改为字段级合并(两侧都有的字段递归 合取、单侧字段保留、optional取交集);合不了的形态组合按既有口径不判 conflict (能力边界 ≠ 语义不可满足)但显式留痕(新增EffectiveInterface.undecidable⇒ check 面 发 warning 级nudo:interface-conflict,不静默宽松)。
闸门可信度(假红 / 假绿 · 14 条)
- 展开实参被计为 1 个 ⇒
nudo:arg-count假红(core/algebra/scan/literal-args.ts):impl(...args)被计成 1 个实参 ⇒ 报「expects 2 argument(s), got 1」;数组字面量展开的空洞 (three(...[1,,3]),原生是 3 个实参)被跳过;幻影槽位破坏 rest 聚合(few(1, ...more)对array(number()).max(1)报长度违规)。修法:个数不可判时让位元数检查;空洞按undefined计入;rest / length 边界在展开处停止。 - 裸名 callee 解析不看作用域 ⇒ 无契约也触发 arity 假红(
core/algebra/scan-call-graph.ts): 外层函数的形参 / 局部 const / 嵌套函数 / for-of 绑定 / 解构绑定同名时,把顶层声明当被调 方 ⇒ 报「log expects 2 argument(s), got 1」+ 假 may-throw。修法:callee 解析引入作用域链。 memberToFn按变量名做键 ⇒ 同名局部/参数互相串味(core/algebra/scan-call-graph.ts): 别名与成员绑定改为按作用域分桶,重新赋值时失效。- TS
x?: T与 JSDoc[x]被当成必需参数 ⇒ arity 假红(core/algebra/param-surface.ts):h()对/** @param {number} [x] */ function h(x)报「expects 1 argument(s), got 0」。 or契约的「不可判定」成员被当成失败(core/algebra/scan/literal-shapes.ts):union(number().gt(0), lit("a"))对非字面量 number 实参误报。修法:三值聚合 —— 全部成员确定假才报;不可判定且域容纳该形态 ⇒ 整条 union 保持未决。- 显式
undefined被当成值(core/algebra/scan/literal-args.ts):d1(undefined)对带默认值 的形参报约束错误。修法:显式undefined⇒ 走默认值。 - 默认值填充只在零参时发生 ⇒ 假绿(
core/algebra/scan-literal-calls.ts):e4(1)缺失的尾部位不补(运行时 x = -5)⇒ 静默。修法:补齐所有缺失的尾部位置。 - switch 分组 case 标签的
hit收窄不安全(core/algebra/exec/transpile/stmt-predicates.ts):const x = null; switch (x) { case null: case "ab": return x.length; }原生抛 TypeError, 引擎按源码推导读"ab".length⇒ L2 may-throw 消失。case 0:还会把-0重绑成+0(原生1 / -0=-Infinity,引擎算成Infinity= 自信的错值)。修法:只有同体全部 标签都是原始字面量才产命中事实;0按交集细化{0, -0}。 lit(NaN)契约被判自相矛盾 ⇒ 假红(core/algebra/interface.ts):字面量值比较用!==⇒NaN !== NaN⇒ 同一个lit(NaN)自比被判成「两个不同字面量」⇒nudo:interface-conflict。修法:改用既有 helpertermEquals(===+ NaN 特例)。- import 别名撞 ambient builder 声明 ⇒ 整个 sidecar 装载失败
(
core/algebra/refine.ts):import { number as string } from "@nudojs/core"与包装器的const { number, string, … } = __nudoInjects同处一个外层作用域 ⇒ SyntaxError ⇒ 侧车整体 装载失败 ⇒ 契约全丢。修法:显式 import 的本地名从 ambient builder 名单里排除。 autoBind:false下不可读的 ambient sidecar 仍被报成 error ⇒ 假红 (core/algebra/load-deps-fp.ts·core/algebra/check.ts):指纹计算的推测性读取 走的是分析读通道 ⇒ EACCES 被收口成 error;而那份侧车在autoBind:false下根本不会被 绑定。修法:推测性读走未经降级闸的通道(读失败只让指纹标readError)+ 按 ambient 绑定资格 gate。- 缓存的 sidecar 诊断丢失依赖归属(
core/algebra/refine.ts):root→dep 递归求值共享同一 diags 数组 ⇒ 依赖侧车的诊断一律记到 root 名下。修法:诊断带来源文件并纳入去重键。 lit(1n)的大字面量被提前过滤 ⇒ 假绿(core/algebra/contract-face.ts):bigint 过滤 发生在literalMeetsConstraint之前 ⇒lit(1n)契约下返回2n的被调函数被判满足 ⇒ 违约被放过。修法:bigint 参与比较(1n !== 1,与 number 不混同)。
机器面 / 契约面 / 工具链(8 条)
@nudo:skip签名分支输出旧机器面(core/algebra/check.ts):JSONdisplay带#exact而终端显示number⇒ 机器消费方拿到的是人类面之外的文本。修法:与其它路径 同款(formatSigCached)。- 内部临时名遮蔽用户标识符(
core/algebra/exec/transpile/{member-path,expr/assignment, expr/call,expr/optional-chain,expr/short-circuit}.ts·helpers.ts):引擎写死的__nudoMp*/__nudoDefR/__nudoReArgs/__v会遮蔽用户源码里的同名绑定 ⇒ 自信错值 或 TDZ ReferenceError(⇒ 闸门假红);模块级同名还会撞出重复声明 SyntaxError ⇒ 整模块 fail-closed ⇒ 闸门假绿。修法:改用既有internalTmpName/internalTmpNameSet(无碰撞时基名原样返回 ⇒ 产物逐字不变)。 - CJS 对象字面量导出的普查键必须是成员键(
core/algebra/export-slot.ts):module.exports = { greet: function inner(x){…} }的侧车契约整个不绑定(只剩unproven-return警告、签名退成unknown⇒ 假绿),且内层 id 与成员键碰撞时映射串。 修法:导出槽映射只用成员键。 leq的 fn arity 只比较必需参数个数(core/algebra/leq.ts):(a = 1, b) => b.toFixed()被接受为单参目标(原生g(1)抛 TypeError)⇒ 判定比原生松 ⇒ 假绿。修法:按最后一个必需 参数的位置比较。- 生成的守卫对
new Proxy(...)抛错(core/algebra/denote.ts):x instanceof Proxy在 原生抛 TypeError(Proxy 没有 prototype)⇒ 守卫产物一跑就炸。修法:对无可用 prototype 的构造器跳过身份子句。 - 超参 warning 忽略可选/默认槽位(
core/algebra/diagnostics.ts):f(a, b = 1)被f(1, 2)调用时误报「takes 1 argument(s) but 2 were passed」。修法:上界按非 rest 形参总数。 - 多行
@nudo:case … !! throws声明丢失(core/algebra/directive-scan.ts):case 参数跨行 时后缀正则匹配不到 ⇒ 申报的 throws 丢失 ⇒nudo:entry-may-throw假红。修法:先在完整 注释里找平衡的 case 参数终点再识别后缀。 export default C的类入口被漏(core/algebra/scan-top-functions.ts):Babel 的Identifier字段是name(代码读的是d.id?.name⇒undefined)⇒ 类入口不在入口表里 ⇒ 构造器入口闸门看不到它 ⇒ 假绿。
async 运行时(2 条)
- callee 有 2 个及以上 await 时 caller 提前恢复(
core/algebra/exec/runtime/async.ts): 队列为[callee-resume, caller-resume]⇒ callee 的第二次续体排在 caller 之后 ⇒ caller 读到占位符。实测async function g(){ log.push(1); await null; log.push(2); await null; log.push(3) }原生"1,2,3"/ 修前"1,2"/ 修后"1,2,3";return await h()原生7/ 修前unknown/ 修后7。修法:live promise 维护 pending 态 + waiter 列表,await 的 恢复排在 settle 之后。 Promise.all取调用期快照(core/algebra/builtins/promise.ts):元素尚未 settle 时取到 占位符 ⇒ 兑现值被永久冻住;元素拒绝通道丢失 ⇒ 拒绝臂成死代码(假绿)。修法:组合子 自身 pending,元素 settle 后重算聚合;任一元素确定拒绝 ⇒ 组合子短路拒绝。
约束构造器(1 条)
.int()暴露给非 number builder ⇒ 同一约束两个裁决(core/algebra/constraint.ts):literalMeetsConstraint("abc", string().int())(域面)接受"abc",而 Abs/投影面却带整数 谓词。修法:非 number builder 上.int()抛错(与shift()同口径)。同批收口:fn()缺字段表守卫、boolean().gt(1)/string().length(-3)等恒假契约(假红)、array(1,2)静默丢元素约束(假绿)。
文档 · changeset · 诊断注册表(4 条)
- 自称破坏性的 vite-plugin changeset 声明为 patch(
.changeset/fix-vite-plugin-s{1,3,4}.md等 32 个):按docs/versioning.md逐个复核并校正 bump 级别(pre-1.0 的破坏性 ⇒ minor; 1.x+ 的 JSON 形状变更 / 默认严重级变更本应 ⇒ major,但本项目尚无外部用户 ⇒ 本批 统一以 minor 发布,见上方「bump 级别说明」),并补**BREAKING**:与迁移说明。 - 设计文档引用了被 gitignore 的产物(
docs/design/generator-laziness.md·docs/design/architecture-debt.md):tmp/…路径(读者不可达)、bun命令、过时行号、$gen发射点数目(3 ⇒ 实为 4)。修法:删交接笔记、引用符号名、指向仓内回归钉。 - 中文 API 文档漂移(
packages/website/i18n/.../api/{agent,cli-reference,lsp,harvester, service}.md):手写页与 EN 现状不一致(--json的形态、force?: boolean、旧契约…)⇒ 逐页同步;同时收紧文档覆盖闸门(docs-coverage.test.ts)让手写 api 页也进闸门。 - 诊断码绕过注册表(
packages/core/src/algebra/diag-codes.ts·packages/nudojs/src/commands/migrate.ts):nudo:migrate-strip-failed此前直写字面量 ⇒ 进DIAG注册表并由 CLI 引用常量。
附带(不改变对外行为)
nudo init的祖先配置继承口径与加载器对齐(本包已有nudo键 ⇒ 祖先不可继承 ⇒ 不再用 祖先配置当拒绝理由,消除「拒绝 + 不可修复」的死锁)。contract --help的--json描述、contract --from-dts的拒绝提示(同时给出--force与NUDO_DRAFT_FORCE=1;人工改过的草稿永不被覆盖这条口径不变)。nudo:migrate-strip-failed进注册表;interface缓存面新增undecidable透传。- 6 条被放松/空转的既有测试恢复为强断言(
check-regex-capture-narrow-136·eval-loop-return-join·eval-bug-499·core-bug-1064·loop-pack-shadow-soundness·core-bug-1079)—— 此前它们在 main 上也通过,钉不住任何回归。
-
-
f896290: BREAKING:
nudo check的 L2 入口 may-throw(nudo:entry-may-throw)fail-closed 归因补上模块装载期(module-init):转译器拒绝的构造(unsupported:*)落在 顶层语句体 / 顶层初始化表达式 / 类定义期执行面时,现在归因到每个入口。此前归因只认「入口自身跨度 ∪ 入口可达的顶层绑定」⇒ 装载期构造不属于任何入口的 执行路径 ⇒ 无人背账 ⇒ L2 静默转绿:
const g = () => ({x:1}); g().x++; export function safe() { return 1; }零诊断(exit 0,尽管模块整体未被分析)。装载期代码先于任何入口调用执行, 转译失败 ⇒ 每个入口的 total 性都不可判定。计入装载期(归因到每个入口):顶层语句体、顶层
const x = <表达式>初始化器、 任何顶层类的static {}块 / 静态字段初始化器 / 计算键 /extends表达式 (类定义期就执行,与类是否被引用无关)。不计入(仍按 Bug 1153 的可达性归因): 函数体与参数默认值(调用时跑)、实例字段初始化器 / 构造器 / 方法体(new/ 调用 时跑)⇒ 不可达的 helper / 类成员里的构造仍不归因(不做过度的「陪葬入口」断言)。 构造没有loc时仍按「无证据」处理。TS-only 声明语句例外(Bug 895):
namespace/import x = require()等类型层 / 声明层语法的转译拒绝(unsupported:statement:TS*)不做装载期归因——.ts源码必须保持零诊断;namespace体里「程序自己的抛」与 module-throw 同族(门禁面 已静默)。enum / interface / type alias /declare形态 /as const/satisfies/ 抽象类本来就转译通过(实测)。谁会坏:把不支持构造放在模块顶层(含未被引用的类的静态面)来「绕过」L2 的代码。 这些文件本来就因为引擎无法分析整个模块而没有任何入口结论,此前的绿是假绿。 怎么迁移:把构造改成可分析形态,或用
@nudo:throws Error/--ignore-throws Error显式放行该入口。
Patch Changes
-
02aa122: fix(core,service):
-0保真渲染的同根因漏点一并补齐(族 20 · Bug 1065 收口)Bug 1065 的根因是「用
String(v)渲染数值」⇒String(-0) === "0"⇒ 负号被抹掉。 主修只覆盖了litToString/lengthBound两处;收口时按同一根因把其余 漏点一并补齐(诊断陈述的契约 ≠ 用户写的契约是同一个错):- core(
packages/core/src/algebra/interface.ts·predToChain):其余三处 常数界渲染 ——.min(n)/.max(n)(length上的ge/le界)与.<op>(n)(变量上的常数界)—— 改走保真口径litToString⇒.min(-0)/.max(-0)不再被抹成.min(0)/.max(0);.length(n)的常数界渲染同款。 - service(
packages/service/src/emit/standard-schema.ts·describeValue):typeof value === "number"的渲染改用Object.is(value, -0) ? "-0" : String(value)⇒ 该文件此前存在两套-0口径(另一处已保真、这一处没有)⇒ 同款收敛。
诊断文本、侧车 DSL 回写与 schema 产物现在全部走同一套保真口径 ⇒
-0在所有面上渲染一致,不再出现「一处保真、一处抹零」。 - core(
-
6ec8afc: Accessors now see
arguments, and a string method whose pattern is a free identifier no longer breaks the module.- A getter or setter is an ordinary function, so
argumentsexists in it (length 0 for a getter, 1 for a setter). The accessor body was emitted without theargumentsslot, so readingargumentsinside an accessor threw aReferenceErrorinstead of returning0. Accessors now carry the slot like every other function body. String.prototype.match/replace/replaceAllemitted a state write-back that assigned to the pattern argument, whatever it was. Withevalorargumentsas the pattern the generated module was not valid strict-mode JavaScript, so the whole module failed to load; withundefinedit threw aTypeErrorout of nowhere. The regular expression state is now updated in place, so no assignment is generated at all, and a pattern that is not a regular expression is converted with theRegExpCreate/ToStringrules instead of being reported as throwing.
- A getter or setter is an ordinary function, so
-
7fea13a: Accessors are now projected by what they actually return, repeated keys in an object literal follow the last definition, and an early return narrows the path that follows it.
- An accessor does not live in a shape slot: the transpiler writes a
placeholder
undefinedslot to keep the key present and keeps the real getter in a side table. The read path consults the side table, soo.abreads correctly, but the projection paths read the placeholder slot, so every object literal with a getter was projected as{ ab: undefined }— a confident wrong value, narrower than the truth and self-contradictory. The projection paths (shape formatting, guard derivation, constraint projection, contract proof) and the.d.tsgenerator now take the read domain of the getter: the getter is evaluated with the object as receiver, a getter that throws projects tounknown, and a data property keeps its slot value. - A key that appears twice in an object literal kept the first accessor
even when a data property came later, so
{ get x() {}, x: 2 }was read through the getter and writingo.x = 9was reported as a definiteTypeError. The last definition now wins, including its kind: a data property after an accessor replaces it, and an accessor after a data property replaces it too. - The facts of an early return did not reach the path that follows it, so
if (x <= 0) { return 1; } return x;violated a contract ofnumber().gt(0)while the equivalentif (x > 0) { return x; } else { return 1; }passed. The path after an early return now knows the negation of the guard. The fact reaches the code after the early return whatever block the early return is written in — a bare block, atryblock, acatchblock or afinallyblock.
- An accessor does not live in a shape slot: the transpiler writes a
placeholder
-
bb8e201: fix(core): 族 60 · core 代数层 5 条精度债——rest 形参元数信息 + 复合关系守卫(片 W10)
族 60 的 5 条 core 代数层精度债,本片(core ·
algebra/**)落两条新修法, 另两条已在 HEAD 修好(本片补钉锁住,不改源码),第 5 条只报告 (正解必然新增公共导出 ⇒ 触及公共 API 冻结面 ⇒ 本片不擅自新增)。1) S6-1008 · rest 形参的元数信息在 core 层可读(新修)
packages/core/src/algebra/param-surface.ts:FormalParam的 rest 变体此前 只有kind: "rest"+optional: true⇒ 元数信息缺失 ⇒ 「真正变长」只能由 每个消费方各自按名字后缀(...x/x?)重猜一遍。现在 rest 形参带arity: { min, variadic: true }:min= 必选元数(rest 之前必选形参的 个数;默认形参 / 带默认值的解构形参可省略 ⇒ 不计;TS 的this接收者标注不是 形参 ⇒ 不计)、variadic= 变长(rest 吸收 0..n 个实参 ⇒ 元数无上界)。2) 复合测试接关系守卫(新修)
packages/core/src/algebra/arithmetic/cmp.ts(新增matchRelIdentLitComposite)exec/transpile/stmt-predicates.ts+exec/transpile/stmt/fn-body.ts: 关系守卫此前只认单一关系式(x > 0)⇒ 复合测试(x > 0 && x < 10)不接 任何守卫 ⇒ 事实臂里的裸return x丢守卫界 ⇒@nudo:contract return number().gt(0)判「证不出」(与语义等价的单关系写法结论相反 ⇒ L1 门禁口径 分裂)。
现在合取(
&&)的每一个同变量合取项界都接进事实臂(x > 0 && x < 10⇒ 事实臂 同时持有x > 0与x < 10):合取为真 ⇒ 每一合取项为真 ⇒ 事实臂可靠。sound 护栏(关键):
¬(A ∧ B)=¬A ∨ ¬B—— 不是单一关系 ⇒ 复合守卫 只用于事实臂;补集方向(后续路径 / else 臂)在narrowRelComplementArmThunk处整体跳过(守卫带composite: true标记)⇒ 不会在「测试为假」的路径上断言¬A(假绿)。析取(||)不接(合取才蕴含)。只接一个界会在契约朝 另一方向时把「证不出」变成「证反了」(假红)⇒ 同名多界一并接上。已在 HEAD 修好、本片只补钉锁住(不改源码):
- 族 21 遗留 ·
buildArgsFromAssume写死x > 0:族 08(Bug 976)已改成 「用户声明的界落进形参自己的 pred」——无界时不写界(不替用户发明更强的默认 界)。本片补钉锁住两条口径(用户界落位 + 无界不写)。 - S11-534 · core 字面量渲染 bigint 不可分:族 06(Bug 361)/ 族 20(Bug 1065)
已让
lit(10n)与lit(10)可分(bigint 保n后缀),且-0保符号。 本片补钉锁住「数字字面量渲染逐字不变」的负控。
只报告不擅自改(第 5 条):
absShapeForTsTypeText(TS 声明类型文本 → Abs 形状)在 core 内部可用,但未进公共面 ⇒ service 的 dts 产物面拿不到它。正解 必然新增公共导出 ⇒ 触及公共 API 冻结面 ⇒ 本片不擅自新增,留给主 agent 拍板(可行替代:service 侧复用 core 的既有公共导出;或把工具挪到 service 侧并 删 core 重复实现——后者超出本片范围)。口径:公共 API 冻结面零变更(core 四张表无新增导出;
FormalParam只加 可选字段arity?,既有导出签名不动);本片未动 service / env / lsp / nudojs / harvester。 -
5c750f2: Arrays, iterators and the prototype methods now behave like the language.
Array.fromreads an array-like whoselengthor whose indices are accessors. The getters are now called; before, the result was an empty array and a borrowed call saw zeroes.Array.fromandTypedArray.frompass their third argument (thisArg) to the callback, so the callback sees the rightthis.Object.prototype.toLocaleStringdelegates tothis.toString(). A user-definedtoStringis now honoured, and anull-prototype receiver throws theTypeErrorthe language throws.Array.prototype.join/toString/toLocaleStringreport theTypeErrorthey throw when the receiver isnullorundefined.- The
@@iteratormethod of an iterator object returns the iterator itself.it[Symbol.iterator]() === itis nowtruefor the iterators of an array, a string, aSetand aMap; theSetandMapones used to throw.
-
e3b8791: Promises and generators now report what the original reports.
- Awaiting a promise with two arms dropped the rejected arm, so the
catchbranch was unreachable and the domain of the enclosing function was wrong. The rejected arm is recorded now: atry/catchinside the function can absorb it, and what is not absorbed becomes the rejected arm of the promise instead of escaping to the caller. - Awaiting a thenable did not adopt it: the thenable object itself was
returned. A thenable with a callable
thenis adopted now and the settled value is used. A value whose adoption cannot be decided is returned unchanged. yield*did not forward thereturnof the delegating generator to the iterator it delegates to, so the cleanup of the delegated iterator was lost. Thereturnis forwarded now, and the outcome of the delegation decides the outcome of the outer generator.- A generator object was modelled as a plain object with its own
enumerable properties, so
Object.keys(g)listed six keys,g[0]returned the first yielded value and"0" in gwastrue. The properties of a generator are internal now: they are not enumerable and not own properties, while the protocol methods are still reachable. - The same applies to the shape of a generator: the protocol methods are no longer published in the type of a generator, in its constraint, or in the guard that is generated for it.
- Awaiting a promise with two arms dropped the rejected arm, so the
-
8a5bf7e:
awaitnow suspends the async body instead of running it to completion at the call site.- An
asyncfunction used to be evaluated as a straight-line block: the whole body — including everything after anawait— ran before the call returned, so its side effects were already visible to the caller.async function f() { await 0; n = 5; } f();leftnat5; natively it is still0, because the continuation after anawaitruns in a microtask, after the current synchronous run has finished. The same applied to counters, log ordering acrossasynccalls, and a pending promise, which the engine walked straight through. - An async body that contains an
awaitis now compiled to a real generator, andawait xsuspends it at that point. The continuation is queued on the same microtask queue the promise reactions already use, so the order of work across a promise chain is preserved.awaitin an expression position —const x = await f(),return await g(),h(await x),x + await y,const { a } = await f()— suspends the same way. - The value of the returned promise is still the value the body reaches:
the continuation fills the promise's inner value in place, so
promise<7>is reported forasync function f() { return await g(); }wheregreturns7. - A
for awaitloop is treated as one suspension point for the whole loop, rather than one per iteration. That keeps it consistent with how the engine already modelsfor await; natively each iteration awaits separately. - An async body whose
awaitsits inside a branch arm, a loop body, aswitcharm, or the right-hand side of&&/||/??keeps its previous behaviour: those positions are compiled to plain callbacks, where a suspension point cannot be expressed. The body as a whole is left unchanged rather than half-suspended.
- An
-
8542f44: fix(core): bigint 字面量契约带
prim: "bigint"(族 48 · Bug 1046 core 面)病灶:
litC(v)只给 number / string / boolean 标prim,bigint 字面量不带 prim ⇒constraintOnTermAbs落到「有界但无 prim ⇒ 按 number 处理」的兜底 ⇒ 契约 Abs 的 shape 说 number、pred 说 bigint(x = 1n)⇒ 各面互相矛盾:- guard 面:渲染成
(typeof data === "number") && (data === 1n)⇒ 契约申报的 唯一合法值1n被守卫拒收(假红:guard(1n) === false); - dts 面:bigint 契约的返回类型被写成
number; - union 成员面更糟:
samePrimLiteralUnionAbs按typeof v归类,bigint 落到 兜底分支 ⇒union(lit(1n))的 shape 说 boolean ⇒ 守卫恒假。
修法(
packages/core/src/algebra/constraint.ts的litC):补 bigint 分支 ⇒prim: "bigint",与 number / string / boolean 字面量契约同款口径 (constraint-builders.test.ts钉的typeof x = "number" ∧ x = 42就是这条口径)。跨面效果:
- guard 面 ⇒
(typeof data === "bigint") && (data === 1n)⇒guard(1n) === true(假红消除);union 成员同样落到 prim bigint(不再说 boolean)。 - dts 面 ⇒ bigint 契约的返回类型写成
bigint(此前是错的number)。 - zod / standard 面不变:bigint prim 无解码器 ⇒ 仍走「eq 主导」投影 ⇒ 节点仍是
{k:"lit", value:1n}(与 service 侧 Bug 1046 的 zod 面修复同口径)。 - 门禁的接受集不变:
lit(1n)仍只接受1n。但契约谓词现在与其它 prim 同款 带 typeof 义务(typeof x = "bigint" ∧ x = 1n)⇒ 实参类型不符时,除 literal 义务(x = 1n)外还会多报一条类型义务(typeof x = "bigint")——与lit(1)/lit("a")/lit(true)契约的既有行为同款(此前只有 bigint 字面量 契约缺这条类型义务)。
- guard 面:渲染成
-
f11510a: Reassigning a
constbinding declared inside a block scope now throwsTypeErroragain, in every block scope.- The
constNamesset that decides whether an assignment target is immutable was only computed for function bodies and plain blocks.try/catch/finallybodies andfor/for-of/for-in/while/do-whilebodies are block scopes too, but their statements were transpiled without recomputing the set, so aconstdeclared there was not treated as immutable. Assigning to it silently wrote the new value, and the throws domain was folded tonever. - Every block-scope emission point now recomputes the immutable-name set for
its own scope, the same way the plain-block path already did. A
constreassignment in those scopes throwsTypeError(and the entry point is reported asthrows TypeError), whilelet/varbindings and innerletshadowing stay mutable.
- The
-
5c750f2: Boxed primitives and prototype objects now look the way the language looks.
Object(1n)keeps its internal value.typeof Object(1n).valueOf()is"bigint"again, andObject(1n) + 1throws theTypeErrorthe language throws for mixing a bigint with a number.Object(Symbol("x")).descriptionis"x"instead ofundefined.Object.getPrototypeOf(Function.prototype)isObject.prototype.Error.prototypehas its ownnameandmessageproperties, soObject.prototype.hasOwnProperty.call(Error.prototype, "name")istrue.- The prototype chain of the built-in prototypes is no longer flattened:
Object.getPrototypeOf(Uint8Array.prototype)is notObject.prototypeany more. String(x)no longer reports a possibleTypeErrorfor every object.String(new Date(0)),String(new Map())and`${new Date(0)}`are all accepted, and they now agree with each other.Intl.NumberFormat.nameis"NumberFormat"andIntl.DateTimeFormat.nameis"DateTimeFormat", instead of the internal dispatch keyIntl.NumberFormat. The same applies toIntl.Collator.nameandIntl.Locale.name.
-
29d766d: fix(core): brand 接收者的「确定缺失」判定补齐(族 46 · Bug 1044 收口)
definitelyUncallableMember(evaluator$invoke的成员调用终判)此前首行if (s.k !== "obj") return false;⇒ 只判平 obj 接收者 ⇒ brand 接收者 的缺槽成员被调用时不记抛 ⇒ env 声明的 brand(Response/Headers/Blob/FormData/Request…)上调用宿主不存在的成员,原生恒抛TypeError,引擎却折unknown、零诊断 ⇒ L2 门禁假绿。典型形态:
Response.json(x).then(cb)——Response.json同步返回一个 Response 实例(brand),其内层槽表没有then⇒ 原生TypeError: Response.json(...).then is not a function⇒ 门禁应报错,实际不报。⇒ 同一个缺陷 env 侧表现不一致:web env 把
Response建成平 obj ⇒ 平 obj 规则早已判「确定抛」(web 假红);node env 建成 brand ⇒ 一律不判 (node 假绿)。本修法让两者口径一致。修法:brand 接收者 ⇒ 取内层 shape;内层是闭合 obj(closed + exact conf、无 open / index 键域)⇒ 走既有「表外 ⇒ 确定缺失」逻辑;内层不是 闭合 obj(
unknown/ prim / arr / open / 带 index)⇒ 维持现状(不记抛, 域不封闭 ⇒ 只能说「可能缺失」)。保守边界(缺席不可证 ⇒ 一律不判):
- Object.prototype 名(
toString/valueOf/ …)——原型上恒有; - 引擎已为该 brand 建模原型面者:内建 brand(
Date/Map/Set/Promise/ Error 家族 /ArrayBuffer族 /URL/URLSearchParams/TextDecoder/WeakRef/FinalizationRegistry/ typed array 族)、 装箱 brand(String/Number/Boolean/Symbol/BigInt)、Proxy(陷阱可给任意成员)、Intl.*子构造器、原型对象 brand (X.prototype/X.generatorProto)⇒ 它们的内层槽表不是可调用面全集; - 注册用户类(类注册表持有原型方法面,域不同)。
钉:新增回归钉(
eval-bug-1044-brand-missing-member.test.ts),覆盖 表外成员记抛 / 表内成员不记抛 / 内层unknown与 open obj 不记抛 (soundness 护栏)/ 平 obj 既有行为逐字不变 / 内建 brand 不误判 / L2 门禁面(nudo:entry-may-throw);并带同步守卫——引擎两张内建 brand 原型表的键集必须 ⊆ 排除名单(新增内建 brand 时漏同步 ⇒ 守卫变红 ⇒ 防止 「漏排除 ⇒ 合法调用被误判成确定抛」的假红)。已知偏差(诚实记录):本判定把 env 声明的 brand 实例面当作该 brand 的 完整可调用面 ⇒ 若 env 声明漏了宿主真实存在的成员(如 node 22+ 的
Response.prototype.bytes/textStream/Blob.prototype.textStream), 该成员会被判成「确定不存在」⇒ 假红。此偏差与 web env(平 obj 建模) 今天已有的行为完全一致(web env 的resp.bytes()已判「确定抛」) ⇒ 本修法只是让 node env 与 web env 口径一致;补齐 env 侧成员表即可同时 消掉两 env 的该条假红(env 包侧,不在本包范围)。 - Object.prototype 名(
-
e3b8791: Reading a member of a built-in prototype, a branded value or a namespace now returns what JavaScript returns instead of a confident
undefined.- A built-in prototype object had no table for its own members, so
Map.prototype[Symbol.toStringTag]returnedundefinedinstead of"Map",RegExp.prototype.flagsreturnedundefinedinstead of""andError.prototype.namereturnedundefinedinstead of"Error". The prototype objects of the built-ins now carry their own symbol members, their own data properties and their own methods. - A value of a built-in brand whose class was derived from a built-in — an
instance of
class M extends Set— lost the whole built-in prototype face:s.addreturnedundefinedeven though"add" in ssaidtrue. The two answers contradicted each other. The prototype chain is now resolved to the first built-in owner, and a member defined by the derived class still wins. Object.prototype.toString.call(Math)reported[object Math]butMath[Symbol.toStringTag]returnedundefined. A namespace object now exposes itsSymbol.toStringTag.Symbol.prototype.descriptionreturned the string"undefined"and did not record a throw; it now throws aTypeError, like the specification says.Map.prototype.sizeandSet.prototype.sizereturned"undefined"and did not record a throw; they now throw aTypeError.Intl.NumberFormat.prototype.formatreturnedundefinedand did not record a throw; reading a brand-check accessor of anIntlprototype now throws aTypeError.- A member that does not exist on a
number,booleanorbigintprimitive folded tounknown, which made every later read of that value look harmless. It now folds toundefined, so the later read is still recognised as a possibleTypeError. Symbol()instances resolvedtoStringandtoLocaleStringto the matching members ofObject.prototype, losing the brand check. The brand check is now performed.- The
constructorof a class value resolved to a built-in constructor named after the class, soWidget.constructor === Functionwasfalse. It is nowtrue. - A getter-only static accessor accepted a write; it now throws a
TypeErrorin strict mode, like the instance-level accessors already did. - The
prototypeproperty of a class value was missing its "not writable" flag, soA.prototype = {}silently wrote through. It is now rejected with aTypeError. process.envandprocess.versionswere shown asRecord<string, string | undefined>but readingprocess.env.HOMEreturnedunknown, and the difference was reported as a failed inference. The read now uses the declared index domain.- A host or namespace object such as
Mathonly projected its enumerable own properties, soObject.getOwnPropertyNames(Math)returned0andMath.PIcould not be read at all, even though the object was marked as exactly known. All own properties are projected now, and the descriptor flags are recorded, so the enumerable face still matches the original.
- A built-in prototype object had no table for its own members, so
-
e3b8791: Methods of a class are dispatched by the method itself, and the prototype of an instance is modelled.
- Calling a method that was taken off an object —
const m = o.m; m()— was reported as a definiteTypeError, and the same happened when the method was borrowed withcall,applyorbind. The method body is executed now, with the receiver the call site provides. delete X.prototype.mdid not remove the method from the registry, so the method was still readable, still reported as present and still callable. It is removed now, and calling it raises aTypeError.instanceofcompared the name of the constructor of the instance with the name on the right-hand side, ignoring the real prototype chain. AfterF.prototype = {}orObject.setPrototypeOf(f, null), the instance still was reported as an instance, and the answer was an exacttrue— a confident answer that sends a type guard down the wrong branch. The instance records its prototype now, the check follows that chain, and a prototype that cannot be decided folds tobooleaninstead oftrue. Assigning a non-object toF.prototyperaises aTypeError, as the specification says.new.targetinside an instance field initialiser was the class value instead ofundefined. The field initialiser is evaluated outside the constructor frame now, sonew.targetisundefinedthere, as in JavaScript.- A constructor of an unmodelled built-in, such as
Intl.Collator, was branded with an internal placeholder name. The placeholder leaked into the type of the value, into the generated declaration file and into the generated schema, where it made the product unusable. The brand carries the real name now, and the generated products no longer contain the placeholder.
- Calling a method that was taken off an object —
-
6e5344a: An anonymous class expression now takes its name from the binding it is assigned to, as in JavaScript.
const K = class { … }produced a class whosenamewas the synthetic"AnonymousClass", because the transpiler fixed the class name at emission time and never applied the language's NamedEvaluation rule. The same happened forK = class { … }and for{ K: class { … } }.- The binding name is now passed back into the class expression, so
K.nameis"K". A name written on the class itself (class Named { … }) still wins, and the name applies only to that class expression — a nested class expression inside the class body stays unnamed. - The visible
nameof a class is now separate from the internal class name the engine uses for its own bookkeeping: an unbound class expression has the empty name (""), like in JavaScript, while the internal name is still available for the emitted code.
-
7fea13a: Classes now behave like JavaScript classes with respect to computed field keys, static blocks, private names and async members.
- The computed key of an instance field (
class A { [k()] = 1 }) was evaluated per instance instead of once when the class is defined, so the field name could drift between two constructions and the side effects of the key expression were missing. The key is now evaluated once, at class definition time, and every instance installs the field under that key. Computed keys of static fields and methods keep their own evaluation point. - A
staticblock always ran after all static field initializers, so the source order of the class body was lost.class A { static { A.q = 1 } static r = A.q + 1 }foldedrtoNaN; it is now2. superinside astaticblock resolved against the instance prototype chain, so it read the wrong binding. It now resolves against the class prototype, like in JavaScript.- Private names were not scoped to their class: a private field of one class
could be read and written from another class, a derived class shadowed the
private field of its base class, and reading a foreign private field
returned a value instead of throwing
TypeError. Private names are now scoped to the class that declares them. - A
static asyncmethod was not wrapped in the async protocol, so it returned the raw value instead of a promise and athrowinside the body was thrown synchronously at the call site. It now returns a promise and rejects, like an instance async method. - An
async function*was compiled as a synchronous generator:next()returned a bare result object instead of a promise, the object had no@@asyncIteratormethod,Object.prototype.toStringreported[object Object]instead of[object AsyncGenerator], and the object wrongly offered the synchronous iteration protocol. Async generators are now compiled with the async protocol, in the declaration form, the function-expression form and the class-method form. The element domain of afor awaitloop over an async generator is taken from the generator instead of folding tounknown.
- The computed key of an instance field (
-
8bf3fd0: fix(core): 类与转译面四条精度债(族 59 · core 类与转译面)+ 族 57 第 8 条承接
四条精度债逐条修复(期望值均以 node v26.10.0 原生实测为锚):
- const 绑定的函数上的成员写(台账族 43 遗留 5):
const F = function(){};后写F.prototype = {}时,转译侧仍走根绑定重绑通道(引擎只对「用户层 直接赋值」建模 const 不可重绑,成员写走的是内部重绑)⇒ 写污染了根绑定。 原生:成员写是对函数对象的[[Set]],不动绑定 ⇒ 不报错、F.prototype被替换。引擎现在对「初始化器是函数表达式 / 箭头函数的 const 绑定」不重绑 根(该类绑定的值是引擎的 fn Abs,$set就地写 ⇒ 写不丢)。收窄口径:其余 const 绑定(值可能是需重绑的形态,如内建 brand)与let/ 函数声明维持 既有根重绑通道不动。 - body 编译路径的临时名避让(族 45 遗留 3):
exec/body-fn.ts的 body 转译单元不传source⇒ 引擎内部临时名(__nudoTm_{n}/__nudoE_{n}…) 的避让集恒空 ⇒ 用户标识符与引擎临时名相撞 ⇒ 产物是重复词法声明的非法 JS ⇒ 整模块 fail-closed。该路径现在从 AST 收标识符词形(body 内全部 Identifier + 形参)作为避让来源。 super.m()在删方法后(Bug 194 遗留):父类方法被delete后,super.m()折 unknown(看不出原生会抛)。原生:super.m is not a function⇒ TypeError(可被用户 try/catch 吸收)。引擎现在在父链 闭合(链上每个类都在注册表里)、无动态原型写、且该名不是 Object.prototype 成员时定抛 TypeError;任一条件不成立仍保守折 unknown (绝不假抛)。- 含内建父的类链(Bug 194 / 208):
class MyMap extends Map {}的实例 读不回内建父的条目面(.get/.size/.has折 unknown = 假阴性)。 根因有二:内建集合的条目表按 Abs 身份 驻留,而派生实例在构造时被 重铸成新 Abs(表丢失);内建方法派发按 brand 名直查(派生类的 brand 名是派生类名 ⇒ 落空)。现在构造链保持 Abs 身份(就地改 brand 名),调用面沿类链解析首个内建 owner 后派发(用户面同名方法仍优先)。 - 复合赋值到「根不可重绑」成员(族 57 第 8 条 · 归属 W9):
mk().x += 2的 transpile 走「根不可重绑」分支(foo().x的接收者不可重绑)——该分支 丢 compoundFn ⇒ 只发右值 ⇒ 表达式值折2(原生3)。现在改为 读-改-写:对象只求值一次(原生mk()只调一次)、旧值读 → RHS → 写 (原生 GetValue → RHS → PutValue 序);旧值不可判时算子折抽象(不把 「判不准」升级成确定值)。计算键形态(mk()[k] += 2)同款。
- const 绑定的函数上的成员写(台账族 43 遗留 5):
-
5749924: 族 21 收口接线:把各分片「越界发现」里明确交给主 agent 的接线项补齐 —— 以及一条真源缺口(672 的剥除面在 core,不在 CLI)。
Bug 672 的真源(core
strip-types.ts) ——nudo migrate strip --write写出的.jsNode 解析不了:private/public/protected/readonly/abstract/override/declare这些类成员修饰符原样保留,构造器参数属性 (constructor(private opening: number))也原样保留 ⇒ 产物仍是 TS。 现在:- 类成员修饰符被剥掉(只在类成员节点上删 —— 这些字段名在别的节点上没有 TS 语义);
- 构造器参数属性降级成「普通形参 + 构造器体开头补
this.x = x」 (TS 语义 =「字段 x + 构造器里this.x = x」;字段声明不必显式写 —— JS 的this.x = …就是动态字段,语义等价)。Babel 7 的TSParameterProperty包装节点与 Babel 8 的「修饰符直接挂在参数上」两种 AST 形态都认。
Bug 670 的越界(
nudo contract --json) ——runContractPrint完全不看opts.json⇒nudo contract --json把人类文本(<file>+ 每行签名)写进 stdout ⇒JSON.parse(stdout)抛错。--json是机器面 ⇒ 现在 stdout 是 合法 JSON({ file, entries: [{ fn, signature }] }),人类面不变。Bug 1026 的残留(
migrate的发现清单) ——migrate verify的扫描集合此前只 抄了产品默认安全排除 3 条里的 1 条(node_modules)⇒dist/与coverage/的 陈旧构建产物被当源码门禁 ⇒migrate verify(绿)与migrate retire装上的nudo check .(红)扫描的文件集合不同。现在补齐 3 条(另排除.git/.nudo)。Bug 928 的 test 面同机制 ——
nudo test --watch --from的调用点证据此前是 启动快照、每轮从不刷新 ⇒ 同一轮里两个文件对同一次调用给出相反裁决,且与同一 磁盘状态下的全新非 watch 运行结论相反。改为每轮开跑前重采(与nudo check --watch --from同口径);本轮证据缺失 ⇒ 本轮红。Bug 693 的钉真落在 watch 形态 —— 该钉原先用
node tsx/dist/cli.mjs <cli> … --watch起子进程:tsx 的 CLI 会把--watch当成自己/node 的旗标吞掉 ⇒ 子进程的process.argv里没有--watch⇒ CLI 根本没进 watch 形态 ⇒ 钉在测 非 watch 路径(假通过)。改用共享的 watch runner(node --import <绝对路径的 tsx loader>+ 显式追加--watch)⇒ 钉真的落在 watch 形态上;runner 另支持 「等 stdout 里出现一份可解析的 JSON」(谓词分开收 stdout / stderr —— 合并判断会被 stderr 的横幅干扰)。Bug 948 的文本面对称 —— 空目标集现在
ok:false+ 非零 exit ⇒ 文本面必须 有裁决行,否则出现「exit 1 但无 Result / 无 Summary」⇒ 与 JSON 面不对称。既有钉的契约适配(2 条) —— 695(信封
summary.errors不再含路径错误)与 672(真源修好后命令层闸门不再拦)两处契约变更使既有钉失配 ⇒ 按新契约改钉 (不是回退修复)。nudo init的文档漂移 —— 新行为(非法值被替换 / 拒绝遮蔽祖先可继承配置 / 拒绝越界写容器根)此前未写进文档 ⇒ 同步docs/design/cli-semantics.md、packages/website/docs/guides/cli.md、packages/website/docs/api/cli-reference.md(及 zh-Hans 版)。 -
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
2d96c29:
@nudojs/service新增公开导出absolutizeEnvSpec(env 规格的绝对化入口) ⇒ 纯增量(additive)⇒ minor。fix: 并发 review 收口的 10 条缺陷(闸门假红/假绿 · IDE/CLI 口径分裂 · 机器面谎报)
上一片(并发 review 收口 25 条 + 族 65/1094 两轮)之后又做了一轮并发 review(5 个分片 × 只读审查 + 逐条代码层复核)⇒ 查出 10 条该轮改动 引入或遗留的缺陷,本片一次性收口。核心仍是闸门可信度:
nudo check是 CI 闸门,假红卡死用户仓库、假绿让门禁空转。本片新增 7 个回归测试文件(全部含「修前红 / 修后绿」实测),另补 1 个 残留洞(指令作用域闸门)。
高危(4 条 · 闸门级)
-
构造器 may-throw 证据被整体丢弃且「归因落点」根本不存在 ⇒ L2 闸门假绿 (
core/algebra/check-may-throw.ts·core/algebra/scan-top-functions.ts·core/algebra/check.ts):实例方法桥把构造器跑在独立 may-throw 会话里 (软效果不进方法域 ⇒ 假红已消除),但硬抛(无条件throw)也被catch {}吞掉;而注释声称"归因给new C()入口"——该入口并不存在 (scan-top-functions.ts只登记Class.method,跳过 ctor)⇒export class A { constructor(x){ throw new TypeError("boom"); } }在 check 闸门与 test 见证面双面零诊断(0 error / 0 warning / exit 0)。 修法:新增类导出入口普查面listClassEntryNames(new C()是真实入口) ⇒ 类入口并入 L2 入口表(check.ts),构造器的硬抛进 throws 域、报在 类声明位置;构造器的软效果(any 补位的强制转换)仍不进 ⇒ 普通类 不触发 error 级nudo:entry-may-throw(假红不回归)。另:类入口的@nudo:throws申报落点 = 构造器 scope(C.constructor)⇒ 用户已申报不再被卡 (declaredThrowsForEntry)。 -
同一「裸实例兜底」在值域通道产出自信的错值 ⇒ 方法签名折
never+ 假红 (core/algebra/generalize.ts):兜底实例的内层是空 obj ⇒ 构造器写过的 字段被建模成「确定不存在」⇒this.v读成确定的undefined、this.v + 1读成确定的NaN;this.v.toFixed(2)在虚构实例上抛 ⇒ 签名never(谎称"该方法必抛、恒返回 never")⇒ 连带 error 级nudo:entry-may-throw。修法:兜底实例内层改 unknown(构造器写过的 字段 = 不可知,不是"缺槽")⇒ 不折确定错值、不在虚构实例上抛 ⇒ 签名落unknown,且方法体照常求值(不退化成整体 opaque)。与上一条同源,两处 就地复刻的孪生实现已互相点名,防止再漂移。 -
Proxy
getOwnPropertyDescriptor不变量新增规则的 3 处阈值错误 ⇒ 假红 (core/algebra/builtins/object/descriptor.ts):上一片新增的enforceProxyGetOwnPropDescInvariant在 Object 面与 Reflect 面同时接线, 三处口径与 node v26.10.0 不符 ⇒ native 不抛、引擎抛 TypeError ⇒ error 级nudo:entry-may-throw⇒ 直接卡 CI:- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
IsCompatiblePropertyDescriptor只在current.[[Configurable]]为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判; frozen被当成enumerable:false⇒Object.freeze只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);- 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒
defineProperty把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落configurable:true⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen不再改 enumerable;靶侧三标志 统一复用同文件currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
-
项目级 env 的「两层基准」只做了一半 ⇒ 分析器通道丢 env 全局 / IDE 与 CLI 结论相反(
service/src/analyzer-orchestrate*.ts·service/evaluator/env-loader.ts·lsp/src/validation.ts·lsp/src/agent-tools.ts):上一片把项目级 env 改为按项目根解析,但只改了预载侧;收集期仍用原始相对名查表, 而相对说明符只有唯一候选(按文件目录解析)⇒ 与预载登记的 key 不匹配 ⇒ 只要被分析文件声明了任何@nudo:env(哪怕是内建名node),项目级 path env 就对它完全不可见 ⇒ 返回面退never+ 假阳nudo:builtin-unknown; 同时 LSP 的env-unresolved诊断按「记录时的 preload 目录」归档 ⇒ 项目级 env 的失败被静默吞掉(IDE 假绿,CLI 同刻仍报)。 修法:绝对化规则收进env-loader.ts的单一 helper(absolutizeEnvSpec), 预载侧 / 收集期 / 缓存键 / LSP 注入 / LSP 诊断五处共用;LSP 诊断按fileEnvBaseDir + projectEnvBaseDir双取合并去重。改后 IDE 与 CLI 对同一 文件结论一致。
中危(4 条)
-
migrate strip --write把「未写盘」的成功行报成wrote(nudojs/src/migrate.ts·nudojs/src/commands/migrate.ts):库面在有失败时整批零写盘(原子性)并给 成功行附注记,命令层却把注记行当普通成功行推入results,人类面用opts.write ? "wrote" : "dry"无条件打wrote⇒ 同一行既说 "wrote" 又说 "not written",而磁盘上根本没有.js;--json侧只有一条自由文本notes能区分 ⇒ 机器消费方极易误判已产出。修法:新增机器可判定的writeStatus("written"/"not-written"/"planned"),人类面按逐行 状态措辞(wrote/not written/dry)。 -
HOF 元组元素域把已知的 null/undefined 压成
any(core/algebra/hof.ts): 引擎把null/undefined建模成unknown形状 + lit 项,而元素域按 shape kind 判"域是否可知" ⇒ 把已知类型误判成"域不可知" ⇒[null]的元素域从null退成any、[1,null]退成any(应为number | null);any是"自信的任意值",参与算术即强制转换 ⇒ 记 may-throw ⇒ L2 假红面。修法:三分类——已知 nullish(不参与异型判定、只贡献 可空性,用仓内既有makeSum表达联合)、真·推断失败(退unknown, 不是any)、其它(同型判定不变,异型仍退any)。 -
文件级指令的作用域闸门未覆盖
ArrayExpression/ObjectPattern/ArrayPattern(parser/src/directives/file-directives.ts·core/algebra/directive-scan.ts): 写在数组字面量 / 解构模式里的@nudo:env被静默提升成整文件生效(零诊断, 越权)。修法:两侧孪生闸门同步扩到三类嵌套体(两通道 23 组样例逐例一致)。 -
引理账本写入是「死写」(
core/algebra/check-return.ts):Φ 侧的消费在 证明段里记进账本,而调用方传入的consumedAssume快照取自调用之前 ⇒ Φ 侧的写入永远读不到 ⇒ 账本与归因两套口径(changeset 宣称的"经noteAssumeConsumed记进账本 ⇒ 归因可见"实际断在取数时序上)。 修法:归因集就地取账本(读在写之后)⇒ 账本是"消费过"的唯一事实源, 调用方快照退化为兜底。
验证
- 全仓
tsc --noEmit(pnpm run lint)0 错误;pnpm run buildexit 0; pnpm run test全量绿(1757+ 文件 / 14500+ 用例,exit 0);- 新增 8 个回归测试文件,全部修前红 / 修后绿实测(红数由回滚修复逐条复核):
core-bug-1095(Proxy 阈值,22 例 · 修前 12 红)、core-bug-1096(构造器 归因,11 例 · 修前 6 红)、core-bug-1097(HOF 元素域,15 例 · 修前 10 红)、core-bug-1102+parser-bug-1101(指令闸门,79 例 · 修前 12 红)、core-bug-1103(引理账本,5 例 · 修前 1 红)、service-bug-1098+lsp-bug-1099+lsp-bug-1104(env 两层基准,11 例 · 修前 6 红)、nudojs-bug-1100(migrate strip 写盘状态,6 例 · 修前 5 红)—— 合计 149 例; - 产品 CLI 面逐条复现核对:
nudo check对"构造器必抛"报 error 级nudo:entry-may-throw(归在类入口)、对"构造器软 throw"零 error; Proxy 三场景(可配置靶异形态 / 冻结靶 / brand 靶)零 error;migrate strip --write失败批输出not written且磁盘零写盘、--json带writeStatus: "not-written";项目级 env + 文件级 env 并存时nudo check得f() => 42(修前为never+ 假阳)。
已知边界 / 未闭合
- Proxy
gOPD仍有 3 处漏抛(靶不可扩展且键不存在时报configurable:true; 靶不可写+不可配置而陷阱省略value;靶为不可配置访问器且 get/set 身份不同)—— 基线同样不抛(非本次回归),新增抛点有制造新假红的风险 ⇒ 已把 node v26.10.0 实测矩阵写进core-bug-1095测试文件注释,留待单独立项。 - 不可配置访问器靶现在也会比对
enumerable(原生确实抛)——属收紧, 若有用例依赖旧的"访问器靶跳过该比对"需按原生重判。 - HOF 异型元素仍退
any([1,"a"])——既有保守口径,本片未窄化成联合。 - 真·未知 ⇒
unknown会让该 α 恰为返回类型时多一条 warning 级nudo:unknown-inference(级别 warning,不影响 L2 闸门)。 - 进程级
lastEnvBaseDir单槽(同步analyzeFile路径下的文件级相对名) 与 Windows 下isPathEnvName只认/均为既有基线,本片未动。 - MCP
nudo check工具面(同步、无 path env 预载)与migrate strip --json顶层形态不统一(成功=裸数组 / 失败=对象信封)仍待单独立项。
-
-
e3b8791: Destructuring, array holes and the length of a union are now modelled the way JavaScript models them.
Array.prototype.sortandtoSortedturned the holes of a sparse array into elements, so the array gained a key,inreported the key as present and the higher-order methods stopped skipping it. The holes stay holes.- The rest of an object destructuring did not call the getters, so the side effects of the getters were lost. The getters are called now.
- A property written to an array under a key that is not an index was
dropped, and reading it back reported a confident
undefined— a value that is narrower than the truth and contradicts the engine's own rule that it must not be falsely precise. Reading it back is not precise any more, and the write is no longer dropped. - The
lengthof a union was read asnumber, whatever the members were, so a contract ofnumber()was always accepted and nothing was ever reported. The length of each member is kept now.
-
f6538a2: fix(core): 宿主函数面的
constructor与普通对象的符号键槽寻址(族 57)族 57 的 8 条容器 / Proxy / 符号键精度债,本片(core ·
exec/runtime/containers/**) 落了两条修法(其余六条已是原生或修法落在别的分片,见下):- Bug 234 · 宿主函数面 / 命名空间面的
constructor(packages/core/src/algebra/exec/runtime/containers/member.ts): 此前f.constructor/g.constructor落unknown(宿主函数面没有constructor臂),Number.constructor/Math.constructor落通用成员读 (抽象 fn 面 ⇒.name是抽象串)。现在按宿主真值取构造器名 (hostCtorNameOf):普通函数 →Function、生成器 →GeneratorFunction、 async →AsyncFunction(转译后声明是宿主普通函数 ⇒ 种类读 Bug 325 的fnKind戳,不猜)、Number→Function、Math/JSON→Object⇒f.constructor === Function折true、.name折精确串。 - 外-02 ① · 普通对象面的符号键槽寻址
(
packages/core/src/algebra/exec/runtime/containers/arr-index.ts+ 新增containers/symbol-slot.ts):propertyKeyOf对 symbol 返 undefined ⇒ 符号键写被丢弃(对象标 open)、读落抽象下标投影(unknown)。 现在符号键有内部槽键通道:well-known 符号 →"@@X"(与转译侧静态投影 同源),用户符号 →"@@sym#<身份 id>"(Symbol("x")每次是新符号 ⇒ 每次 新 id;Symbol.for("x")是驻留符号 ⇒ 同一 id,同键)⇒const s = Symbol("x"); const o = {}; o[s] = 1; o[s]折1(原生同款), 且符号槽带symbolKey标记 ⇒ 字符串枚举面不可见(Bug 73 口径)。
口径与边界:
- sound 优先:所有新读面在「键不可判」时仍折
unknown/undefined, 不把「判不准」升级成确定值;Proxy 面按规范把真 symbol 传给陷阱 (Bug 149),不走槽寻址。 - 本片未动的两处(修法落在别的分片的文件范围,已在报告里给出精确改点):
in/delete的符号键通道(exec/runtime/members.ts)与mk().x += 2的复合赋值(exec/transpile/expr/assignment.ts)。 - 公共 API 冻结面零变更(无新增导出)。
- Bug 234 · 宿主函数面 / 命名空间面的
-
e3b8791: Control flow and the loop invariants now carry the facts JavaScript guarantees at those points.
- A
breakinside atryblock was swallowed by thecatchblock: the body of thecatchran and the loop did not leave. A control flow signal is not an exception, so it is not delivered to acatchblock now, and the loop leaves as it should. - The write to the loop variable of a
for (let i …)loop before acontinuewas dropped, so the loop ran a different number of times and produced a different result. The latest value of the loop variable is written back when the body is left, and thecontinuebranch uses it. - The invariant of a
@nudo:invariantdirective was silently dropped in awhile, ado..whileand afor..ofloop, so a function could not prove what its own invariant promised. The invariant is applied when the loop is left now, in all loop forms. - An invariant whose predicate contradicts the other facts was baked into the value, and a contradiction proved anything: a real violation of a contract was reported as proven. Contradictory facts are no longer merged, so a contradiction can no longer prove a violation away.
- The
switchstatement did not narrow the value in an arm, and the branch that was not taken did not narrow it either, so the code after the switch was analysed against a value that could never occur there. The arms now know the value they matched and the value they excluded. - The facts of an early return did not reach the path that follows it, so
if (x <= 0) { return 1; } return x;was reported as violating a contract that the equivalentif/elseform satisfied. The path after an early return now knows the negation of the guard, in every block the early return is written in.
- A
-
2af2bae:
nudo checkno longer dies on an assignment whose recorded value is not an abstract value, so one bad file can no longer cut a whole check run short.- The assignment channel records the runtime value of a binding and of
the right-hand side. Those values are abstract values for ordinary
expressions, but they are plain host values in two cases: an environment
global that is a function or a constructor (
parseInt,String,Promise,setTimeout, …) is injected as a host function, and a function declaration is an ordinary host function object after transpilation. The structural-assignment gate assumed every recorded value was abstract and read.shapeon it, solet g = parseInt; g = 1;orf = h(withha function declaration) threw aTypeErrorthat killed the wholenudo checkrun — no signatures, no diagnostics, and every file queued after the failing one was never analysed. - The gate now checks that a recorded value is abstract before reading its shape. A recorded host value carries no comparable shape, so the record is skipped (fail-closed): the run continues, the remaining files are checked, and assignments between abstract values are still reported as before.
- The assignment channel records the runtime value of a binding and of
the right-hand side. Those values are abstract values for ordinary
expressions, but they are plain host values in two cases: an environment
global that is a function or a constructor (
-
2af2bae:
nudo checknow compares@nudo:casewitnesses against field-level and shape contracts, and splits multi-line or escaped case arguments the same way the shared single source does. Violating witnesses used to be dropped silently, so a check run could pass with zero diagnostics while the witness contradicted the contract.- Field-level / shape contracts were skipped as a whole. A contract with
a
fieldsshape was skipped by the witness scan, so the case face carried no obligation at all for it. A witness that contradicted the shape — a field of the wrong type, or a missing field — was never reported. - Non-literal arguments were normalised to
unknownand then skipped. Object and array literals are now parsed into real abstract values, so a witness such as{ a: "x" }is compared with the contract instead of being dropped. A missing field is reported asmissing field <path>and a field whose type does not match astypeof <path> = "<prim>", matching the wording of the call-site face. - Multi-line case arguments were never checked. The argument text handed
over by the shared directive scanner still carries the JSDoc continuation
prefix (
*), so the arguments could not be parsed and the whole witness was skipped — the same witness written on a single line was reported correctly. The prefix is now stripped before the arguments are split. - The check face split arguments differently from the shared single
source. Its private splitter treated
\as an escape character, so"a\", -1produced one argument instead of two and the violating witness on the second argument did not exist — the L2 witness gate passed on a contract violation, whilenudo testsaw a different argument list. The check face now uses the same splitting rules as the parser. - An argument that cannot be parsed is no longer skipped silently. When
an argument on a contract slot cannot be parsed, or when the case supplies
no argument for that slot at all, the scan now reports a visible
nudo:directive-syntaxwarning instead of dropping the obligation.
- Field-level / shape contracts were skipped as a whole. A contract with
a
-
2af2bae: Five
nudo checkdiagnostics that never fired now fire, and three false positives / wrong paths are gone.- Call-site verification is no longer dead code (Bug 364).
checkArg/checkCallhad no producer, so the documented call-site verification surface was silent:nudo:arg-countand friends never appeared innudo check. The call-site scan now runs the generalized parameter face check as well (nudo:arg-countfor a missing required argument, the argument obligation codes,nudo:partial-resultas info). Argument counting uses the required arity (default and rest parameters do not consume an argument slot), extra arguments are a warning rather than an error (JavaScript allows them), andcheckArgnow aligns the expected predicate with the argument's own term so a non-literal argument is no longer reported asnudo:constraint-unprovenfor a constraint it may well satisfy.nudo:fn-not-foundstays on the public API only — whether a callee resolves is decided by the call-site scan. Errorcovers user-defined Error subclasses (Bug 365).@nudo:throws Errorandpackage.json#nudo.check.ignoreThrows: ["Error"]promisedinstanceofsemantics ("covers every subclass"), but coverage was decided with a static set of built-in names, soclass MyError extends Error {}was not covered and the L2 gate reported a false positive. The decision now walks the runtime inheritance chain.- A bounded return obligation is only "disproved" when there is bound
evidence (Bug 370). The check asked "is there a predicate at all", so a
typeofpredicate counted as falsifiable evidence: the same obligation was an error forreturn xand a warning forreturn x + 1. With an unboundedxthe obligation can neither be proven nor disproved, so the evidence test now looks for an actual bound (gt/ge/lt/le) in the combined evidence (Φ ∧ ret.pred). - CI annotations no longer point at a file that does not exist (Bug 373).
The GitHub Actions / GitLab Code Quality path trimmed the workspace root
with a bare
startsWith, so a sibling directory (appvsapp2) was trimmed to2/src/x.js. The prefix now has to end on a path boundary. - Signature details no longer report the wrong function name (Bug 377).
The signature format cache was keyed by the
Absobject identity, but the cached detail embeds the function name, so the second and third function sharing onenevervalue showed the first function's name. The cache key now covers the function name as well.
- Call-site verification is no longer dead code (Bug 364).
-
2af2bae: Return-contract diagnostics now carry the position of the function they belong to, name the constraint source they really came from, and only claim that a proof relied on a user lemma when the proof actually consumed it.
- Position.
checkSourcebuilt its return-contract issues without aline/column, so every consumer fell back to the top of the file: the LSP drew the diagnostic at line 1 column 0,nudo check --ghaannotatedline=1,col=1, GitLab Code Quality reportedlines.begin: 1, and--jsonemitted no position at all — even when the offending function was declared on line 10. The issues are now built with the declaration position of the function, so the LSP, the CI annotations and the JSON machine contract all point at the real line. - Constraint source. The message of a violated return contract always
said
@nudo:contract return <name>, even when the constraint came from the return slot of a sidecarfn({...}, <ret>)binding — a directive that does not exist in the source file. The message now names the real source:@nudo:contract return <name>for a source directive,sidecar fn() return slot (...)for a sidecar return slot. - Lemma attribution. The
nudo:assume-reliedaudit note claimed that a proof relied on a user lemma whenever the function declared one and the return contract happened to be provable — even when the lemma took no part in the proof (return 0is provable regardless of@nudo:assume d <= max). The engine now records which lemmas a proof actually consumed and attributes the note to those, so an unused lemma no longer produces a false "proved via @nudo:assume" claim. The proof result itself is unchanged: the note is an audit annotation, not a gate.
- Position.
-
2af2bae:
nudo checknow sees assignments inside function bodies, judges generated segments against cross-file call sites, and points diagnostics at the offending directive.nudo:assign-mismatchonly covered module top-level assignments: the assignment recorder was installed around the top-level evaluation, but function bodies had already been evaluated (by the generalizer) before that, so every$assignRecordfrom a function body was dropped. Real code assigns mostly inside functions, so the check reported "OK" on functions that assign a string to a number. The recorder is now installed before the function loop, and repeated evaluations of the same assignment site are folded into one diagnostic.nudo:interface-driftnever fired when the call site lived in another file: the "today" evidence came only from evaluating the checked file itself, so a generated segment written with--fromcould not be judged stale.CheckOptions.fromnow carries cross-file call-site records into the same judgment; records are attributed to the checked file, so a same-named function in another module cannot pollute the verdict.nudo:assume-invalid,nudo:invariant-invalid,nudo:contract-syntaxandnudo:interface-conflictcarried no position: the LSP drew the red squiggle at line 1 column 1 andnudo check --jsonreportedissues[].line: null, even when the offending directive was on line 7. All four codes now report the line and column of the directive that caused them.
-
2af2bae:
nudo checkno longer treats "this entry was never analysed" as "this entry cannot throw".- Class instance methods were invisible to the L2 entry gate. The
evidence collector only had a static method bridge (
$staticInvoke). That bridge answers "unknown" — without throwing — for a method that is not a static method, so an instance method produced no throws evidence at all. A public method with an explicitthrow new TypeError()therefore passednudo checkwith exit code 0, while the same throw in a top-level function of the same file was reported. The class branch now also has an instance method bridge (class value →newwithanyconstructor arguments → invoke), and decides static vs. instance from the class declaration in the source — at runtime the two cannot be told apart, because the static bridge reports "unknown" for a method it does not own. The same file's static methods and top-level functions are unaffected. - A method that always throws now has an honest signature. The
generalisation path swallowed the throw and reported the method as
unknown("inference failed"). It now reportsnever, matching how a top-level function that always throws is reported. - A construct the transpiler rejects no longer turns the gate green. If
the transpiler refuses a construct, the whole module is left unanalysed;
the entry gate used to read that as "no may-throw evidence" and stayed
green, so two expressions differing only by a
++got opposite verdicts. The transpiler's reason for refusing is now observable, and an entry that could not be analysed is reported as "may throw Error" — a sound over-approximation, since an unanalysed entry cannot be shown to be total.@nudo:throws Erroror--ignore-throws Erroraccepts it explicitly.
- Class instance methods were invisible to the L2 entry gate. The
evidence collector only had a static method bridge (
-
2af2bae:
nudo checkno longer reports an assignment that only fails a refinement it never carried, and no longer attaches the callee's own precision to every call site.- Assignments are compared by shape.
nudo:assign-mismatchused to demand that the new value also imply every refinement the previous value carried. That refinement is usually a fact about the caller's variable, not a constraint on the binding being assigned: inms@2.1.3the statementstr = String(str)compares a newstringagainst an oldstringwhose refinement saidtypeof text = "string"(derived at the call siteparseAge("2d")). The two have the same shape — the assignment is sound at runtime — yet the gate reportedstr: assignment ⊭ existing shapeand turnednudo check docs/examples/retire-real/after/src/age.jsred. The gate now compares the shape of the binding, which is what its own message promises: shape changes (let n = 1; n = "str"), missing members (let a = {x: 1}; a = {y: 2}) and element retypes are still reported, and conditional reassignments are still exempt. - Call sites no longer report the callee's precision. Wiring the
call-site verification into
nudo checkalso started emittingnudo:partial-resultfor every call whose callee had a partial or opaque result. That is the callee's own precision problem, not the call site's, and it filled the info channel with one line per call — it moved the documentednudo checksummary of the troubleshooting and errors-versus-TypeScript guides from0 info/1 infoto1 info/2 info. The product path no longer emits it. The code and thecheckCallpublic API that has always reported it are unchanged.
- Assignments are compared by shape.
-
e424592: File-level
@nudo:directives no longer evaporate in silence: the mock-module payload grammar accepts single quotes, the env payload grammar accepts space-separated lists, block-comment@nudo:importis ignored instead of taking effect, and an empty@nudo:importpayload is diagnosed.@nudo:mock-module 'axios' from './mocks/v-axios.js'was silently dropped. The two payload regexes hard-coded double quotes, so a single-quoted payload matched neither and the directive returnedundefined. The mock was never installed, no diagnostic was raised, and the gate stayed green. Single quotes are now accepted (the source and the path may even use different quote kinds), and an unparsable payload now raisesnudo:directive-syntaxinstead of vanishing.@nudo:env node webwas silently dropped. The payload was split on commas only, so a space-separated list became a single token and was filtered out; a bare/// @nudo:envtag did not even match the tag regex. Both forms were discarded with no diagnostic, so no environment was loaded and everything stayedunknown. Commas and whitespace are now both accepted (trailing comments are stripped), and a bare tag raisesnudo:directive-syntax.@nudo:importinside a block comment took effect. The text scanner flattened line comments and block comments into one list and dropped the comment kind, so a block-comment import really loaded its sidecar — the opposite of@nudo:env/@nudo:mock-module, which the AST channel ignores in block comments. Comment kinds are now kept apart: line comments take effect, block comments are ignored and warned about./// @nudo:importwith an empty payload was silently discarded. The payload was dropped before the malformed-import scanner could see it, so the malformed form had no diagnostic while other unrecognised forms of the same directive did. The empty payload is now reported as a malformed import and raisesnudo:contract-syntax.
-
e424592: Function-level
@nudo:directives now bind to the right function again: a statement-level JSDoc on a multi-declaratorconstbinds to the first declarator only, an inline JSDoc on an arrow initializer binds to the binding name, a shadowing function no longer steals the exported function's@nudo:throws, astaticmethod and an instance method of the same name get distinct directive scope names, and the CommonJS assignment form (exports.f = function) keeps its directives.- One JSDoc was bound to every declarator of a multi-declarator
const. The statement-level comment was copied to each declarator's scope, soconst a = () => 1, b = () => 2under@nudo:case "shared"produced the same witness twice —nudo testprinted the case underaand underb. The statement-level JSDoc now binds to the first declarator only (the TypeScript ground truth); a later declarator keeps only its own inline comment. - An inline JSDoc on an arrow initializer was registered under
<anonymous>. The variable-declaration branch built a scope named after the variable but read the statement's leading comments, while the inline comment sits on the arrow node itself — so the witness landed on the<anonymous>scope andnudo testprinted=== <anonymous> ===. A declared function now has exactly one scope, named after its binding, and both the statement-level and the inline comment are visible on it. - A shadowing function stole the exported function's
@nudo:throws. Directive scopes are looked up by name, and the first match in document order won, so an innerfinside another function took the comment block of the exportedf— the exportedfthen inherited@nudo:throws *and the L2 entry-may-throw gate stayed green while the function really threw. Scopes now carry their lexical nesting depth and a name lookup takes the shallowest match, which is the same function the analysis side registers. - A
staticmethod and an instance method of the same name shared the directive scope nameC.m. Only one@nudo:contractsurvived and it was applied to both methods, so the static method's contract was reported against the instance method (nudo:interface-param-mismatch). When a class has an instance method of the same name, the static method's scope is now namedC.static.m; the instance method keepsC.m, matching the name-census surface, which registers only the instance method on a name collision. - The CommonJS assignment form lost every function-level directive.
exports.f = function (x) { … }has no binding name to take, so the scope was named<anonymous>and the lookup by the exported nameffound nothing: the L1 contract silently did not apply (green gate), a@nudo:throwsdeclaration did not suppress the L2 gate (red gate), and the@nudo:casewitness evaporated entirely — with no diagnostic in any of the three cases. The CommonJS export slot (exports.f,module.exports.f,module.exports) is now used as the binding name, and the statement-level comment is attached to that scope.
- One JSDoc was bound to every declarator of a multi-declarator
-
e424592:
@nudo:casewitnesses no longer evaporate in silence: an escaped quote in an argument no longer swallows the whole case, the=> expectedpart is read on CRLF sources, on the next line and behind a!! throwssuffix, redundant brackets around the expectation are stripped, and a glued@nudo:case"name"tag is diagnosed instead of vanishing.@nudo:case "k" ("a\"b") => 3was dropped entirely. The bracket scanner was string-aware but not escape-aware, so the\"inside the string ended the string, the bracket closed early and the whole case was discarded. What remained on screen was a misattributed "unclosed argument list" warning. Balancing now follows JavaScript escape semantics first; a string that never closes (not valid JavaScript) still falls back to the previous lenient reading, so the argument count seen by the check face and bynudo teststays the same.=> expectedwas lost in a CRLF source file. The line was split on\nand the trailing\rstayed in the expectation text, so the expectation failed to parse and was dropped: the case became[unchecked], the assertion never ran,nudo testexited0and nothing was reported. Lines are now split on\r?\n.- A
!! throws [Kind]suffix on the case line was read as the expectation text. With the suffix before=>the expectation disappeared entirely; with the suffix after=>the text1 !! throwswas parsed and rejected. The suffix is now stripped from the expectation expression only — the case line itself is never rewritten, so the function-level!! throwsdeclaration still sees it. => (999)/=> ("a")/=> ({ b: 1 })never parsed, because the expectation kept its outer brackets while the argument side had always stripped them. The expectation now drops its redundant outer brackets, the same way the arguments do. An arrow function ((x) => y) is left alone.- An expectation on the line after
=>was silently discarded, and an expectation that was written but empty was discarded just as silently. The value is now read from the next line, and an empty=>is reported asnudo:directive-syntaxinstead of passing unnoticed. @nudo:case"c1" (1, 2)— no space between the tag and the name — was neither extracted (the extractor requires a space) nor reported (the diagnostic side accepted it). The case vanished with no diagnostic andnudo testran no case at all. Both sides now share one grammar, and the glued form is reported asnudo:directive-syntax, the same way a glued@nudo:mockname is.
-
e424592: Malformed
@nudo:directives are diagnosed instead of evaporating in silence: an empty or glued@nudo:assume/@nudo:invariant/@nudo:contract/@nudo:throwsnow raises a syntax diagnostic, and a!! throwssuffix is only read where it is actually a directive.@nudo:assumewith an empty payload, or@nudo:assumed d <= max(a space missing between the tag and the payload), matched no branch at all: the scanner returned nothing and nothing was reported. The lemma was dropped without a word, so the return contract fell back from "proved" to "unproved" and the only sign was anudo:unproven-returnwhose text blamed inference precision instead of the rejected lemma. An empty or glued@nudo:assume/@nudo:invariantnow produces a bad segment and raisesnudo:assume-invalid/nudo:invariant-invalid; a glued or empty@nudo:contract/@nudo:throwsraisesnudo:contract-syntax/nudo:directive-syntax. The strict grammar is unchanged — a tag still needs a separating space — the loose forms are only reported.!! throwswas matched anywhere in a function's comment block, so a prose line ("this helper uses!! throws") or a case name that happens to contain that text was read as a function-level throw declaration. The declaration then covered every throw,filterGateThrowslet them all through, and thenudo:entry-may-throwgate was silently switched off while the signature still printedthrows TypeError. The suffix is now only read where it is a directive: after the argument list of a@nudo:caseline, or on the continuation line of such a case. The documented case-suffix form (@nudo:case "neg" (0) !! throws) keeps working exactly as before.- The same glue was invisible to the inline directives of the parser package:
@nudo:replaceFoo x number()matched neither the strict nor the loose pattern, so the whole inline directive disappeared. It now raisesnudo:directive-syntax. The@nudo:asside keeps the behaviour already merged for Bug 842: a tag whose name is extended (@nudo:asXYZ) is not an@nudo:asdirective and stays silent.
-
ec0a9e4: fix(core exec/class): 派生构造器 super 通道、实例字段自有数据属性、构造器对象返回值、bind 产物可构造、Proxy construct 靶判定、super.constructor 取父类
- Bug 245:派生类构造器未调
super()/ 重复调super()定抛ReferenceError(原生 "Must call super constructor…" / "Super constructor may only be called once")——引擎此前无「本帧已调 super」状态通道,两者皆静默通过。状态走class/declare.ts的模块级 WeakMap 侧表(不改公共类型;class/super.ts的$super标记 +constructClass终判)。 - Bug 247:实例字段落地改走 CreateDataPropertyOrThrow 语义(自有数据属性,不沿原型链派发 setter)——父类同名 getter/setter 不再拦截字段落地(此前 getter-only 假抛
TypeError、setter-only 把字段写穿到父类 setter)。 - Bug 250:宿主构造器 / 可构造 fn Abs 的返回值判定放宽为「是 Object 就用它」(
obj|arr|tuple|fn|brand|eff)——构造器返回数组 / 函数不再被静默换回this。 - Bug 253:
Function.prototype.bind产物可构造——原生new (f.bind(thisArg, ...bound))()走目标的[[Construct]](新实例 + 绑定实参前置 +this= 新实例);构造 facet 走class/declare.ts的模块级 WeakMap 侧表(不改公共类型AbsFnImpl)。 - Bug 257:
$new的 Proxy 分支先判 IsConstructor(target)——靶不可构造时定抛TypeError且不派发 construct 陷阱(此前陷阱照常派发、副作用发生、构造"成功")。 - Bug 266:
super.constructor取父类构造器(父类值注册表)——此前回落内置Object(Sub.who() => "Object"、super.constructor === Base假 false)。
- Bug 245:派生类构造器未调
-
ec0a9e4: fix(core): 族 03 exec/class 分片 E2——244 / 258 / 263 / 264 / 1035 / 1041
- 244 原型 / 实例上的方法写(
A.prototype.m = fn/a.m = fn/this.m = fn)此前在派发面被完全忽略 ⇒ monkey-patch 静默失效(跑的还是 注册表里的旧方法体;写成非函数也不抛)。派发面改为按原生查找序 own → prototype 查「实例自有槽 / 原型链数据槽」,命中即按用户写的值调用, 非函数则定抛 TypeError。 - 258
Function.prototype.apply的 array-like 实参此前只折 1 个未知 实参 ⇒ 实参面塌陷(f.apply(null,{length:2,0:1,1:2})原生传 2 个)。改为按length(字面量)逐下标取实参,缺席下标折 undefined;length 抽象仍保守 折 unknown。 - 263 union 方法分派的成员判据此前只认
string(method形参根本没被 使用)⇒ number / boolean / bigint / symbol 成员上的方法(toFixed / toPrecision / toExponential …)在 union 上一律被判「missing」⇒ 成员被提前 排除、值域塌成 unknown + 诊断点名错成员;反过来 string 成员被无条件放行 ⇒ string 上不存在的方法也被判「有」。判据改为按各 prim 类型的真实原型方法 表判定,被判「确定没有」的成员按原生记 TypeError may-throw(该分支定抛) 并跳过该成员。 - 264 内建命名空间对象上调用不存在的静态方法(
Math.clamp/JSON.foo/Object.foo…)此前回落 unknown 且不记 throws ⇒ L2 门禁 假绿(引擎声称不可能抛,原生恒抛 TypeError)。改为定抛 TypeError;成员 存在但不是函数(Math.PI())同抛;成员存在且引擎未建模仍保守折 unknown。 - 1035 类值接收者(
A.m())的派发此前先查实例方法表 ⇒ 同名 static + 实例方法并存时跑错方法体、抛错方向双向反转。改为类值接收者先查静态面 (静态方法表 → 类值自有槽 → 内建父构造器 → 静态访问器),静态面确无该 成员时定抛 TypeError(原生A.m is not a function)。 - 1041 摘下的一等方法值(
const f = A.m)在同名 static + 实例方法并存时 定抛 TypeError(原生正常返回)⇒ L2 门禁假红。方法值的来源侧 (static / inst)随值传到派发面(protoMethodDispatch的 origin 参数), 摘下调用按来源侧定方法体,不再「不可判」。
- 244 原型 / 实例上的方法写(
-
ec0a9e4: Borrowed
String.prototypeandError.prototypemethods no longer throw where the language does not, and borrowedArray.prototypemethods now follow the spec on non-array receivers.- The brand-check table treated the whole
String.prototypeas brand-checked, so every one of its 30 generic methods threw aTypeErrorwhen borrowed onto another value (String.prototype.toUpperCase.call(1)is"1"natively). OnlytoStringandvalueOfreally require aStringreceiver; the rest are generic (RequireObjectCoercibleplusToString) and are now dispatched on the coerced receiver. Error.prototype.toStringis an ordinary method: it readsthis.nameandthis.messageand has no brand check. Borrowing it onto a plain object threw aTypeErrorinstead of returning"X: y". The error family no longer takes part in the brand check, and the generic implementation is used for object receivers.- The
Array.prototypemutators (push,pop,shift,unshift,splice,sort,reverse,fill,copyWithin) threw aTypeErroron every primitive receiver. Only a string receiver throws, becauseToObject("ab")has a non-writablelength; every other primitive becomes an ordinary extensible object, sopush.call(5, 1)is1andpop.call(5)isundefined. Array.prototype.concatspread the receiver even when it was not an array, soconcat.call("ab")produced two elements instead of one. The spec only copies the receiver's elements whenIsArray(O)holds; otherwise the receiver is appended as a single element.sort,reverse,fillandcopyWithinoperate in place and return the receiver, but a non-array receiver was materialized into an empty array. They now return the receiver itself.Array.prototype.withalways throws aRangeErroron a primitive receiver, because the receiver's length is0and the index is out of range. The engine reported no throw at all, so the L2 gate reported a false green.
- The brand-check table treated the whole
-
ec0a9e4: fix(core): 数组方法族六处原生语义偏差(Bug 248 / 254 / 255 / 270 / 1040 / 1051)
- Bug 248:HOF 回调族(forEach/map/filter/reduce/reduceRight/some/every/
find/findIndex/findLast/findLastIndex/flatMap)逐位读当前容器(原生
Get(O,k)/HasProperty(O,k)逐步现读),不再用进体前快照的元素表;for..of走数组迭代器的 live 视图(next()每步重读长度)⇒ 体内变异 对后续迭代可见。 - Bug 254:mutator 家族(push/pop/shift/unshift/splice)的泛型接收者
(数组样对象
{length, 0: …})写面按 spec 落地(Set(O,"length",n)/CreateDataPropertyOrThrow/DeletePropertyOrThrow),不再静默丢弃写入; 不可判定形态(open obj / 抽象 length / 访问器侧表)记 may-throw 后不写。 - Bug 255:
Array.prototype.fill()零实参不再整条跳过(原生把整条数组 填成 undefined、length 不变);缺省 value 取「确定 undefined」。 - Bug 270:
toSpliced/splice的删除窗口走同一实现(spliceWindow)——toSpliced()零实参 ⇒ start 缺省 ⇒ 不删;toSpliced(0, undefined)⇒ skipCount 在场(undefined ⇒ 0)⇒ 不删(此前把整条数组删空)。 - Bug 1040:
includes(searchElement, fromIndex)补 fromIndex 校验(bigint / symbol 确定 TypeError)⇒ L2nudo:entry-may-throw门禁不再假绿。 - Bug 1051:
lastIndexOf(x, undefined)的起始下标按原生取 0(fromIndex 缺省 ⇒ len-1;显式 undefined ⇒ 0)——fromIndex 引入「缺省 / 显式 undefined / 数值」第三态(toIOIArg)。
- Bug 248:HOF 回调族(forEach/map/filter/reduce/reduceRight/some/every/
find/findIndex/findLast/findLastIndex/flatMap)逐位读当前容器(原生
-
ec0a9e4: fix(core): 字符串 / 正则方法族的 4 处语义偏差(族 03 Bug 249 / 251 / 252 / 1042)
- 249
String.prototype.matchAll的结果补上迭代器协议面(原生 RegExp String Iterator):next(按游标推进,耗尽 →{value: undefined, done: true})、@@iterator(返回自身)、@@toStringTag("[object RegExp String Iterator]")。 此前只挂 brand 名 + 元素侧表 ⇒typeof it.next折 exact"undefined"(wrong-exact)、it.next()折 unknown。协议槽按原型语义建模(internal 槽:Object.keys空 /hasOwnProperty假 /in真)。 - 251
toLocaleString/toLocale*家族的值与locales 实参校验: number 臂此前把toLocaleString重定向成宿主toString⇒ 丢千分位 /-0/ 指数形态((1234567.5).toLocaleString()→"1234567.5",原生"1,234,567.5");三臂(number / bigint / 字符串toLocaleUpperCase| toLocaleLowerCase)均不校验 locales 实参 ⇒null(原生 TypeError)、非法 language tag(原生 RangeError)全不抛 ⇒ throws 域折 never(假 no-throw)。 现改走宿主 ICU 路径 +CanonicalizeLocaleList同款校验。 - 252
String.prototype.search/match/matchAll的无效字符串模式: 模式编译失败此前被catch { return undefined }吞成「本臂不接管」哨兵 ⇒ 回落 抽象臂 ⇒ throws 域折 never(假 no-throw,L2 门禁假绿)。现按 RegExpCreate 步 2 定抛 SyntaxError(字面量模式 ⇒ 编译结果运行时同款),抽象接收者路径 同步补判定。 - 1042
charAt/charCodeAt/codePointAt/at没有第二实参(元数 1): 此前与slice/substring/substr同 case 分支且无条件校验args[1]⇒"abc".charAt(0, 1n)凭空判「必抛 TypeError」(原生正常返回"a")⇒ L2 门禁 假红。现按各方法真实元数分流校验。
- 249
-
ec0a9e4: Static fields now shadow inherited static methods, and calling a method that does not exist on an array or a built-in object throws instead of silently succeeding.
- A derived class that declares
static m = 2now owns that member:B.mreads2andB.m()throwsTypeError, like it does natively. The static-method lookup only consulted the method registry and walked thesuperchain, so the inheritedA.m()was called instead and the own static field was ignored. The lookup now checks the class value's own static slots first, matching the native own-then-prototype order. - Calling a method that does not exist on an array or on a built-in object
(
[].missing(),new Map().missing()) threw nothing and was not even recorded as a possible throw, so the L2 gate reported a false green. The missing-method check now covers arrays and built-in objects: both prototype surfaces are closed, so a name outside them is provably absent and the call throwsTypeError, consistently with the class-instance branch.
- A derived class that declares
-
0366b6d: Calling a class without
new, calling a proxy whose target is not callable, calling a proxy at all, and calling an unknown value now behave like the runtime does.- A class value (a
classdeclaration or a class expression) only has a[[Construct]]slot. Calling it as a plain function threw aTypeErrornatively ("Class constructor A cannot be invoked without 'new'"); the engine folded the call intounknownand did not record amay-throw, sonudo checkreported the entry as never throwing. - A proxy only gets a
[[Call]]slot when its target is callable. A proxy over{},[]or a class therefore throws aTypeErrornatively; the engine treated every proxy as callable and reported "never throws". - A proxy call never reached the target and never dispatched the
applytrap: the trap name was missing from the proxy trap table, so trap side effects were dropped and the result was alwaysunknown. Theapplytrap is now dispatched with the native argument order(target, thisArg, args), and a proxy without anapplytrap falls back to the target's own call.
- A class value (a
-
0366b6d: Proxy traps now reach the enumeration and extensibility faces.
Object.isExtensible(proxy)dispatched no trap at all: theisExtensibletrap was missing from the handler lookup table, so the call always folded to a definitetrue. A proxy whose trap reportsfalsewhile its target is still extensible makes the native engine throw aTypeError(the extensibility invariant is violated), and the trap's own side effects were dropped as well. The trap is now dispatched, its result is coerced withToBoolean, and a mismatch against the target's real extensibility raises theTypeErrorthe native engine raises. The target's real extensibility followsObject.preventExtensions/Object.freezeon the proxy, which freeze the target in the native engine.for (const key in proxy)enumerated the target's own enumerable keys and ignored theownKeystrap, so it produced an exact but wrong key sequence. The enumeration now goes through[[OwnPropertyKeys]](theownKeystrap, including the spec's invariant checks — duplicate entries or a missing non-configurable target key raise aTypeError) and then filters the result by enumerability through[[GetOwnProperty]]. The key order is the trap's order, as in the native engine.
-
0366b6d: Family 04 (core execution / entry), shard C — fixes for bugs 273, 274, 275, 276, 277, 280, 287 and 289.
- Bug 273: an
@nudo:mock <name>whose name collided with a module-level binding made the whole file fail to evaluate. The env/mock injection unconditionally prependedlet <name> = …, while the import rewrite emitslet <name> = …for the same name, sonew Functionraised aSyntaxError(duplicate declaration). The file then degraded to fail-closedunknownandnudo checkexited0— a green gate over a file that was never analysed. Injection now skips names that are already bound at module level (module-level binding wins), and a mock that targets an imported binding is applied by rewriting that import binding to read the mock value (the mock overrides the import), so@nudo:mockkeeps working instead of being silently dropped. - Bug 274:
@nudo:mock Math/JSON/Date/Promise… were silently ignored. Mocks and env globals shared one injection table, and the merged key set was filtered with the env-only "do not shadow host intrinsics" skip list (ENV_SHADOW_SKIP_GLOBALS), so every mock whose name was on that list was dropped before injection — the user believed the mock was in effect while the host intrinsic answered. The skip list now applies to env globals only; mock keys are not filtered (a mock value is anAbswith no host object identity to preserve — shadowing the host global is the point of a mock). - Bug 275: the optional
requireform (try { d = require(a) } catch (e) { d = require(b) }) missed thecjsMainbranch, so a module shapedmodule.exports = Xwas returned as a namespace instead ofXitself — the plainrequireand the optionalrequiredisagreed on the shape of the same module. Both paths now share one value resolution. - Bug 276:
require()of a module that cannot be resolved returned a plainunknownvalue instead of throwing, so the user'scatcharm was dead code and the engine claimed "does not throw" — thenudo:entry-may-throwgate under-reported (a missing module was diagnosed asnudo:module-missingwhile the runtime said "no throw"). A missing module now throws aNudoThrowcarrying anErrorbrand (same class as the nativeMODULE_NOT_FOUND), so thecatcharm is live and an uncaught one is reported honestly. The load-time case (arequireexecuted while the module body is still being evaluated) keeps the previous degradation: natively it means "the module cannot be loaded", and throwing there would fail the whole file closed (every export collapses tounknown⇒ green gate over an unanalysed file); the missing module is still reported by thenudo:module-missingdiagnostic. - Bug 277: in a CommonJS module the top-level
thiswasundefinedinstead ofmodule.exports, sothis.x = valways threw aTypeErrorand the whole module failed to evaluate (green gate over a file that was never analysed). The top-levelthisis now bound to the module'sexportsobject (=== module.exports), sothis.x = vis visible throughmodule.exportsexactly as in Node. ESM sources keepundefined(the native ESM semantics). - Bug 280:
export const a = …, b = …only exporteda— the second declarator was missing from the export table, sobwas not an export, its signature collapsed tounknownand cross-module imports ofbwereunknownas well. The transpiled output of a multi-declarator export is byte-identical to that of an independent declaration plus an independent export (the transpiler only prefixes the first declarator withexport), so the remaining declarators are now recovered from the source AST and merged into the export-name set. - Bug 287: the export-name recovery regexes used the ASCII-only
\w, so any exported name containing$or a non-ASCII character was dropped entirely: the function was never analysed, its signature collapsed tounknownand a bogusnudo:unknown-inferencewas appended — thenudo:entry-may-throwgate went green on a file that did throw. The capture groups now accept JavaScript identifiers ($,_, Unicode), and the same pattern source is shared with theexport * asrewrite. - Bug 289:
export * as "<name>" from "…"(the ES2022 arbitrary module namespace name) was not rewritten, so the statement leaked into the transpiled output,new Functionraised aSyntaxErrorand the whole module failed to evaluate — every export was silently emptied and the L1 gate went green. The namespace re-export rewrite now accepts a string literal name in addition to an identifier.
- Bug 273: an
-
0366b6d:
structuredClonenow models its own argument contract instead of inheriting the generic "abstract argument may throw" fallback.- The host-global literal guard recorded a
may throw TypeError(with a "Symbol coercion" cause) for every abstract argument. That reasoning only holds for host functions that coerce their argument (parseInt,Number,decodeURIComponent,btoa, …):structuredCloneruns the structured clone algorithm and never coerces its argument. Every cloneable shape — plain object, array,Date,Map,Set,RegExp,ArrayBuffer, typed arrays, class instances — was therefore reported as possibly throwing although the native engine clones it silently, and the CI gate (L2nudo:entry-may-throw) turned legal code red. Cloneable shapes no longer record a throw. - The shapes the native engine really rejects — functions,
Symbol,WeakMap/WeakSet/WeakRef,Promise, generators, and objects carrying a function-valued property — were reported asTypeError, while the host throws aDOMExceptionwhose name isDataCloneError. The throws face now carriesDataCloneError, so@nudo:throws DataCloneErroris accepted and the diagnostic text matches the host. - The argument contract is classified by the shape of the argument (never
by feeding an abstract value into the host): primitives and cloneable
containers are cloneable,
fn/symbol/eff/ theWeakfamily are not, and an unconstrained (any) argument still honestly records aDataCloneErrormay-throw.
- The host-global literal guard recorded a
-
0366b6d: Family 04 (core execution / entry), shard E — fixes for bugs 990, 1031 and 286.
- Bug 1031 (core): an
export { … };specifier statement placed before a class declaration made every method of that class collapse tounknown.ctorParamCountOftreated the specifier statement as a declaration and dereferenceddeclaration.typeon anulldeclaration, raising aTypeErrorinside the class-method bridge. The bridge swallowed the error in an emptycatch {}, so the method signature silently degraded tounknownand picked up a misleadingnudo:opaque-resultdiagnostic. Worst of all, a violated return-type contract on such a method was downgraded from an error to a warning, sonudo checkexited0and let the violation through. The null declaration is now skipped explicitly, and the bridge distinguishes an internal failure from a failed evaluation run instead of swallowing it silently. The behaviour no longer depends on the order of theexport { … };statement. - Bug 990 (core):
collectAbsExportsdecided between the re-export branch and the local-export branch by testing whether a module table was supplied at all. With no module table,export { a } from "./m.js"was handled as a local export and invented a named export, andexport { default } from "./m.js"invented adefaultexport — the very existence of adefaultslot is protocol-level information, so consumers were told the module has a default export it does not have. The branch now only looks at whether the statement has a source: an unreachable source yields no export slots at all, matching the "module table present but module missing" case.bindImportsalso resolvesimport { default as d } from "./m.js"throughmod.default, so it now matchesimport d from "./m.js"instead of bindingunknown. - Bug 286 (service): call records for namespace member calls
(
ns.helper(…), both ESMimport * as nsand CJSrequire) only carried the member name, never the receiver. The attribution side splits the callee name on a dot, so the split never happened:targetModule/targetExportstayed empty, the record was dropped by the matching side, and the error-levelnudo:interface-domain-exceedsgate never fired for out-of-domain calls across a namespace import. Such records now carry the receiver's local binding name (ns.helper), the same shape class member calls already use (Brand.method), and a CJSrequirebinding is registered as a namespace import. Ordinary calls (local functions, named imports, host globals) keep their existing record names.
- Bug 1031 (core): an
-
0366b6d:
@nudo:purenow memoizes by value instead of by variable identity.- The memo key was built from the argument's term — the identity of the
variable the argument was read from — not from the argument's value. Every
call that read the same variable collapsed onto one cache entry, so
rebinding that variable to a different value still hit the previous entry
and returned a stale result. On the product path (
_memoizemarker on a host function)use()returned"2,2"where the runtime returns"2,4". - The memo key is now derived from the value: literal values use the literal itself, and objects/tuples are compared by their slot and element content. Rebinding a variable to a different value invalidates the cache entry and the call is recomputed; two different variables holding the same value share one cache entry, which is what memoizing by value promises.
- Arguments whose value cannot be decided (functions, class instances, open objects, promises, primitives without a literal value) are not cached at all: the engine rather misses a cache hit than computes a wrong one, since a wrong hit is exactly the stale value this fix removes.
- The call-budget and cycle-detection keys keep their previous call-identity meaning; only the pure-memo channel uses the new value-based key.
- The memo key was built from the argument's term — the identity of the
variable the argument was read from — not from the argument's value. Every
call that read the same variable collapsed onto one cache entry, so
rebinding that variable to a different value still hit the previous entry
and returned a stale result. On the product path (
-
0366b6d: Importing an environment module by its default name now infers the same type as importing it as a namespace.
import fs from "node:fs"bound to nothing, because the environment module table only carried the named exports and had nodefaultslot. The import folded tounknown, every exported function of that file degraded tounknown, and the check reported a misleadingnudo:unknown-inferencewarning (the binding was never connected; nothing failed to infer) while still exiting 0. Importing the very same module asimport * as fs from "node:fs"was judged normally, so one import semantics produced two gate verdicts.- Environment modules are CommonJS interoperability modules: Node's default
export for
node:fsis the module object itself, with the named exports on it. The environment module table now carries thatdefaultslot (the namespace of the module) and marks the module as an interoperability module, and the default-import binding has a single source of truth: thedefaultslot when present, the namespace for an interoperability module that has nodefaultslot,unknownotherwise. - Ordinary user modules are untouched: a module table without a
defaultslot still binds a default import tounknownrather than falling back to the namespace.
-
ec0a9e4: fix(core): 族 03 接线 —— mutator 在端到端路径上就地改接收者(Bug 254)
Array.prototype.push.call({ length: 0 }, 5)原生会就地写接收者 (o.length变 1、o[0]变 5),但引擎此前把数组样接收者物化成副本再派发 mutator ⇒ 写入落在副本上(返回值对、写面丢)。修法:mutator 家族在闭对象数组样接收者上改走原接收者 (
invokeArrMethod的泛型接收者臂 →$arrMutContainer→mutateArrayLike就地写), 其余读方法保持物化通道。同批把
shift臂的空元组分支对齐pop臂(0-tuple 移出undefined, 此前落到泛型接收者臂折unknown)。新回归钉
core-bug-254-mutator-arraylike-wiring.test.ts(端到端 6 例)。 -
c325a10: fix(core):
String.prototype.matchAll(<非 RegExp 实参>)不再折确定 TypeError(Bug 449)- ES2023 规定:只有「实参确定是 RegExp 且其 flags 确定不含
g」 才抛 TypeError;实参确定不是 RegExp 时走RegExpCreate(ToString(pattern), "g")(g由算法自补)⇒ 返回迭代器。 此前这条「无g⇒ TypeError」的判定被错误推广到所有非 RegExp 实参 ⇒"abc".matchAll("b")/matchAll(1)/matchAll()/matchAll(null)全部被折成never+throws: TypeError(假抛 ⇒ L2entry-may-throw假红)。 - 现在:字面量接收者 + 字面量 pattern 走
new RegExp(ToString(pattern), "g")真迭代(迭代项是RegExpExecArray匹配数组,不是字符串);抽象接收者 / 抽象 pattern 走抽象臂 ⇒ 迭代器(元素域保守 unknown,迭代器协议面齐), 不抛 TypeError。 - 非法模式仍是确定
SyntaxError("abc".matchAll("(")),不得回落成 「本臂不接管」哨兵(否则 throws 域折never⇒ 假 no-throw)。 - 未变:实参确定是 RegExp 且确定无
g⇒ 仍确定 TypeError ("abc".matchAll(/b/));Symbol实参仍确定 TypeError。
- ES2023 规定:只有「实参确定是 RegExp 且其 flags 确定不含
-
c325a10: fix(core): 解析入口 / 依赖指纹 / 泛型 α 绑定三条根因收口(Bug 451 / 452 / 453)
- Bug 451 ——
.ts尖括号类型断言不再整文件解析失败:packages/core/src/algebra/parse-source.ts的parseUncached对所有源一律["typescript", "jsx"](parseSource拿不到文件名)⇒ Babel 在 TS+JSX 双插件下 把<起始的表达式优先按 JSX 解析 ⇒.ts(非.tsx)里合法的<T>x尖括号类型断言让整个文件解析失败(check/test/export/migrate strip全废,tsc 对同一份源exit 0)。 修法(路线 A,单文件 / 零调用面改动 /parseSource签名不变 ⇒ 公共 API 冻结面 零变更):解析硬失败时去掉jsx重试一次;重试也失败则报首次错误。 插件集不随调用方变化 ⇒ AST LRU 缓存键(mode + source)不动、无串味。 - Bug 452 —— 依赖指纹不再漏「仅副作用 import」:
packages/core/src/algebra/load-deps-fp.ts的extractAllLoadSpecs用正则抽 说明符、模块图用 AST 抽 ⇒ 两者对「仅副作用 import」(import "./setup.js";) 与「模板字符串require(\./tpl.js`)」的判断**不一致** ⇒ 指纹**低估**真实依赖集 ⇒ 磁盘缓存键不含该依赖的内容 ⇒ 依赖改了而键不变 ⇒nudo check继续吐**上一次的 陈旧签名**(文件头「more misses, **never a stale hit**」承诺被证伪)。 修法:指纹的说明符抽取**并入 AST 侧**(与模块图同口径:import / export-from /require/require.resolve` 的可折叠静态字符串)⇒ 正则集 ∪ AST 集 ⇒ 只多 miss(保守),绝不陈旧命中;AST 解析失败时正则集仍在 ⇒ 不引入新的低估。 - Bug 453 —— 收割的泛型函数在调用点绑定类型实参:
packages/core/src/algebra/hof.ts的bindTypeVars只做同 kind 配对 ⇒ harvester 把T[]建成arr(元素 = α var)、引擎把数组字面量建成tuple⇒ α 永不绑定 ⇒ 返回值落any⇒ 参与算术即「抽象操作数强制转换」 ⇒ 记 may-throw ⇒ L2 假红(tscexit 0的合法代码被门禁判红)。 修法:加跨 kind 臂(arr形参 ×tuple实参 ⇒ 取首元素;tuple形参 ×arr实参 ⇒ 取 arr 的元素类型)。 ⚠ 同 kind 臂排在前 ——hof-relation.test.ts的既有用例 「deep α:T[]param binds T fromnumber[]arg (lodash-style)」保持绿。 - 未变:core 公共 API 冻结面零新增导出(
parseSource签名不变、extractAllLoadSpecs/loadModuleDepsFingerprint只改内部实现)。
- Bug 451 ——
-
e2880fd: 族 06 收口接线(2):合取读侧看不穿嵌套
and⇒ 入口契约里的事实被静默丢弃。- 入口 Φ 的嵌套合取:入口契约谓词逐条进 Φ,而每条谓词本身可能是合取
(
and(typeof x, ge(x,0)))。旧口径用裸{op:"and",args:[…]}合成 Φ ⇒ Φ =and(and(…), and(…))⇒ 内层原子对合取读侧(buildCtx/collectBoundsFromPhi/impliesNotTypeof…)不可见 ⇒ Φ 里的事实被 静默丢弃。合成改用and()(展平一层),合取读侧改为递归展平 —— 合取可结合,and(and(A,B),C)≡and(A,B,C)。 - 可观测后果:
max === 0 ? 1 : 1 - d/max这类形态,在契约声明max >= 1时本可证明max === 0不可达 ⇒ 死臂剪掉 ⇒ 签名是sim(d: number, max: number) => number。Φ 嵌套后证不出 ⇒ 死臂留下 ⇒ 签名退化成=> 1 | number(多出一个恒被契约排除的臂)。 - 展平是读侧修正:不动任何已构造谓词的形状 ⇒ 展示串 / 谓词相等判定 / 缓存键零漂移。
- 入口 Φ 的嵌套合取:入口契约谓词逐条进 Φ,而每条谓词本身可能是合取
(
-
e59c991: Type renderings no longer read as the wrong type, and
nudo check --what-if --targetprints a real return domain instead of?.- A function type inside an array or a union is now grouped with
parentheses.
formatShaperendered an array of functions as(number) => number[], which TypeScript reads as "a function returningnumber[]" rather than "an array of functions", and rendered a union of a function and a number as(number) => number | number, where the|binds to the function's return type. The.d.tsrenderer already grouped both, so the two renderers disagreed about the same abstract value. Function members and function elements are now parenthesized; other member kinds are unchanged. nudo check --what-if --target <function>printed() => ?for the targeted function: the top-level binding's abstract value carries no return type, while the signature table reads a different abstract value. The target now takes the function's real return domain, so the two faces agree; the?placeholder itself is unchanged.
- A function type inside an array or a union is now grouped with
parentheses.
-
e59c991: Type guards now keep the structural obligations the type actually carries.
- A branded value (
Date,Map, …) was projected as "is an object", so{},[]andnew Map()passed a guard that was supposed to accept aDate. The guard now checks the brand identity (instanceof Reflect.get(globalThis, "<Brand>")); a brand whose constructor is not a global is let through, matching the standard-schema face. - A required object slot was only checked through its value guard, so a slot
whose value is unconstrained (
any()/unknown) lost its "the key must exist" rule entirely, and a slot whose value domain containsundefinedcould not tell a missing key from an explicitundefined. The existence rule is now an independent clause, and the object check no longer accepts arrays. - A length bound (
string().length(3)/max(3)/min(2)) was dropped from the guard, so every string passed. Length bounds are now projected asvalue.lengthcomparisons.
- A branded value (
-
e59c991: Inlay hints now show readable return types instead of engine-internal text.
- The return hint of an arrow function with an expression body was anchored at
the start of the returned expression, so the annotation was pushed
between
=>and the expression and split the source line (const arrow = (v) => : v * 2 v * 2;). Block-bodied functions are unchanged (the hint still sits right before{); for an expression body the hint is now anchored at the end of the expression, the same place TypeScript puts its own return-type hint. - The return hint could show the engine's internal abstract variable id
(
len#0, minted by a process-wide counter), which is neither a type the user wrote nor reproducible across recomputations. Internal length ids are now shown as the stable, readablelen. - A literal
-0was rendered as0, and because the union members were de-duplicated with a key that did not distinguish-0from0, one of the two union members was dropped entirely (0 | -0displayed as0). Literal text and the de-duplication key now follow the repository's canonical literal rendering, so-0survives and both union members are kept.
- The return hint of an arrow function with an expression body was anchored at
the start of the returned expression, so the annotation was pushed
between
-
e59c991: String unions are now concatenated member by member, and generated line comments no longer carry a block-comment escape.
-
A value that is one of several string literals was concatenated as if the literals were one piece of text.
("a" | "b") + "!"was reported as the single string"ab!"— a value no call can produce, because the real answers are"a!"and"b!". The same happened to`v=${x}`, which was reported as"v=ab". A union now keeps its members apart while it is converted to text, and the two sides are combined member by member, so the result is the union"a!" | "b!". -
The comment cleaner escaped the end of a block comment everywhere it was used, including inside
//line comments, where it has no meaning. The contract draft printed bynudo contract --draft— the text a user is asked to copy into the sidecar — showed/* no evidence — tighten *\/instead of/* no evidence — tighten */. Line comments now keep the text as it is; a line break inside a comment is still flattened, so a comment can never spill out of its line. Block comments (the JSDoc in the emitted.d.ts) still escape it, because there the escape is what keeps the comment from ending early. -
Member results are combined with the engine's existing "same primitive" rule (
joinValues), not as a raw union. Two literal members still form an enumeration ("a!" | "b!"), but a literal combined with a same-primitive arm that carries no narrowing evidence collapses to that primitive — the same rule the rest of the algebra uses. Without it, a union member whose rendering is alreadystringwould sit next to a literal and print as"NaN days" | "NaN day" | string | …: harder to read than the type it describes, and inconsistent with the signature the same function has everywhere else (formatAge(durationMs: number) => string).
-
-
e59c991:
nudo check --jsonno longer ships the engine's internal variable ids, and its signatures now match the ones printed on the terminal.- The machine-readable signature fields rendered the abstract value's
term/predunconditionally. Those terms mix in the engine's internal variable ids (len#0,len#2, …), which are minted by a process-wide counter, so the id a file got depended on the file's position in the command line. Checking three identical files gavelen#0/len#2/len#4, and swapping the order swapped the ids — the JSON payload of a single file was a function of its argument position rather than of its contents. The internal ids are now replaced by a stable name (len#2→len), so the abstract term and predicate evidence survives while the drifting number is gone. signatures[].displayis now rendered with the sameformatShapeprojection the terminal uses, so the machine face and the human face of one command agree:nudo checkprintsf() => numberwhile--jsonused to reportnumber = len#0 where len#0 ≥ 0 #pathfor the very same function. The confidence marker and the branch-join note are still available — through theconffield and thedetail/absfields.
- The machine-readable signature fields rendered the abstract value's
-
e59c991: Regression pin for a
__proto__object-slot projection defect that was already fixed in an earlier release (family 17 / Bug 606) — this changeset only adds the guard test, there is no behaviour change.An object slot named
__proto__used to be swallowed by the contract projection layer: the field table was a plain object, so assigning the key hit theObject.prototype.__proto__prototype setter instead of creating an own property, and the key silently vanished from the projected shape (the zod artefact lost the field). The rendering layer had the same hole.Both are closed: the projected field table is now a null-prototype object, and
formatObjectKeywrites__proto__as a computed key (["__proto__"]), which is an ordinary own property.The new pin locks that behaviour in place:
formatObjectKey("__proto__")returns["__proto__"], never a bare__proto__key.- The projected field table has a
nullprototype and__proto__shows up as an own key (Object.hasOwn), so the prototype setter cannot swallow it.
One related residue is not fixed here and is filed separately: zod v4 assigns
["__proto__"]back onto the parsed result through[[Set]], which triggers the prototype setter, so the parsed value still loses the key. That is zod's own runtime behaviour, outside Nudo's projection and generation responsibilities. -
3d79864: fix(core): 族 65 · core 剩余 6 条精度债收口(BC #28 / #44 / #45 + 族 62 的 3 条)
本片收掉 core 侧最后 6 条精度债(台账
#28/#44/#45+ 族 62 的Intl.Collator/cause继承槽 / 类型化数组元素值),全部对拍 node v26.10.0 原生后落码:- BC #44 ·
Object.getOwnPropertySymbols的自有 symbol 键面 (builtins/object/methods.ts):引擎把 symbol 键投影成"@@X"槽 (Slot.symbolKey标记)⇒ 闭对象的自有 symbol 键集可精确列举 ⇒ 折 精确元组;原生[]的目标(普通对象 / 数组 / 字符串 / 数字 / 函数 / Error 实例 / TA 实例 / 生成器对象)不再折保守symbol[];宿主命名 空间对象(Math / JSON / Intl / Reflect)折 1 个 symbol 键 (原生[Symbol.toStringTag])。键集不可判(开放 obj / 抽象 brand / arr / 原型 brand / Proxy / any / unknown / sum)⇒ 仍保守symbol[](不折空——空是自信的确切错值)。 - BC #45 · 生成器身份面(
exec/runtime/async.ts):同步生成器补@@toStringTag = "Generator"⇒Object.prototype.toString.call(g())原生同款"[object Generator]"(此前折"[object Object]"——自信的错 值)。槽仍 internal + symbolKey ⇒ 自有面 / 枚举面 / gOPS 面不可见 (原生生成器对象无任何自有可枚举属性)。不扩 Abs 形状:生成器对象 仍是闭 obj ⇒ 「类型投影面与空对象同形」这一条未收口(根治需makeGenObject改brand("Generator")⇒ A 类架构债,已登记为docs/design/architecture-debt.md的 A11)。 - BC #28 · try/catch 与控制流信号(
exec/transpile/stmt/fn-body.ts·stmt/statement.ts·transpile/types.ts):台账记的try { break; } catch {}在 HEAD 已不复现(族 02 的 Bug 211 已让$catchVal透传NudoLoopSignal);本片收掉的是同族仍在的既有缺口——try / catch / finally 块体里的早退提升(if (c) return X;+ 后续语句)此前把 「块内后续路径的值」当成函数返回值抛出 ⇒try { if (0) return 42; n++; } catch (e) {} return n;原生1、引擎折undefined(自信的错值)。修法:早退臂置标志 + 后续路径内的return走$loopReturn信号 ⇒ 只有早退真的发生才早退;块完成 ≠ 函数尾由新增的inCtrlBlock位表达(catch / finally 体此前落「返回值」协议)。 - 族 62 ① ·
Intl.Collator实例面(exec/runtime/members.ts):BUILTIN_BRAND_METHODS补"Intl.Collator"(compare/resolvedOptions)⇒typeof new Intl.Collator().compare折精确"function"(此前是 unknown 域)。 - 族 62 ③ · Error 的
cause继承槽(builtins/error/error-family.ts): 原生 InstallErrorCause 走HasProperty(options, "cause")——含原型链 ⇒new Error("m", Object.create({cause: 1})).cause原生是1,此前引擎 读出精确 undefined(「确定不存在」——自信的错值)。修法:键集不可判 (开放 obj / 原型链开放 / 抽象 options)时装值为 unknown 的 cause 槽 (读出「有槽但不知道值」);原型链上确有 cause 键时(存在性确定)装 同款 unknown 值槽 ⇒in/hasOwn/ gOPN 面与原生同(确定含"cause")。闭 obj 无 cause 键 ⇒ 仍不装槽(原生同)。 - 族 62 ④ · 类型化数组的元素值面(
builtins/error/binary.ts·exec/runtime/containers/arr-index.ts·containers/member.ts):闭 tuple 源逐元素过 ToNumber / ToBigInt + 家族取值转换(整数 TA 的模 2^n 回绕、 向零截断、Float32 的fround舍入、Uint8Clamp)⇒ 值入索引槽 ⇒new Int8Array(["3"])[0]折3(原生同;此前是number | undefined)。 值不可判的源(对象源的valueOf回调 / 抽象域 / 长度形态)不入槽 ⇒ 读面仍回落「元素域 ∪ undefined」(不假精确)。
新钉
packages/core/src/algebra/__tests__/eval-bug-65-core-remaining.test.ts(23 例:6 条各 ≥1 例 + 负控,逐条对拍原生)。既有金标只加强不弱化:eval-object-json-w9.test.ts的 gOPS 断言(保守symbol[]→ 精确元组- 抽象接收者仍保守)、
eval-bug-332-intl-collator-shape.test.ts与packages/env/src/__tests__/env-bug-62-es-web-surface.test.ts的it.fails旗标(族 62 的 3 条)均已摘旗转正。
- BC #44 ·
-
e2880fd: The constraint builders now reject arguments they cannot honor, instead of turning them into a weaker or empty contract.
length(...)accepts a finite numeric bound only, like its sibling builders.string().length(NaN)used to build a contract that no string could satisfy, andstring().length("3")used to build a contract that was never checked at all; both are refused while the contract is built.shape(...)takes an object of field constraints. A number, an array or a string used to collapse the whole shape into an empty one — the contract then held for every object — and a missing argument reported the rawTypeErrorof the host. Both now report which builder got the wrong argument.array(...)requires an element constraint. Without one the element becameundefined, so every ordinary array argument was reported as a violation. Writearray(lit(undefined))when undefined elements are meant.- The field tables of
shape,partial,omitandpickare built without a prototype. A field named__proto__was written as the prototype of the table instead of a key of its own, so the field vanished from the contract and the check accepted every argument. The field survives now, and the builders report a field table that lost a key instead of quietly accepting a weaker contract.
-
e2880fd: fix(core): 「prim + 界」契约补回类型义务 + 约束 DSL 形态校验(族 06 / Bug 333 335 337 347 357 358)
- 333 / 335:
instantiateConstraint只要约束带prim就把typeof谓词与界合取 (此前只在preds.length === 0时补 ⇒number().gt(0)/string().max(3)这类 「prim + 界」契约实例化后没有类型义务 ⇒ 类型错配的实参被静默放行)。 ⚠instantiateOnTerm保持原口径:union 成员经它实例化,补typeof会让 执法侧or分支判不出(成员谓词变and)⇒union(lit(1), lit(2))的违例丢失。 - 337:
length()的内部占位符__nudo_self__替换递归进应用项实参 (app("length", […]))与and/or/not分支 ⇒ 占位符不再泄漏进 实例化谓词与产品expected文本。 - 347:
pick()取字段改自有属性判定(Object.hasOwn)⇒"constructor"/"toString"等原型链成员不再被当成字段塞进字段表 (此前让nudo contract/nudo export面裸崩、nudo check面静默作废整条契约)。 - 357:
fn()第三实参做形态校验:opts必须是对象;opts.throws归一后必须能 抽出至少一个错误名 ⇒ 无效申报不再被静默吞掉(零诊断假红),改为可读的 DSL 错误。 - 358:
pick()/omit()的keys必须是字符串数组 ⇒ 传字符串不再被逐字符 迭代(pick把契约放松成空 = 假绿、omit让约束变更严 = 假红),改为可读的 DSL 错误。
- 333 / 335:
-
e2880fd: 族 06 修复 S3:Bug 342 / 348 / 355 / 922 / 965 —— 约束 → Abs 投影不再蒸发 用户写下的那部分约束,产物面与门禁面给出同一个裁决。
- 922:
array(number()).min(3)这类数组自身的长度界在 Abs 投影里整条 丢弃(数组分支提前返回、pred 槽写死 undefined)⇒ 契约面 / zod 面 / standard 面 / 门禁面全都看不见它 ⇒ 完全静默的假绿。数组分支现在承载顶层 长度界,执法面也按数组元素个数求值(此前只处理字符串)。 - 355:
array(string().max(1))的元素长度界在 Abs 投影里无处承载 ⇒ 同一份代码,CI 门禁判绿而 zod 产物面判红(跨产物面自相矛盾)。元素的长度 界现在进 Abs 投影,执法面按元素位(length(a[0]) ≤ 1)求值。 - 965:
lit(null)/lit(undefined)的整条约束在 Abs 里消失(pred 被丢弃- shape 退成 unknown)⇒ 形参退化成 unknown、调用点前置条件不再执法 ⇒
门禁 OK / exit 0(假绿),而同一份契约在 dts 面印
x: null、在契约面印x: lit(null)⇒ 三个面三种答案。nullish 域现在保留在 pred 槽里,null 与 undefined 分成两个域(lit(null)契约不收 undefined,反之亦然)。 实参抽取此前只处理数字与字符串字面量 ⇒f(null)根本没有实参可判 ⇒ null / undefined 现在也进实参位。
- shape 退成 unknown)⇒ 形参退化成 unknown、调用点前置条件不再执法 ⇒
门禁 OK / exit 0(假绿),而同一份契约在 dts 面印
- 342:
.int()是数据标志不产生 pred ⇒ 约束 → Abs 投影把整性整条 蒸发 ⇒ zod / standard 产物面静默放行3.5,而门禁(读约束)仍判红 ⇒ 两道 门对同一事实给出相反裁决。整性现在投影成 pred。 - 348:
lit()的字面量只活在 pred 里(shape 无字面量位)⇒ 只看 term / shape 的 widen 路径永远看不见它 ⇒ 同一份契约四个面四种答案。check 签名面与 dts 面的参数位现在按 pred 里的字面量域保形 (x: lit(1)/x: 1),与契约面、zod 面对齐。
渲染面顺带修了一个会崩的字面量拼法:bigint 走
JSON.stringify直接抛Do not know how to serialize a BigInt(NaN / ±Infinity 会被印成null、-0被抹成0)——现在按 JS 字面量拼法展示。 - 922:
-
e2880fd: 族 06 修复 S4:Bug 338 / 344 / 345 / 350 / 351 / 356 / 360 / 362 —— 源码指令的文法、侧车的装载与诊断归属,从此按引擎真实口径说话。
- 350:三条源码指令(
@nudo:assume/@nudo:invariant/@nudo:contract) 的标识符文法只接受 ASCII ⇒ 中文标识符 /$前缀等合法 JS 绑定名被判 malformed(L1 假红),而侧车面又把同一个中文名当一等公民 ⇒ 跨面自相矛盾。 三条指令现在共用 JS 绑定名文法(Unicode 合法)。 - 356:侧车求值把 15 个构建器名当形参注入,而侧车自身的
const <name> = …在同一函数作用域 ⇒SyntaxError: Cannot declare a const variable twice⇒ 侧车根本加载不了 ⇒ 该文件全部契约丢失、三个运行时产物面 静默退化为「接受一切」,而nudo exportexit 0 零告警。注入名不再占用侧车 自身的顶层作用域;侧车顶层声明与相对 import 绑定的同名也会被点名。 - 338:同上(侧车注入名与侧车自身绑定的撞名)——侧车加载失败现在给出
指向侧车路径的原生诊断,而不是让宿主
SyntaxError原文冒泡。 - 345:依赖侧车的求值异常原样冒泡 ⇒ 报错指向导入方且点名它根本没有的 名字,导入方的合法契约被连坐作废 ⇒ 契约门禁假绿。现在包装成 Nudo 原生 诊断并点名依赖侧车路径。
- 344:两条
@nudo:import绑同一个本地名 ⇒ 后写覆盖先写,零冲突检测 零诊断 ⇒ 裁决随行序翻转。现在拒绝绑定(不猜哪条赢)。 - 351 / 360:源码
@nudo:contract return <fn 形态模板>的返回义务整条不 被执法;且多条 return 段只执法第一条 ⇒ 违反第 2 条时 0 error / exit 0 (加一条契约反而让门禁变绿)。返回义务现在真的被执法,多条 return 段 合成单条合取(与形参位「同形参多段取合取」的既有语义一致)。 - 362:
sidecarPathOf不剥已有的.nudo段 ⇒lib.nudo.js被拼成lib.nudo.nudo.js⇒ 该文件不是任何源码的侧车 ⇒ 契约永久静默失效。
- 350:三条源码指令(
-
e2880fd: 族 06 修复 S5:Bug 334 339 340 359 361 964 —— 侧车装载与契约合流的口径修正:
- 334:同一个物理侧车环被 ambient 加载通道与
@nudo:import通道各报一次 ⇒ 一个环 = 两条同码 error(门禁摘要虚增一倍)。现在按环链文本去重, 一个物理环只报一条nudo:interface-cycle。 - 339:侧车导出名与源码函数名对不上(打错一字)⇒ 契约被静默丢弃
(签名退化成 any、dts 类型错、门禁冒假红且修复提示指错方向)。现在做一趟
孤儿导出扫描:侧车里没人认领、且像是打错一个字的
fn()契约会被点名 报出(契约库侧车的正常条目不报,零假阳)。 - 340:非标量约束(shape/array/union/fn)的合取是
and()的能力边界, 不是「语义不可满足」——原来一律记成 conflict ⇒ 门禁假红nudo:interface-conflict且该形参的义务被整条跳过(假绿)。现在只有 真正的语义矛盾(prim 不一致)才记 conflict。 - 359:别名 /
default桥接下侧车诊断点名的是源码本地名(侧车里根本没有 那个导出)。现在点名侧车里真实存在的导出名,并同时给出源码函数名。 - 361:bigint 字面量丢
n后缀 ⇒ 诊断里的lit(10n)读起来是 number 字面量lit(10)(陈述的是另一条契约)。展示面(termToString/litToString)现在 保n后缀,与format.ts的 prim bigint 渲染同口径。 - 964:单份契约内部自相矛盾(
number().gt(10).lt(5))零诊断(静默假绿)。 现在与跨来源矛盾同口径报nudo:interface-conflict。
- 334:同一个物理侧车环被 ambient 加载通道与
-
e2880fd: 族 06 修复 S6:Bug 343 346 349 1023 —— 契约面的采用与呈现口径(callee 违约、 assume 前提作用域、fn 槽位占位 term、跨模块形参名)
- 343(callee 违约时的假绿):调用点不再用 callee 的声明面替换确定违反
声明约束的真实返回值。callee 返回
5而契约声明number().ge(0).le(1)时, 引擎本已判定违约,但调用点仍把声明面当事实交给 caller ⇒ caller 的返回契约被 「证得」(跨模块时nudo check零错误)。现在保留真实返回值 ⇒ caller 侧同样 报nudo:constraint-violated。 - 346(
@nudo:assume前提的作用域):前提槽不再整体关掉 callee 契约面的 采用。只有当引理前提的自由变量里确实含该位被重锚成的 callee 形参名时才跳过 这一位;与本次调用无关的惰性引理(如p <= q,p/q 是调用方的局部量)不再把 调用方的返回类型退化成any、也不再造出假红的nudo:unproven-return。 与引理名字撞名的情形仍跳过(#152 的 soundness 护栏保留)。 - 349(签名面泄漏内部占位 term):契约 fn 的槽位 term 是内部占位名
(constraint.ts 生成的
x${i}/ret),此前回显进签名面长成 TS 默认参数f(cb: (number = x0) => number = ret) => number。现在 fn 形状的内层槽位不再 回显占位名;关系 fn 槽位的 α 名(A1/B1)照旧回显。 - 1023(跨模块形参名对不上被静默吞掉):跨模块桥接路径与同文件路径同口径
——契约形参名对不上形参表时报
nudo:interface-param-mismatch(此前该形参的义务 在调用方蒸发,负参调用假绿)。两条路径复用同一段计算与同一条文案。
- 343(callee 违约时的假绿):调用点不再用 callee 的声明面替换确定违反
声明约束的真实返回值。callee 返回
-
da4fbfc: Call-site contract enforcement no longer depends on where the call sits, and default parameter values are checked against the contract they belong to.
f(true)was checked only when the call was a top-level statement. The literal fast path had no case for boolean literals, sof(true)fell through to the unknown fallback and the call site carried no enforceable information. Only the evaluator's value-flow fallback could still see it, and that fallback has a record only for statements the module actually executed — a call inside a function body was therefore never checked. Boolean literals now have their own case in the fast path, so the same violation is reported identically in both places.- A parameter with a default value (
f(x = -5)) was never checked when the call passed no argument at all: the zero-argument early return skipped the whole call site. The default value was computed by the engine and then never reconciled with the contract, so a default that violates its own precondition passed silently. Zero-argument calls now fill the argument positions from the callee's default values before the contract is enforced. Defaults that cannot be read statically (destructuring patterns) are left alone rather than guessed at.
-
da4fbfc: Union and nullable contracts now enforce their members, and a bigint literal contract is no longer a contract that can never fail.
- A contract written as a union or as a nullable is instantiated into a
disjunction of atoms, and the enforcement side decides each atom on its
own. The atoms that carry a nullish literal could not be decided — the
literal value of
undefinedcannot be told apart from "no value" — so the disjunction was reported as "cannot tell" and the whole contract was skipped. Every argument outside the contract passed silently. The nullish atoms are now decided on their own terms, withnullandundefinedkept as two separate domains, sof(0)againstunion(number().gt(0), lit(null))is reported whilef(3)still passes. - A union over primitive types is instantiated into
typeofatoms, and those atoms could not be decided either, which left contracts such asunion(number(), string())without any enforceable content. The decision side now reads the primitive shape of the argument and compares it with the type the atom asks for, sof(true)againstunion(number(), string())is reported. lit(1n)was instantiated into an equality atom whose literal side could not be read, because only number, string and boolean were recognised as literal values. The atom was therefore never decidable and the contract accepted every argument:f(2)againstlit(1n)passed. Bigint literals are read as literals now, and the expected value keeps itsnsuffix in the diagnostic.
- A contract written as a union or as a nullable is instantiated into a
disjunction of atoms, and the enforcement side decides each atom on its
own. The atoms that carry a nullish literal could not be decided — the
literal value of
-
da4fbfc: fix(core): 调用点扫描 / 契约执法五处缺陷(族 11 片 S2)
- 433
union(...)含 shape / array 成员时成员结构义务整体丢失(假绿): 契约侧把成员摊成顶层or(...)(结构义务实例化即丢),执法侧也没有 union 成员分支 ⇒ 两侧都缺。消费侧补 union 成员分支:与实参形态匹配的成员全部 不满足才报违例(union 是析取);谓词通道能自己裁决时让位(不双报)。 - 436 同一条「缺字段」违例被
checkShapeReqs+checkReqs两条并行通道 各报一次(错误计数翻倍)⇒ 报告收敛到checkReqs一处,诊断文本不变。 - 439
lazy(() => shape(...))/lazy(() => array(...))的结构义务被闸门continue掉(假绿)⇒ 判闸门前先 deref lazy 包装(按LAZY_TEMPLATE_DEPTH预算递归解包)。 - 914 字段位 / 数组元素位的
null/undefined实参完全不被执法 ⇒ prim 门 与数值界门显式判 nullish 违例(与顶层标量面同口径)。 - 1021 顶层「结构约束」位对
null/undefined实参零诊断(假绿)⇒ 排除 条件改成「无 term 的 unknown / any / never 才跳过」。
- 433
-
da4fbfc: Call-site contract enforcement now covers class instances, default exports, and re-export chains, and it applies one literal identity on every argument position.
- A method call on a class instance (
const c = new C(); c.m(-1)) was never checked. The call graph only recognized members of object literals, so the callee name could not be resolved and the whole call was skipped, while the contract face and the signature face both claimed the contract was in force. Instance members now resolve to the class method they belong to, so the call site and the contract face agree. - A contract on a default export was not enforced across files
(
import calc from "./a"). The imported name was recorded as the literal export namedefault, but contracts bind by the name the callee declares locally, so a hand-written sidecar could never attach and the violation passed the gate silently. The callee's local declaration name is now used. - A re-export chain was cut short by an unrelated local function with the same name in the middle module. The chain was only followed when the name appeared anywhere in the module's source, so a local function that was never exported shadowed the re-export and the contract of the re-exported function went unused. The chain now follows the module's exported names, which is what the module system itself uses.
- The same literal contract could be satisfied or rejected depending on where
the argument sat: a scalar argument compared
-0and0as equal, while an object field or an array element compared them as different. One identity is now used everywhere:===plus the NaN exception, so-0satisfieslit(0)andNaNsatisfieslit(NaN).
- A method call on a class instance (
-
da4fbfc: Sidecar sections are now recognised by nudo's own marker and nudo's own boundaries, and a class's static and instance methods no longer share one name.
- A sidecar comment that merely mentions
@generated(for example// handwritten contract: this mentions @generated) was treated as nudo's own section header. The whole handwritten contract then lost its obligations — a call site that violated the contract was not reported at all andnudo checkexited 0 — andnudo contract --emit --allreplaced the handwritten contract with the observed values. A header now counts only when the comment starts with@generatedand names nudo, and a section boundary stops at aconstthat the export does not reference. The legitimate generated shapes (the alias section, the composite downstream section with its preludeconst, a multi-step prelude, a header directly above the export) are still recognised. - A static method and an instance method with the same name were both listed
as
C.m, so the two records replaced each other in the tables indexed by name and the signature mixed parts of both methods. The instance method now takes the name on its own, and the generated TypeScript declaration no longer repeats the member. getandsetmembers of a CommonJS object literal were collected as exported functions, which invented an entry point and a spurious "may throw" error. They are not callable entries and are no longer collected.- A CommonJS member assignment whose value is a named function expression was named after the function's own inner id instead of the export slot, so the sidecar contract never bound and the exported symbol was missing from the signature table. The export slot name wins now.
- A sidecar comment that merely mentions
-
da4fbfc: Regression pins for three call-site contract enforcement reports whose symptoms are already gone. No behaviour changes: these bugs were fixed earlier (by the
lit(null)/lit(undefined)literal fix, by theexport defaultdts export-name fix, and by resolving a callee's@nudo:importsidecar against the callee's own directory). The pins exist so the fixed behaviour cannot silently regress.- A parameter whose contract is exactly
lit(null)orlit(undefined)now has a pin that spells out both directions: the one allowed value passes with no diagnostic, and every other value is reported as a violation.nullandundefinedare two distinct domains, solit(null)rejectsundefinedandlit(undefined)rejectsnull. The pin also records that a bare literal contract (oneeqatom) and aunion/nullablecontract (nullish as a member) are different shapes handled by different channels; only the bare literal shape is pinned here. - The dts projection now has a pin for all four
export defaultshapes — named function, class, anonymous function and arrow — and asserts that the emitted export name isdefaultin each case, so a default export can no longer be projected as a named export that does not exist at runtime. - A cross-file call now has a pin that the callee's sidecar is resolved
against the callee's directory, not the caller's: the sidecar next to
the callee loads without an
nudo:interface-loadornudo:contract-syntaxdiagnostic, and the call site still reports the real precondition violation.
- A parameter whose contract is exactly
-
da4fbfc: Union, nullable and literal contracts no longer skip legal arguments, and arguments that cannot possibly satisfy a literal contract are no longer let through.
- A union or nullable contract was reported as violated for every nullish
argument, before the disjunction was looked at branch by branch. An
argument that satisfies one of the branches —
nullagainstunion(number().gt(0), lit(null)),undefinedagainstnullable(number().gt(0))— was still reported. The disjunction is now decided branch by branch and one satisfied branch is enough to pass.nullandundefinedremain two separate domains, sonullagainstunion(number().gt(0), lit(undefined))is still reported. - An argument that is not a scalar literal — an object, an array, a bigint —
was skipped by the literal branch altogether, so a contract such as
lit(1n)accepted every such argument. The literal branch now reaches those arguments: a definite mismatch in the argument's shape is reported as a violation, while an argument whose shape cannot be determined is still left alone. A disjunction is decided the same way, and a branch that is known to fail is now enough to report the violation even when another branch cannot be decided. - A bigint literal argument (
f(1n)) could not be read at the call site, so the call site had nothing to enforce and was skipped in function bodies. Bigint literals are read now, sof(2n)againstlit(1n)is reported andf(1n)againstlit(1n)passes. - The two places that judge literal identity answer different questions and
keep their own answers: the assignment side asks whether two values are
the same value (
Object.is, so-0and0differ), while the contract side asks whether a value falls inside a contract's domain (===plus aNaNspecial case, so-0is0). A pin now records this division so the two are not made to look alike later.
- A union or nullable contract was reported as violated for every nullish
argument, before the disjunction was looked at branch by branch. An
argument that satisfies one of the branches —
-
da4fbfc: A literal contract now reaches bigint arguments in every argument position, not only in the scalar one.
- A scalar argument was already checked against a bigint literal contract:
f(2n)againstlit(1n)was reported andf(1n)againstlit(1n)passed. The same contract in an object field or an array element was not checked at all, because the literal branch only admitted number, string, boolean, null and undefined arguments:f({ v: 2n })againstshape({ v: lit(1n) })andf([2n])againstarray(lit(1n))passed silently. One contract now gets one verdict in all three positions, so the two out-of-domain arguments are reported and the in-domain ones still pass. - The union of bigint literals is decided the same way in a field as it is
in the scalar position:
union(lit(1n), lit(2n))reports3nand passes1nand2n. - The
typeoflabel of a bigint literal is matched against bigint values, so a bigint is no longer treated as a value of some other type.
- A scalar argument was already checked against a bigint literal contract:
-
5dd89ca: fix(core): TS 剥除 pass 的六处缺陷(445 / 446 / 447 / 448 / 913 / 968)
stripTypes是全链(CLI / service / LSP / evaluator)共用的 TS→JS 剥除 pass。 本轮修了六处会让nudo migrate strip产出不可加载的.js、或让分析面 假红 / 假绿的缺陷:- 445 值位置的「类型专用导入」被消除(与 tsc 的 import elision 同口径):
import { Foo } from "./t.js"且Foo只在类型位置被用到 ⇒ tsc 会消掉这条 import;不消掉的话,被 import 的模块被剥成空模块 ⇒ 产物 ESM 链接期SyntaxError: does not provide an export named 'Foo'。判据是语法级的 「值位置引用收集」,保守:判不准的绑定一律保留。 - 446 TS-only 的模块出口语句
export = X/export as namespace X被剥除 (原样留在.js里 ⇒ 产物不是合法 JS)。 - 447 类成员的
x!(确定赋值断言)、y?(可选属性)、m?()(可选方法) 被剥除(原样留在.js里 ⇒node --check报Unexpected token '!'/'?')。 - 448 TS 的
this形参从形参数组里删除(原样留在.js里 ⇒ 产物不是合法 JS,Node 加载即SyntaxError: Unexpected token 'this')。 - 913 TS 的
enum不再被整段删除,而是合成成等价的运行时对象 (逐形态对齐 tsc 的 emit:反向映射 / 自动递增 / 字符串枚举 /const enum)。 此前 enum 声明被删 ⇒ 成员引用退化成未绑定全局读取 ⇒ 门禁报 error 级nudo:entry-may-throw(假红)+ dts / zod / standard / guard 四个产物面把 返回类型落成never。 - 968 挂在「将被删除的语句」上的文件级指令(
/// @nudo:import/@nudo:env/@nudo:mock-module…)被转挂到下一个幸存节点,不再随语句 一起消失(此前源红、产物绿的假绿)。
StripOptions.report增加了可选的事实回报字段(enumSynthesized/exportAssignmentRemoved/thisParamRemoved/typeOnlyImportRemoved/typeOnlyImportKept/directivesBefore/directivesAfter/directivesDropped)——@nudojs/core的公开导出面零新增。 - 445 值位置的「类型专用导入」被消除(与 tsc 的 import elision 同口径):
-
97f28ed: fix(core): 等式蕴含序关系、字面量同一性按 SameValue、默认形参可省略、strict 端点放松只做一次
- Bug 387:
implies补「等式 ⇒ 序关系 / 对称」规则——x === y⇒x <= y∧x >= y(===排除 NaN ⇒ 等值必然不小于也不大于)、x === x⇒x <= x;等式事实同时给出对称式x === y⇒y === x(不含lt/gt: 等值不蕴含严格序)。此前a === b前提消解不掉a <= b的分支可达性 ⇒ 恒假分支被算成可达(nudo check签名f(a, any, b: any) => 1 | 2 | 3,应为1 | 3)。 - Bug 398:
leqAbs的字面量同一性按注释宣称的 SameValue(Object.is)判定, 不再按===——0 === -0为 true ⇒lit(-0)与lit(0)互相「满足」⇒ 精确 期望被静默放宽(nativeObject.is(0, -0) === false)。NaN ≡ NaN 的口径不变; 失败原因串里的-0与0现在可区分。 - Bug 399(读侧):fn shape 新增可选字段
optionalParams?: boolean[](与params同下标,true = 该位可省),leq据此算必选元数——默认形参 (f(a, b = 1))在形参表面只是光秃秃的名字,此前被计成必选元数 ⇒nudo:assign-mismatch假红。requiredFnArity的公开签名与既有行为一字不改 (无标记时回退名字后缀判据)。 - Bug 1004:strict 端点的 1 ULP 离散性放松只做一次——同项比较时按 IEEE 格点
读事实端点(
t > L⟺t >= nextUp(L);t >= L不步进)⇒x > 0 ⇒ x + 1的后置number().ge(1)不再假红(nudo:constraint-violated)。区间层的nextDown放松保留(它是保真所需:x>0 ∧ y>=1 ⊬ x+y>1依赖它才不假证)。
- Bug 387:
-
97f28ed: fix(core):
+的 bigint 臂不再短路数组臂;0 / x折叠保留分母符号- Bug 946:
add()的数组臂(ToPrimitive →join(",")⇒ string)前移到 bigint 臂之前 ——+的第一步是 ToPrimitive,原生1n + []得字符串"1"、从不抛, 此前 bigint 臂先命中 ⇒ 硬抛TypeError⇒ 返回值折never⇒ L2nudo:entry-may-throw假红(exit 1)。现在1n + []/[] + 1n/[1] + 1n/1n + [1,2]分别折"1"/"1"/"11"/"11,2",catch语义同步纠正 (原生不抛 ⇒try块正常走完,不再误进catch)。 - Bug 946(算术面):
isMaybeBigintOperand的 kind 清单补arr/tuple,foldBigintBinOp给数组/元组一条显式硬抛分支 —— 数组的 ToPrimitive 恒为 字符串 ⇒ToNumber⇒ number ⇒ 与 bigint 混型TypeError确定(原生1n - []恒抛)⇒ 硬抛且可被catch吸收(不得走软 may-throw 通道:软通道让 求值继续 ⇒catch分支变死代码)。isMaybeCoercionThrowOperand把数组/元组 排除(其 ToPrimitive 恒 string ⇒ 既不会成 bigint 也不会成 Symbol ⇒1 + []/[] < 1原生从不抛,不得记假 may-throw)。 - Bug 959:
div()的0 / x字面量折叠(issue #170)此前在判「分母可证非零」后 直接折+0,把 IEEE「0 / x取 x 的符号」丢在门外 ⇒ 负分母的-0被折成+0(下游1 / (0 / x)再折成+Infinity)。现在分母符号参与折叠: 分母恒正 ⇒+0,分母恒负 ⇒-0(lit保真负零),下游相应为-Infinity。 符号不可证(可能正 / 可能为 0)时仍不折(保守)。
- Bug 946:
-
97f28ed: fix(core): 形参表面模型记录解构模式种类、跳过 TS
this接收者标注、标注默认形参可选- Bug 388:
FormalParam的 pattern 变体新增patternKind("object"/"array")—— 数组解构形参在签名面渲染为[ x, y ](此前对象/数组解构一律渲染{ … })。 - Bug 392 / 393(模型层):数组解构新增
boundIndex(绑定名 → 元素下标),locateContractParam对数组解构按下标返回fieldIndex(对象解构的属性键口径不变)。 - Bug 397:TS 的
this: T是接收者标注而非运行时形参 ⇒ 不进形参表、不占实参位 (形参表位置随之前移)。 - Bug 399(模型层):形参表新增
optional标记(默认形参 / rest / 带默认值的解构 形参恒为 true)——消费侧算必选元数不再靠名字后缀猜。
- Bug 388:
-
97f28ed: fix(core): rest 形参实参聚合、未契约兄弟绑定补 unknown、env 门禁不再吞推断失败警告、
--assume的界不再被写死成x > 0- Bug 400:
locateContractParam算出的rest: true此前在scan-literal-calls.ts的entries.push里被丢掉 ⇒ 执法侧的实参映射 (恒等(i) => i)把首个实参当成 rest 形参的值 ⇒sum(...nums)+ 契约array(number().gt(0))时,合法调用sum(1, 2)被判「实参1⊭ array 约束」(假红),报出的实参值也是错的(1而不是[1, 2])。现在 rest 标志 透传到执法侧,该位之后的全部实参聚成一个精确元组 Abs 再与契约比 ⇒sum(1, 2)通过;sum(1, -2)报违例且actual是整个聚合值[1, -2]。 - Bug 401:解构形参的合成形状只含契约命中的字段 ⇒ 未契约的兄弟绑定
从头到尾不进袋子 ⇒ 形参形状是闭对象 ⇒ 读兄弟绑定得 exact
undefined(自信的错值,native 是实值)。现在合成前把该 pattern 的 全部顶层绑定都放进袋子(未契约的用unknown)⇒ 形参类型写成{ a: number, b: unknown },读b折unknown。 - Bug 389:没生效的
@nudo:env指令此前让函数体 fail-closed ⇒ 符号面conf = opaque⇒check.ts的budgetExplained把它当「已解释」⇒ 唯一能 提示「推断失败」的nudo:unknown-inference警告被吞,取而代之的是一条 把它引向@nudo:case的nudo:opaque-result信息(指错方向)。现在 env 门禁 的事实(PolyFn.envGated)对诊断层可见 ⇒ 该场景发nudo:unknown-inference警告,不再发指错方向的信息。 - Bug 976(core 半):
buildArgsFromAssume把被假设形参的前提写死成x > 0⇒--assume 'x>-5'/'x>-100'的负界被静默顶成x>0⇒ 引擎过度 收窄、合法分支被剪掉("neg"分支不可达 ⇒ 错值 / 假绿)。现在 core 接收 形参 → 界的映射,把用户声明的界直接落进形参的pred(>严格、>=非严格);没有声明界时不写界(不替用户发明更强的默认界)⇒ Φ 只承担 跨变量 / 额外前提。
- Bug 400:
-
97f28ed: fix(core): 用户转换钩子真调用(ToPrimitive / ToPropertyKey / toJSON)+ 原型写入的环与不可变原型判定
- Bug 381:隐式强转路径对 user obj 的钩子槽只做存在性判定 ⇒ 钩子体从不执行 ⇒
钩子的副作用(计数器 / 捕获变量写)与 throw 域一并丢失,且钩子体确定抛错的代码
被折成确定不抛。修后新增
$invoke调用面(objects.ts的coercionHookOf/invokeToPrimitiveHook/invokeCoercionHook):钩子体真调用(hint 决定 valueOf / toString 先后,@@toPrimitive 优先),副作用发生、钩子体抛错按原生传播 (用户 try/catch 可吸收)。覆盖+/ 模板串 /String()/JSON.stringify的toJSON步 /new Error(对象实参)。 - Bug 383:计算成员访问的对象键不做 ToPropertyKey ⇒ 写被静默丢弃、键强制转换
副作用全丢。修后
propertyKeyOf对对象接收者走 ToPrimitive(string) → ToString (钩子真调用);键不可判时写打「自有键集不完备」标记(键家族据此折 partial, 不得折 exact 空元组)。 - Bug 385:
Object.setPrototypeOf不做原型环检测 ⇒ 引擎建出 native 不存在的活原型环。 修后原型环与不可变原型在同一事实源protoChangeAllowed判定:Object.setPrototypeOf抛 TypeError(native 同款),Reflect.setPrototypeOf返 false。 - Bug 386:
Object.setPrototypeOf(Object.prototype, …)不查不可变原型 ⇒ 静默改写并 假绿。修后同 385 的单一事实源拒绝(仅Object.prototype是不可变原型——其余内建 原型可改,native 实测)。
- Bug 381:隐式强转路径对 user obj 的钩子槽只做存在性判定 ⇒ 钩子体从不执行 ⇒
钩子的副作用(计数器 / 捕获变量写)与 throw 域一并丢失,且钩子体确定抛错的代码
被折成确定不抛。修后新增
-
97f28ed: The function shape now carries which parameters may be omitted, and a TypeScript
this: Tannotation is no longer emitted as a runtime parameter.-
A parameter with a default value may be omitted by the caller, but the parameter list only ever carried its bare name, so it was counted as a required argument: assigning
(x = 1) => xto a function that accepts no arguments was reported as a mismatch even though the arrow function can be called with no arguments at all. The function shape now carries a per-position "may be omitted" flag (defaults,?parameters and rest parameters), and the required-argument count is derived from it. The publicrequiredFnAritysignature and behaviour are unchanged; the flag is consulted first and the name-suffix rule remains the fallback.The flag is populated on every path that produces a function value: function expressions and arrow functions, object methods, function declarations and exported functions.
-
A TypeScript
this: Tannotation is a receiver annotation, not a runtime parameter, but the transpiler emitted it as one. The emitted function was therefore syntactically invalid —thisis not a legal parameter name — so loading the module threw and every evaluation of that module degraded tounknown. The annotation is now skipped in the emitted signature, in the argument-slot binding (it does not occupy an argument position, so the arguments after it were bound to the wrong parameters), and in the host signature of class methods. -
The index of a default parameter inside the emitted host signature is now taken from the emitted signature itself rather than from the source parameter list. The two coincide as long as every source parameter produces exactly one signature entry, which is no longer the case now that the
thisannotation is skipped.
-
-
e2880fd: 族 06 收口接线:补上分片被终止前未落地的两段,并把它们钉住。
- 965 的最后一段:实参抽取只处理数字与字符串字面量 ⇒
f(null)根本没有 实参可判 ⇒ 调用点前置条件整条不查 ⇒lit(null)/lit(undefined)契约 对 null 实参永远不报违例(假绿)。null 与 undefined 现在都进实参位, 且分属两个域(undefined是全局绑定,不是局部变量)。 - 348 的最后一段:check 签名面的参数类型走的是自己的 widen 路径 ⇒
lit(1)被印成number,而契约面印lit(1)、dts 面印1⇒ 同一份契约 三个面三种答案。签名面现在与契约面、dts 面对齐。 - 渲染面修了一个会崩的字面量拼法:bigint 走
JSON.stringify直接抛Do not know how to serialize a BigInt(NaN / ±Infinity 印成null、-0抹成0)——字面量展示现在按 JS 字面量拼法。
- 965 的最后一段:实参抽取只处理数字与字符串字面量 ⇒
-
5c750f2: Dates and regular expressions now keep their state, and a URL keeps its query parameters.
Date.prototype.set*update the time value. The setters used to do nothing, so the rendered date was stale.Date.prototype.toJSONreturnsnullfor an invalid date (a time value ofNaN), as in the language, instead of a string.- The result of
RegExp.prototype.execand of a non-globalmatchis array-like again, so array methods, spreading andfor…ofwork on it. - A
URLcarries itssearchParams, and aURLSearchParamscarries its entries.new URL("https://x/?a=1").searchParams.get("a")is"1",searchParams.get("z")isnull,searchParams.sizeis the number of entries, andsearchParams.toString()is the query string.set,appendanddeleteupdate the same object.
-
4d1a249:
Object.prototype.toStringnow reports the right label for functions that are declared withasyncor*.export async function f() {}used to report[object Function], and so didexport function* f() {}andexport async function* f() {}. A function declared withasyncor*is compiled to a plain host function, so the kind could not be recovered from the host value the way it is for a function expression, an arrow function, or a method.- The declaration site now records the kind explicitly, and
Object.prototype.toString.call(f)reports[object AsyncFunction],[object GeneratorFunction], and[object AsyncGeneratorFunction]respectively — the same labels the other declaration forms already produced. - The kind is recorded before the declaration, so a function that is called before its declaration — function declarations are hoisted — still gets the right label.
-
af09752:
Object.definePropertyevaluates its arguments once, anddelete/Object.definePropertynow take effect at the point where they are evaluated.Object.defineProperty(o, key, desc)was emitted twice in statement position: once as the call itself and once as the write-back, and the write-back re-evaluated the argument expressions. A side effect in the key or in the descriptor therefore ran twice. The write-back now happens inside the call's own evaluation, so every argument is evaluated once.delete o[k]andObject.defineProperty(o, …)used to be emitted as a read-only value plus a separate statement-level write-back. When they appeared inside a larger expression, the write-back could only run after the whole statement, so a read that followed thedeletein the same expression still saw the old value (delete a[0]followed by0 in areportedtrue). Both now delete / define at the point of evaluation, so later reads in the same expression observe the change.
-
fcaa9e9: fix(core): 描述符 / 生成器协议面 / 任意 brand 的
.length槽(族 58 · core runtime)5 条精度债(族 58 台账 · W8 分片)——全部对拍原生(node v26.10.0 宿主实测), 新增回归钉
packages/core/src/algebra/__tests__/eval-bug-58-descriptor-generator-proto.test.ts(34 例)。- Bug 197 · 描述符 exists 分支的
writable:true重定义:台账记「writable:true的重定义不覆盖旧的[[Writable]]」——该缺陷在 HEAD 已被修掉(Bug 292 的 双向标志表工作:描述符的显式字段覆盖当前值),普通对象路径已逐字对齐原生 (重定义后Object.getOwnPropertyDescriptor(o,"x").writable === true)。本片 补上残留面:原型对象(X.prototype)上defineProperty装的自有数据槽 在 gOPD 读面此前落「descriptor | undefined」并 ⇒ 读.writable即定抛 TypeError(wrong-throw:原生恒有描述符)⇒ 现在读面折精确描述符 (值 + writable/enumerable/configurable 三标志),「重定义后读出新的 writable」 在对象面与原型面都成立。 - Bug 321 · 原型 brand 描述符面:
Object.getOwnPropertyNames(Error.prototype)此前折保守string[]、Object.hasOwn(Error.prototype, "name")此前折保守 boolean ⇒ 现在对引擎已建模成员的原型(Error 家族)折精确: gOPN(Error.prototype) =["constructor","name","message","toString"]、 gOPN(TypeError.prototype) =["constructor","name","message"](toString是 继承的,不入自有键)、Object.hasOwn(..., "name"/"message"/"toString")折 true、表外键折 false、Object.keys(Error.prototype)折精确空元组。 - 类原型的 gOPN / keys 面:类原型的
Object.getOwnPropertyNames此前折保守string[]⇒ 现在对引擎已建模成员的类原型折精确清单 (["constructor", ...自有方法/访问器]),Object.keys(类原型)折精确空元组 (原生:类成员全不可枚举),Object.hasOwn(类原型, ...)折确定 boolean。 口径边界(诚实写明):只覆盖引擎已建模成员者——其余原型(Array/Object/Map…) 仍走既有保守域string[](不扩 Abs 形状:扩形状是 A 类架构债);类原型 的方法与访问器交错定义序在引擎的类注册表里不可复原(methods / accessors 分 两张表)⇒ 两者同时存在时仍给保守域。 - 生成器
prototype.next协议面:g.prototype.next此前折 exact undefined (wrong-exact;原生是函数)⇒ 现在%GeneratorPrototype%的三个协议方法 (next / return / throw)都可读(typeof === "function"),且借用调用按接收者 派发(g.prototype.next.call(it)真的推进该生成器 ⇒ 与it.next()同款语义); 无接收者调用原生定抛 TypeError ⇒ 引擎同抛(此前折 unknown 且不记 may-throw ⇒ L2 门禁假绿)。协议槽标 internal——原生该方法在原型链上而非原型对象 的自有键 ⇒ 自有面(hasOwnProperty / gOPN / 枚举)不可见(gOPN(g.prototype)精确空元组,与原生[]一致)。 .lengthslot 在任意 brand 上不可读:core 的$len此前只认 String / TypedArray 家族 / Arguments / Proxy 几个品牌 ⇒ 其余 brand(含 env 声明面建模的 Buffer 实例)一律折 unknown,buf.length拿不到 ⇒ 现在$len读任意 brand 内层 obj 的非可选"length"槽(与$get品牌内层槽读同口径 ⇒buf.length与buf["length"]一致);无该槽的 brand 仍折 unknown。
附带(族 57 第 6 条 ② 的闭合点 · 主 agent 追加):普通对象面的符号键
in/delete槽寻址此前只认 well-known 符号 ⇒ 用户符号的s in o折 boolean 域(原生 true)、well-known 符号的delete o[Symbol.iterator]不删槽 (原生 false)⇒ 现在$in/$del的槽键统一走symbolSlotKeyOf(well-known →"@@X";用户符号 →"@@sym#<身份 id>",Symbol("x")每次新 id、Symbol.for("x")驻留同 id,不按 description——description 可撞会串键)。 裸字符串键 / 数字键 / 未定义键三类输入不崩且行为与改前逐字一致 (isSymbolAbs/symbolSlotKeyOf先判「是不是 Abs」再取 shape)。已知偏差(诚实写明):
- 未建模成员的原型的 gOPN / hasOwn 仍走既有保守域(
string[]/ boolean 域)—— 扩到全体原型需要扩 Abs 形状承载原型自有键集 ⇒ 归 A 类架构债,本片不做。 - 类原型的方法/访问器交错定义序不可复原 ⇒ 该形态仍走保守域。
- 生成器协议面的函数身份面(
g.prototype.next === it.next原生 true)仍 折 false(引擎的协议方法值与实例内部槽是两个函数对象)——本次只修「可读 + 可调 + 借用调用按接收者派发」。
- Bug 197 · 描述符 exists 分支的
-
7fea13a: Destructuring follows the iteration protocol of the value it destructures, and the temporary names the transpiler generates no longer collide with the names in the source.
-
Array destructuring always read the receiver by index (
$idx(receiver, i)). A user iterable — an object with its own@@iteratormethod — has no index slots, so every element folded to a confidentundefinedinstead of the value the iterator yields. The receiver is now checked with the real iteration protocol (GetIterator+IteratorNext) and the elements are taken in iteration order, so the folded value matches JavaScript element by element. Values that the engine models itself (arrays, strings,Set,Map, generators, collection iterators) keep their exact element domains, and a receiver that is not iterable still throwsTypeError. -
A destructuring target that is a member expression with a default value (
({ a: o.x = 1 } = src)) dropped the write-back: the member was treated as a nested pattern, so the target kept its old value. The member is now read, defaulted, and written back. -
The temporary names the transpiler generates for destructuring (
_d0,_n1,_p0,_rest0, …) did not avoid the identifiers used in the source. A user declaration with the same name produced a duplicate lexical declaration, which is aSyntaxError: the whole module failed to evaluate and every export folded tounknown. Inside a function body the temporary also shadowed a module-level binding of the same name and the user read a wrong value. The names now avoid the identifiers of the source, and the shared counter is pre-seeded so that even the first allocation avoids them.As part of this, the placeholder function body (
noBody) is now a single shared object. Two separate copies made an identity check for "is this a placeholder function" fail across modules, which made the engine's own iterators look like user iterables and made[...Array.from('ab').keys()]throw aTypeErrorthat JavaScript does not throw.
-
-
9ccffb3: Destructuring with a computed key now reads the property the key points at.
- In
const { [k]: v } = o, a bare identifier used as a computed key was taken as the name of the key instead of being evaluated, so the engine reado["k"]and returnedundefinedfor every such destructuring — andkwas never evaluated at all. - A computed key is now evaluated and the property it selects is read. The
key expression is evaluated once, as in JavaScript, and the same value is
used for the read and for the rest element's exclusion set — so
const { [k]: v, ...r } = ono longer leavesk's property behind inr. - Literal computed keys (
{ [1]: v },{ ["x"]: v }) and plain keys ({ x: v }) are unaffected.
- In
-
e9fdaa7: Destructured bindings follow the mutability of the binding they come from, and a destructuring export exports the real names.
- A binding that came from a destructuring pattern was always emitted as
const, even when the binding itself is mutable: a parameter, aletorvarloop head. Assigning to such a binding inside the body threw aTypeErroralthough the original code does not throw, which turned into a falseentry may throwreport and anunknownreturn value. A parameter or alet/varhead now keeps its binding mutable, while aconsthead still throws. export const { a } = …andexport const [a] = …exported the internal temporary name instead of the destructured names, so the real export was missing and importing it from another module producedunknown. The export now lists the names that were actually bound.
- A binding that came from a destructuring pattern was always emitted as
-
7fea13a: The
@nudo:asand@nudo:replacedirectives now affect exactly the node they annotate, andthisinside a default parameter binds to the function that owns the parameter.@nudo:asis a type override: the annotated expression must still be evaluated. The transpiler replaced the whole expression with the injected constant, so the side effects of the expression never happened, the expression's throws domain disappeared (JSON.parsefailures were swallowed and the entry point was reported as not throwing), and the runtime value was wrong. The expression is now evaluated once and the injected value is used as the result.@nudo:replacehad the same problem: the replaced sub-expression was never evaluated, so its side effects were lost and its throws domain disappeared. It is now evaluated once, and the injected value is used as the result.- The scope of both directives was decided by a window of line numbers, so an unrelated expression on the same line, the next statement on the same line, a nested block or a nested function body was overridden or replaced as well. The scope is now decided by the identity of the annotated node, so only that node is affected.
thisinside a default parameter expression bound to thethisof the enclosing scope. In JavaScript the default value is evaluated in the scope of the function that owns the parameter, sothisis that function's ownthis. The transpiler only looked forthisin the function body, so the default expression used the outerthis: a default ofthis.vreturned the outer object's value instead of throwing, and a default ofthisreturnedundefinedinstead of the receiver.- The body of an arrow function or a function expression is an expression,
and the value of
o.n++had to be captured before the write-back ran. The expression is now captured first, the write-back second, and the captured value is returned. - The optional call
o.b?.()short-circuited only the call itself: wheno.bwas nullish, the rest of the chain was still evaluated andundefined.cwas reported as a definiteTypeError. The whole chain is now short-circuited, like the optional member accesso.b?.calready was.
-
69e67d3: 族 29 修复 S6:Bug 882 · Bug 890 —— node:util 品牌形参函数的普通调用面 L2 假红 + env promise 缺 rejected 通道(catch 臂被当成死代码)。
Bug 882(core 侧根因) —
promisify/callbackify/inherits/isDeepStrictEqual这类品牌形参函数在具名导入调用面 (import { promisify } from "node:util"⇒promisify(readFile))报nudo:entry-may-throw,而成员调用面(util.promisify(readFile))正常 ⇒ 同一函数两种口径。根因:普通调用面把裸宿主值(宿主函数 / 宿主构造器 / 函数声明绑定)原样灌进bindTypeVars,arg.shape解引用undefined⇒ TypeError 冒泡 ⇒ 上层记 may TypeError ⇒ L2 假红(原生必不抛)。packages/core/src/algebra/hof.ts的bindTypeVars:无形状的实参不参与 类型变量绑定(此前直接解引用arg.shape崩)。- 普通调用面也做实参归一化(与成员调用面同款):
hof.ts新增setRawArgNormalizer注册钩子,packages/core/src/algebra/exec/class/invoke.ts在加载期注册asAbsVal门面 ⇒ 两个调用面共用同一归一化 ⇒ 同一宿主函数恒 同一 Abs 身份 ⇒ 两种口径一致。
Bug 890 — env 造的 promise 没有 rejected 通道 ⇒ core 读成「确定 fulfilled」⇒
catch臂被当成死代码 ⇒ 引擎给出确定的错值(原生fs/promises.readFile/fetch/crypto.subtle.digest都可能拒绝)。-
core 侧零改动:
settledFulfilledOf/then/catch/$await对 带rejected通道的 promise 处理已经正确(rejected !== undefined⇒ 不判「确定 fulfilled」;catch走「两臂 join」分支;$await把拒绝臂送进 throw 通道 ⇒try/catch可吸收 ⇒ catch 臂可达)。本分片只补回归钉。 -
env 侧改法(
packages/env/src/abs-helpers.ts的promiseOf()):给 promise 形状补上rejected通道 ⇒ 两臂均可能 ⇒ catch 臂保持活:export function promiseOf(inner: Abs): Abs {return makeAbs({ k: "eff", eff: "promise", inner, rejected: unknown },undefined,undefined,"exact",);}(
unknown= env 侧已有的 unknown Abs——拒绝 reason 不可知 ⇒ 两臂均可能;rejected是态信息,不进 leq / 指纹 / check 等价。)
-
69e67d3: 族 29 主 agent 收口:跨分片组合出来的 4 个缺口。
- Bug 884(web 侧):
web.ts的structuredClone声明已删(node 侧同款 修法在node.ts)⇒ 回落宿主内建 ⇒ 不可克隆值的 throws 面(宿主DOMException/DataCloneError)不再被 env 声明整段吃掉 ⇒ L2 门禁恢复。 enforceArgs的并集实参过严(S3 越界发现,主 agent 修正):实参是并集 (如string | undefined)时,leqAbs(sum, pt)整体判 false ⇒ 旧实现把它 当「确定不符 ⇒ 必抛 TypeError」,而原生只在undefined分支抛 ⇒ 可能假红。 现在逐成员判定:只有全部分支都不兼容才判必抛,部分分支不兼容判 may-throw ⇒ 与原生同口径。- Bug 886 / 889 的组合缺口(S1 删声明 + S5 覆盖推导撞出来的):web env 的
TextDecoder声明已删(宿主才有精确的RangeError与「类不可裸调」语义), 但 core 的构造面evalBuiltinNew不认TextDecoder⇒ ①nudo test报「Built-in API "TextDecoder" is not covered by Nudo's type inference」(假阳);② Abs 面与$new宿主面口径分裂。现在evalBuiltinNew补case "TextDecoder"⇒ 两侧同 builder (makeTextDecoderAbs),假阳消失。 - 「已被覆盖」判定里的手写例外已删(族 29 Bug 865 的根因收口):core 其实
已精确建模
WeakRef(evalBuiltinNew的case "WeakRef"),但三条既有 service 契约把WeakRef当作「未被覆盖的全局」样例钉住,于是判定里留了 一张手写例外表——那正是 Bug 865 要消灭的「手写白名单」换了个地方继续写。 现在例外表删除,三条契约的样例全局换成真正未被建模的宿主全局Atomics(core 无Atomics建模面;它是globalThis里的数据属性 ⇒ 不触发访问器副作用),契约的意图(未建模全局要报builtin-unknown、 且不与unknown-global双报)完全保留。
- Bug 884(web 侧):
-
b0878e3: 契约投影里的
__proto__形参不再被吞掉(族 17 · Bug 606 的 core 侧两处)。- 投影字段表改无原型(
algebra/projection.ts的projectObj):槽位被抄进 一个普通对象fields⇒ 键__proto__的赋值命中Object.prototype.__proto__的原型 setter ⇒ 该键永不成自有属性 ⇒Object.entries()看不到它 ⇒ 契约投影静默丢掉__proto__形参 (zod 产物丢键,而 dts 面走另一条路径是对的 ⇒ 跨产物面自相矛盾)。 改用Object.create(null)(与constraint.ts的partial()同一惯例; core 侧消费全走Object.entries/Object.hasOwn/!== undefined⇒ 无原型安全)。 - 键渲染改计算键(
algebra/codegen-escape.ts的formatObjectKey):__proto__虽然长得像普通标识符,但在 JS 对象字面量里__proto__: v是 原型 setter(不是自有属性)⇒ 运行时该键根本不存在(zod 形状丢键)。 一律写成计算键["__proto__"]—— 计算键是普通自有属性。
- 投影字段表改无原型(
-
493b8c2: fix(core): sum 里的构造器成员(fn 形状)不再被误判「确定没有此方法」
病灶(
packages/core/src/algebra/exec/class/invoke.ts·memberLikelyHasMethod): union 派发面按「成员大概有这个方法吗」过滤 sum 成员,旧判据只有 prim / brand / obj / arr / tuple / eff 分支 —— fn 落尾部return false⇒ sum 里的 fn 成员一律被判「确定没有此方法」⇒ 被跳过 ⇒ 合并 fn 全局的 静态成员调用(Response.json(x))折unknown。触发面:多个
@nudo:env名合并成并集后,同名全局(如Response)是两个 构造器声明的 sum ⇒mk(x) { return Response.json(x); }的签名从Response | {…}(单 env 时的精度)退成unknown,并附一条nudo:unknown-inferencewarning。修法:给
memberLikelyHasMethod补 fn 分支 —— 判据改为「fn 的 静态槽(dual-facet:构造器静态成员挂在 fn 的shape.slots上)里有没有这个名」:- 静态槽里有 ⇒ 可派发;
- 静态槽明确不含 ⇒ 确定没有(原生读 undefined ⇒ 调用 TypeError)⇒ 记 may-throw + 跳过该成员(该分支不贡献值);
- fn 没有静态面模型(
shape.slots缺席)⇒ 判据不足 ⇒ 保守放行 (不可判不可抛:宁可多派发一次,不可凭空造 may-throw ⇒ 假红)。
「没有 slots」与「slots 为空对象」的区别已写进代码注释:
slots === undefined= 没有静态面模型(判据不足);slots存在但为空 = 静态面模型为空(表外名 确定缺席)。另:Function.prototype/Object.prototype名(toString/call/bind…)沿函数对象恒可得 ⇒ 不得判缺席。影响面:prim / brand / obj / arr / tuple / eff 的既有 union 派发行为逐字不变 (判据分支只新增 fn 一支);新增的 may-throw 只在「sum 成员是 fn 且其静态面 模型明确不含该名」时出现(原生该分支确实抛 TypeError)。
-
d7ae28a:
forloop stepping now follows the UpdateExpression (ToNumeric± 1) semantics and no longer takes the step expression's value as the loop state.- A
for (let i = …; …; i++)counter loweredi++to$add(i, 1), which is the binary+: a bigint counter raisedTypeError(bigint + numbertakes the mixed-bigint arm) and a string counter concatenated ("5"++is6natively, the engine produced"51","511", … and ran to the iteration bound). The mainforpath now uses$updateAdd/$updateSub, matching the three other step lowerings in the tree. - The step closure's return value was used as the
$forstate thread. For a sequence step (i++, n++) that value is the last element's value — the postfix increment's old value — so the loop variable stalled or over-ran (for (let i = 0; i < 3; i++, n++) { n += 10 }folded11instead of33). The step now only contributes side effects and the state thread is always the loop variable itself, the same contract the non-declarationforfallback path already used.
- A
-
edc7590: Statement-level
if/switchno longer roll back the side effects of their own test / discriminant.The fork snapshot (
__fk0_*forif,__sw0_*forswitch) is the baseline each branch is restored to when it starts. The baseline has to be taken after the test / discriminant was evaluated: the snapshot used to be emitted before$fork(...), while the test is the first argument of that call and is therefore evaluated later — so every side effect of the test (a call, a getter, an assignment, an increment) was undone when the branch started.if (f()) { … }folded0instead of1,if ((n = 5) > 0) { … }folded0instead of5, andswitch (f()) { … }folded0instead of1. The test / discriminant is now evaluated into a temporary first, the snapshot is taken afterwards, and$fork/$switchuse that temporary. -
5c750f2:
Object.prototype.toStringnow tells an async function from a generator.Object.prototype.toString.call(async function () {})was"[object Function]"for every function shape. The label now follows the language:function () {}→"[object Function]"async function () {}→"[object AsyncFunction]"function* () {}→"[object GeneratorFunction]"async function* () {}→"[object AsyncGeneratorFunction]"
The same holds for a method shorthand (
{ async m() {} }.m), for a class method (class A { async m() {} }→A.prototype.m) and for a static class method.A plain
function f() {}declaration reports"[object Function]"— the label the language gives it. -
ed4d259: fix(core): 引擎内部临时名避让补齐 switch / 自增 IIFE / 类 setter 别名 / 循环协议 (附录 A#4 · Bug 1159)
Bug 1058/1059 约定「引擎内部临时名必须避开用户标识符」,此前落到
__nudoMp*/ 调用族 / 可选链 / 短路 / 对象 / 类形参。附录 A#4 登记为「实测无害」的残留经 逐点探针全部可触发(体内确有用户表达式在引擎临时名的块作用域里求值), 现统一改经internalTmpName/internalTmpNameSet分配:- switch 的 case 测试辅助族 / 共享体名(
__swT/__swTV/__swTD/__swAllDone/__swTestRead/__swEval/__swEvalAll/__swI/__swJ/__swBody{n}):测试 thunk 与臂 thunk 都在该块作用域里求值用户 表达式 ⇒ 用户同名外层绑定被遮蔽(const __swAllDone = 42被读成引擎的false)或撞 TDZ(臂入口注入的if (!__swTestRead)在用户let __swTestRead声明之前读 ⇒ ReferenceError)。 - switch 臂 break 标签(
__nudoSw{n}):标签是信号字符串 ($loopBreak/$isBreakTo按字符串比对)⇒ 与用户同名标签块相撞时,臂内 无标签break的信号被用户的标签块 catch 吸收 ⇒ switch 不退出、块后续 语句照跑(错值)。 - 自增 IIFE(
expr/operators.ts的__v/__old、非路径 delete IIFE 的__nudoDelP/__nudoDelK/__nudoDelD):IIFE 体内求值 / 重复发射用户 表达式(接收者、写目标标识符、父对象、计算键)⇒ 遮蔽或 TDZ。除附录登记项外, 同文件另发现两处同族残留(标识符后缀x++的__old、delete IIFE),一并修复。 - 类 setter 别名载体(
class-emit.ts的__nab{i}/__nabs):thunk 体内 求值用户 setter 体 ⇒ 遮蔽用户同名外层绑定。 - 循环协议公共名(
stmt/statement.ts):forfallback 的$for状态线程 形参__n(测试 / 体 thunk 内联用户源码 ⇒let __n = 100; for (i = 0; __n < 3; i++)的条件被读成合成计数器)与 do-while 首轮标记__nudoDwFirst(块级绑定 + 体 thunk 内联用户体)。 - 表达式侧两处同族残留(
expr/function.ts的宿主 rest 形参名__rest_raw与expr/assignment.ts的解构赋值 IIFE 形参__d,按同族 grep 指令扩展): 前者与用户同名 rest 形参重复声明(SyntaxError),后者让默认值表达式读到 IIFE 实参对象。 - for-in 接收者临时名(
stmt/statement.ts的__fir{n},按同族 grep 指令 发现的第 4 处):const __fir{n} = (用户接收者表达式)的初始化器与循环体都在 该块里求值用户代码 ⇒ 首轮重复声明 SyntaxError;Bug 1139 的重试仅碰巧 推高计数器躲开单名碰撞,两次尝试的序号都被用户占用时宿主 SyntaxError 直接 冒出runTranspiled。
无碰撞时基名原样返回 ⇒ 产物逐字不变(9507 条差分语料 + 手写 switch / label / 类 / 私有名 / delete 语料,
git archive HEAD的旧发射器与新版对拍 0 diff); 撞名时改名只发生在该源文本内(基名仍由既有计数器决定,计数器行为未变) ⇒ 无缓存键 / ABI 变更。诊断语码与门禁口径不变。 - switch 的 case 测试辅助族 / 共享体名(
-
e20c128:
import { "a-b" as x } from "…"binds the arbitrary module export name.ES2022 allows importing an arbitrary module export name. The transpiler rendered such a specifier with
String(s.imported), buts.importedis aStringLiteralnode in that form, soString(node)produced"[object Object]". The generated import statement was therefore invalid JavaScript, the whole module failed to evaluate, and the imported value silently degraded tounknown—nudo checkthen reported a single warning and no error, i.e. a false green.The import side now renders a string export name with its quotes, like the export side already did, and the binding lookup strips the quotes to get the actual export name.
-
abff33b:
instanceof按真实原型链判定:补上闭 obj 接收者与函数值接收者两面(Bug 205 · 族 43 · 片 S7)族 02 已把 brand 实例侧(
F.prototype = {}/Object.setPrototypeOf(f, null)) 从「按构造器名匹配」改成「沿记录的原型链做身份比较」。本片补上此前仍 降抽象的两面,并把宿主口径钉进回归钉。- 闭 obj 接收者(对象字面量):它的
[[Prototype]]恰是Object.prototype⇒ 原型链恰是[Object.prototype](下一环 null)⇒ 与 右操作数的prototype做身份比较即可定论。此前只有内建构造器名 (Array/Date/ …)折精确false,用户类 / 用户函数一律折抽象boolean:({}) instanceof F的原生值是false,引擎却答「不知道」。 现在:用户类 / 用户函数 → 精确false;F.prototype = Object.prototype之后 → 精确true(原型身份命中)。 - 左操作数是宿主函数(
function F(){}/function () {}):转译后进$instanceof的左值不是 Abs,此前直读left.shape崩 ⇒ 引擎 fail-closed 折unknown。原生F instanceof Function/F instanceof Object都是true(函数的[[Prototype]]是Function.prototype)。现在折精确true。 - 口径更正(宿主实测):
new F() instanceof Function的原生值是false,不是true——普通函数F的实例原型链是f → F.prototype → Object.prototype → null,Function.prototype不在其中。 只有以 Function 为基类的类实例(class X extends Function)才是true。 引擎此前已给精确false(与原生一致),本片保持该口径并写入回归钉——此前 修复台账里「原生 true」的记述与宿主实测不符,以本钉为准。 - 不误判护栏:右操作数的
prototype不可判时(箭头函数 / async 函数 / 生成器函数——原生可能无.prototype⇒ 定抛TypeError;bind产物—— 可构造但无.prototype)⇒ 保持抽象boolean,不折精确false。引擎替身 对象(生成器对象等内部槽 obj)同样不按「闭 obj ⇒ 原型链 =[Object.prototype]」定论(其真实原型不是Object.prototype)。 - 已知债(不在本片范围):替换 /
setPrototypeOf进来的新原型,其自身 的[[Prototype]]链未建模 ⇒ 引擎诚实降boolean(原生 true/false vs 引擎 boolean —— sound 不误判)。本片不改既有钉eval-bug-205-instanceof-prototype-chain.test.ts的该条断言。
- 闭 obj 接收者(对象字面量):它的
-
e3b8791: Iteration follows the protocol of the value being iterated, and the iteration protocol is now honoured when it is left early.
- A
Mapor aSetwas iterated over a snapshot taken when the iterator was created, so an entry added during the iteration was never visited and a deleted entry was still visited. The iterator is now a live view of the receiver. - An iterator that is left early — through
break,returnorthrow— never told the iterated value about it. Thereturnmethod of a user iterator is now called when the iteration is left early, as the specification requires, including the cases where the method is missing, is not callable, or does not return an object. for..inover an instance of a class only visited the own slots of the instance and skipped everything on the prototype chain. The prototype chain is walked now.- A tagged template object was modelled as a plain object: its
properties were enumerable, it was not frozen, and the array methods
were missing. It is now a frozen array exotic object, and
Array.isArrayreportstruefor it, as in JavaScript. - A
Stringwrapper object was not iterable, so spreading one was reported as a possibleTypeErroreven though JavaScript spreads it into its characters. ANumberwrapper is still not iterable, and is still reported as a possible error. - A user-defined
@@iteratormethod was never called byfor..ofor byArray.from: the loop ran once and the element domain was unknown. The iteration protocol is now used, and the number of elements is taken from the iterator when it reports that it is done. - The members of a user-defined iterable are now read in iteration order and with the value the iterator yields, instead of being read as index properties.
- A
-
5c750f2:
JSON.stringifyandJSON.parsehandle the values the language handles.JSON.parsecalls the reviver. The callback used to be dropped entirely, so its side effects never happened;JSON.stringifyhas always called its replacer, and the two now agree.- A nested built-in no longer makes
JSON.stringifyreport a possibleTypeError.JSON.stringify({p: Promise.resolve(1)})is'{"p":{}}', and the same holds for aMap, aSetor a generator object nested in the value. - A replacer that is not callable is ignored, as in the language.
JSON.stringify({a: 1}, new Map())is'{"a":1}'and does not report a throw; a constructor such asMapis callable and is still reported as a possibleTypeError.
-
c80456a: Logical assignment (
||=/&&=/??=) only writes in the branch that actually assigns.Only the branch that performs the assignment does a PutValue —
o.a ||= 2does not write when the left-hand side is truthy (no setter call, noTypeErroron a read-only accessor). The write-back used to wrap the whole short-circuit result, so the "keep the original value" branch wrote as well: a getter-only property raised a spuriousTypeError(thenudo checkgate reportedmay throw TypeErrorfor code that never throws) and a property with a setter had its setter called one time too many.The write-back now lives inside the assigning branch, while the "keep the original value" branch just returns the value it read. The write-back root joins the fork binding set, so a write performed inside a branch is joined across branches instead of letting the later branch overwrite the earlier one.
-
e6c4586: LSP 符号 / 观察面与导出面对齐:默认导出、导出类实例方法、CJS 成员导出不再 整段消失,跨模块调用点补上
call@观察透镜(Bug 753 / 769 / 998 / 1034)。export default function此前只存在于 hover / 大纲面,CodeLens 与 inlayHint 的 interface 档(● contract / imp/⚡ persist interface/⚡ draft interface)整段缺失。默认导出现在与具名导出同形。- 导出类的实例方法(
Counter.inc)此前只在 hover 面可见:CodeLens 没有 interface 档,inlayHint 也没有返回 inlay。类方法现在以Class.method为契约键进入两面,与顶层导出函数同形。 - CJS 成员导出(
exports.f = fn/module.exports.f = fn)此前在 documentSymbol / workspace symbol / inlayHint / semanticTokens 四个面 全部不可见,CodeLens 也没有 interface 档——而诊断面却点名该导出。 四面现在与 ESM 具名导出同形(导出键带 function 档 + interface 档 modifier)。 - 跨模块调用点(
import { add } from "./lib.js"后调用add(x, 2))此前 不在调用方文件的 CodeLens 上投影——CLInudo test已经打印该事实。 调用方文件现在出现与 CLI 同形的call@L4lens;被导入函数的 entry@ 仍属被导入模块,不在调用方落镜。
core 侧只改了内部未导出函数
listFunctions的函数体(导出类实例方法与 CJS 成员导出的枚举),未新增任何导出名。 -
f87c9f9: fix(lsp/core): IDE 面与 CLI 同源装配注入 + info 级 check 诊断不再被提前砍掉(Bug 785 / 786 / 780 / 779 vite 半)
- Bug 785(注入装配):LSP 侧从不采集行内指令(
@nudo:as/@nudo:replace)⇒ CLI 与 IDE 对同一份文件给出相反的门禁结论与签名 (IDE 假红:用户声明过raw是 number,IDE 仍按 string 判raw.toFixed不存在并报nudo:entry-may-throw)。新增 LSP 侧注入装配器buildLspInjection(packages/lsp/src/agent-tools.ts)—— 与 CLIbuildCheckInjection同口径(@nudo:as/@nudo:replace/@nudo:mock/ env 全局 / 模块图),不从 lsp 反向 import nudojs, 零新增 core / service 导出;agent check 工具面把它交给checkSource({ inject })⇒nudo/check由ok=false · 1 error · unknown #partial变为ok=true · 0 error · string(与 CLI 同款结论)。 - Bug 786(注入传递协议 + inlay 半):
CollectAbsInlaysOpts新增inject字段并透传给generalizeFromAst(core 侧只改内部函数体、 零新增 core 导出 ⇒ 不破 core 冻结面)⇒ inlay 面不再把「行内指令缺席」 显示成unknown(Nudo 词汇里 = 「推断失败」)。对外交付注入传递协议:buildLspInjection(filePath, source, { loadModule?, modules? }) → RunTranspiledOptions,消费方统一走checkSource({ inject })/generalizeFromAst({ inject })/collectAbsInlays({ inject })。 - Bug 780(agent 侧):
nudo.trace此前只读params.file⇒ LSP 自产的file://…uri 形态与executeCommand位置参数形态都让params.file变undefined⇒ 观察透镜 100% 抛 TypeError。现在FunctionToolParams收uri键(与file二选一,缺省时报共用入口闸的file is required …而不是裸 TypeError),并导出位置参数桥tracePositionalArgs([uri, fn])(形态不合法 ⇒undefined,由命令桥报协议层参数形态错误)。 - Bug 779(vite 半):
checkIssuesToDiagnostics在转成 vite Diagnostic 之前就把 info 级砍掉 ⇒ 下游档位过滤器永远看不到 info ⇒nudo.analysis.diagnostics: "verbose"对 check 诊断是空操作 (nudo:assume-relied/nudo:invariant-relied/nudo:opaque-result永不上屏)。转换点改为保留三档,档位取舍只由filterDiagnosticsByLevel决定;info 级走 vite 的 info 通道 (不混进 warn 流),warning 计数不含 info。
- Bug 785(注入装配):LSP 侧从不采集行内指令(
-
5c750f2:
Math.minandMath.maxnow keep a satisfiable range.The bounds of
minandmaxwere merged the wrong way round, soMath.min(x, 0)claimed both> 0and≤ 0at the same time. A function that always returns0satisfied a@nudo:contract return number().gt(0)contract, and the value was reported as exactly"pos". The bounds are now merged the right way round, so the contract is rejected and the value is reported as"nonpos". -
a3c95a4:
o.p++and++o.pread the member exactly once.A native
o.p++is one Get plus one Put. The engine split the update into an expression part (which evaluated the new value) and a statement-level rebinding (which wrote the value back), and both parts emitted their ownreadPathSrc(path)— so the member was read twice. A getter therefore ran twice (doubling its side effects), and a stateful getter returned a different value on the second read, which made even the result of the update wrong ("1:2"instead of"1:1").The member target is now self-contained like the identifier target: the value is read once, the write-back happens inside the expression, and the statement-level rebinding no longer adds a second read or a second increment.
-
e3b8791: Writing a member now goes through the same checks JavaScript does.
- A write only looked at the receiver's own slots, own accessors and own
attribute flags: the
writable: falseflag was never consulted for functions, class values or indexed properties, and the prototype chain was not walked at all. Writing to a read-only property inherited from a prototype succeeded silently, and a setter on the prototype was never called. The write now follows the ordinary internal method: the prototype chain is walked, an accessor without a setter raises aTypeError, a non-writable or frozen property raises aTypeError, and a setter is invoked. An instance of a user class is covered too. - A write through a proxy rejected only the literal
falsereturned by the trap, so a trap returning0,"",nullorundefinedwas accepted. Every falsy result is now a rejection. - A write to a built-in prototype was shadowed by the built-in method
table: after
Array.prototype.push = 5, readingArray.prototype.pushstill returned the built-in function and the write was ignored. The receiver's own slot now wins, as the specification's lookup order requires. - An array's
lengthaccepted values that are not numbers:a.length = undefinedanda.length = {}did not raise aRangeError. The value is converted to a number first, then checked to be an integer in range. - A sealed array accepted a truncating
lengthwrite,pop()andshift()without raising aTypeError. The empty array still behaves like the original, and an array that was only made non-extensible still accepts the truncation, exactly as in JavaScript. delete a.lengthwas reported as successful. Thelengthproperty of an array is not configurable, so the delete now raises aTypeError.
- A write only looked at the receiver's own slots, own accessors and own
attribute flags: the
-
7fea13a: Assignments, calls and object literals now evaluate their parts in the order JavaScript specifies.
- An assignment to a member expression evaluated the right-hand side before the object and the computed key. The member write was emitted as an immediately-invoked function whose argument was the right-hand side, so the value was computed first and the reference second; a computed key was inlined into both the read and the write and therefore ran twice. The reference (the object, every key, every intermediate value) is now evaluated into temporaries first, the right-hand side comes after, and a computed key is evaluated once and shared by the read and the write.
o.m(args)evaluated the arguments before readingo.m, so a getter ono.mran after the arguments instead of before them. The receiver and the member are now read before the arguments are evaluated, and the getter runs exactly once.__proto__: <expr>in an object literal had its value expression moved to the end of the literal, so the side effects of the properties ran in the wrong order. The value is now evaluated in place, in source order.o.a.b = vwrote back through every level of the path, so a getter ono.awas also assigned to. Only the last level is written back now; the intermediate levels are read, never written.- The write-back of a member update (
o.n++) is pinned by a regression test: it must happen at the moment the expression is evaluated, so thatiftests,switchdiscriminants and loop steps see the value before the write.
-
d56cbd7: Member write-backs now target an assignable binding, so modules with a member write-back no longer fail to evaluate when position recording is enabled.
With position recording on, the member path root used to be wrapped in
$nodoPos(name, line, column)— a read wrapper used to record where a value was read. The write-back sites then reused that same expression as the assignment target:$nodoPos(o, 2, 24) = $del($nodoPos(o, 2, 24), $lit("a"));That is not a valid assignment target, so the generated module threw a
SyntaxErrorwhen it was compiled, the whole module failed to evaluate, and every export of that module degraded tounknown. The LSP replay surface keeps position recording on, so hovering over any value in a module that writes to a member (o.a = 2,delete o.a,Object.defineProperty(o, …),o.a++) fell back to the declared shape instead of the evaluated one.The member path now carries the plain binding name separately from the instrumented read, and every write-back assigns to the plain name.
-
e5b3f38: 族 16 修复 M4:Bug 574 / 575 / 583 / 585 / 587 / 591 / 592 / 596 / 917 / 923 / 969 ——
nudo migrate strip的写盘面修好:两阶段(先算完再写)+ 事务写盘 ⇒ 语法错文件不再留下半写状态,错误信息点名文件;写目标前检测既有同名.js⇒ 不再静默覆盖手写 JS(--backup时先备份);--backup撞名改用*.1.bak并在输出里交代,不再静默跳过;侧车草稿落在草稿路径*.nudo.draft.js(不再冒充正式侧车*.nudo.js);产物的相对模块说明符按真实文件补成显式扩展名(./helper→./helper.js);notes 改为基于 AST 事实(注释 / 字符串里的 "enum" / "namespace" 不再误报);.cts产物不再谎称 CommonJS;.tsx明确拒绝(strip 不做 JSX 变换,不再产出 Node 加载不了的.jsx);单文件路径与目录路径走同一条侧车迁移逻辑(既有*.nudo.ts一并迁到*.nudo.js,产物契约不丢);目录级分析按模块计数(源.ts与产物.js是同一模块,不再翻倍)。 -
089d4ec:
import d, * as ns from "…"binds the namespace, and an empty class expression keeps itsextendsclause.-
The default + namespace import form was flattened into
import { default as d, * as ns } from "…", which is neither valid ESM nor matched by the namespace rewrite (the*has to follow the{directly), so the named branch treated*as an imported name and the namespace binding folded tounknown. The mixed form is now emitted in its standard ESM shape and rewritten accordingly. -
A class expression with an empty body took a fast path that emitted
$classExpr()beforeclassSpecOfread theextendsclause, so the prototype chain and the class registration were both lost:new B() instanceof Afoldedfalseandextends nulldid not raise itsTypeError. An empty body now only takes the fast path when the class has no superclass.
-
-
169ed52:
nudo checkandnudo check --fixnow analyse the same program, and the gate no longer accepts TypeScript-only syntax in a.jsfile.nudo check --fixfed the analyzer a different input set thannudo check: the auto-bind setting, the project directory and the injected modules were missing, and the mock environment was not assembled. A project could pass the gate and still be reported as broken by--fix, or the other way around. Both commands now build their analyzer input through one shared constructor.--fixalso materialised plans for findings that had been downgraded to a warning, so a diagnostic that no longer blocks the gate still wrote a sidecar into the user's repository. Only error-level findings are materialised now.- A
.jsfile containing TypeScript-only syntax (private x = 0,x as T) was parsed happily, so the gate reported success on a file that Node cannot even load. The parser now picks its plugins from the file extension, and the check face reports the syntax error instead. - A project-level path environment (
package.json#nudo.env) was resolved relative to the analysed file rather than to the project root, so a subdirectory file could not find the environment it declared. - Environments are merged with the harvested ones under the same precedence the test and service faces use, so a harvested export that does not collide with a handwritten environment is no longer dropped.
-
169ed52:
nudo checkno longer loses a failing input, misreports the gate tier, prints an unappliable diff, or stays green on a broken sidecar.- An input file that exists but cannot be read (permissions, I/O) escaped the
command as a raw
EACCESmessage. With--jsonthe command printed nothing at all, so a CI job got an empty stdout and a non-zero exit code without a machine-readable reason. The failure is now reported as a path error (nudo:path-io) inside the usual JSON envelope, and the human face prints the reason plus afix:hint. - The warning about an unknown
package.json#nudo.check.profilealways saidusing default strict, even when an explicitcheck.entryThrows(or a CLI flag) had put the gate into a different tier. The message now names the tier that is actually in effect, so it can no longer contradict the report. nudo check --fixprinted its own---/+++header in addition to the header of the unified diff, polluted the+++path field with the[fix] …explanation, and used absolute paths (which produceda//…). The diff now has a single header with a relative path, exactly like the siblingnudo test --freeze --dry-runoutput, and can be consumed bygit apply.- A sidecar that imports something that is not a constraint builder (for
example
import { totallyBogus } from "@nudojs/core") was diagnosed while the sidecar was executed, but the diagnosis was dropped as soon as the execution result was cached. Because the analyzer runs before the gate, the gate itself never saw it:nudo checkreported success and exited 0 on a sidecar that could not be loaded. The diagnosis is now cached together with the execution result and reported again on every cache hit, so the gate reportsnudo:interface-loadand turns red.
- An input file that exists but cannot be read (permissions, I/O) escaped the
command as a raw
-
169ed52: The disk cache, the LSP and the Vite plugin now agree with the CLI about environments, budgets and injected modules.
- The cache key did not contain the effective fork budget, so changing
NUDO_MAX_FORKSstill served the previous run's result. The effective value (environment variable, thenpackage.json, then the default) is now part of the key. - An invalid
nudo.check.entryThrowsvalue was reported once per checked file. The warning is now printed once per distinct invalid value. @nudo:asdid not apply to an exported binding, so the tool still reported "bindings applied" while the type stayed unchanged. The override now matches the exported declaration as well.--what-ifattached an assumption to the wrong variable when a line ended with a comment, and it reported a made-up reason when two declarations shared a line. Assumptions are now anchored by statement identity.- The LSP and the Vite plugin never applied
@nudo:mock, so a project that checked cleanly in the CLI reported a spurious "may throw" in the editor and in the build. Both now assemble the same injection channel the CLI uses.
- The cache key did not contain the effective fork budget, so changing
-
02aa122: fix(core,service): 侧车契约与 zod 产物不再把
-0渲染成0(族 20 · 片 D · Bug 1065)-0与0身份不同(Object.is/1/x可观察),而String(-0) === "0"⇒ 负号被抹掉 ⇒ 同一个值在三处被渲染成另一条契约。- core(
packages/core/src/algebra/interface.ts):litToString的 number 分支改用仓库既有的保真口径litKeyString(./term.ts:Object.is(v, -0) ⇒ "-0", 与format.ts的formatLitValue同款判据);lengthBound的常数界渲染 (.length(n))同款口径一并改。⇒ 侧车写的lit(-0)现在如实渲染成lit(-0):nudo contract回显、nudo check诊断的expected:/suggestion:、 以及侧车 DSL 回写(nudo contract --emit)都不再抹掉负号。 ⇒ 零新增公开导出(litKeyString是同包相对 import,core 冻结面未动)。 - service(
packages/service/src/emit/schema-generator.ts):case "lit"的 数字分支保真写z.literal(-0)(改前是z.literal(0))⇒ 产物不再 比门禁宽(门禁按lit(-0)判红、产物却放行0⇒ 假绿)。 ⚠ zod 的 literal 走===口径 ⇒-0与0在运行时不可区分 ⇒ 该处 已知有损 ⇒ 产物就地加注释标明(消费方看得见),不许静默放宽。 (zod 的运行时行为本次未独立复现——环境无 zod 依赖。)
诊断文本与 zod 产物是同一个渲染上游(
formatConstraint⇒litToString) ⇒ 一处修,两面同时保真。 - core(
-
f47fd50: Numeric literals that overflow to infinity are no longer folded to
null.Babel parses
1e400as aNumericLiteralwhose value isInfinity(the raw text stays "1e400"). The transpiler rendered the literal back to source withJSON.stringify(expr.value), andJSON.stringify(Infinity)returns the four-character string"null"— JSON has no representation for infinity. That text was pasted into the generated code, so1e400became$lit(null), the JSnullliteral rather than the string "null".return 1e400foldednullinstead ofInfinity,-1e400folded-0instead of-Infinity,Number(1e400)folded0andString(1e400)folded"null". Non-finite numbers are now emitted the same way the intrinsics are (1/0/-1/0, which do not depend on any identifier), and-0keeps its sign. -
5c750f2:
Object.definePropertynow validates the descriptor, and the reflection helpers behave like the spec instead of guessing.Object.definePropertyrunsValidateAndApplyPropertyDescriptor. Redefining a non-configurable or non-writable property used to succeed silently and rewrite the value; it now throws aTypeError, and a new key on a non-extensible target is rejected instead of accepted.Object.defineProperties(o, 42)no longer throws. The second argument goes throughToObject, so a primitive becomes a wrapper with no own properties and nothing is defined.Object.create(o, undefined)no longer throws. Passingundefinedexplicitly skips the whole step, exactly like omitting it.Reflect.defineProperty(proxy, …)returnsfalsewhen the trap refuses, instead of throwing aTypeError.Reflect.getnow runs getters, so an object literal with a getter returns the getter's value rather thanundefined.Reflect.sethonors its fourth argument (the receiver) and uses[[Set]]semantics on a proxy, so a trap that returnsfalseyieldsfalserather than a thrownTypeError.Reflect.set(array, "length", 3)now actually changes the length.Object.keys/values/entriesno longer claim an exact empty tuple for an object with an open key set (the shape produced byObject.groupBy); they report astring[]domain instead of a confidently wrong[].
-
d2cf3cf: An optional catch binding (
catch { … }) no longer introduces a binding.The optional catch binding of ES2019 binds nothing, but the transpiler fell back to the hard-coded name
"e"for the carrier. That binding then- shadowed an outer binding of the same name, so
catch { return e }returned the caught exception instead of the outer value ("outer"became anError); - swallowed the
ReferenceErrorof an undeclared name, so the signature claimed the function never throws; - collided with the user's own
let e, which is a duplicate declaration in the same block: the module then failed to transpile and degraded tounknown, while the diagnostic blamed the user's code.
An optional catch binding no longer emits a user-visible binding, so the catch body resolves outer names as it normally would.
- shadowed an outer binding of the same name, so
-
27cc16a: Directive parsing no longer loses or over-applies directives: malformed mock tags are reported instead of evaporating, file-level directives only apply where they are written, and a case expectation is no longer voided by a trailing comment.
- A file-level
/// @nudo:mock-module "fs" from "./mock-fs.js"was caught by the function-level@nudo:mocktag pattern, so a correct file produced a fabricatednudo:directive-syntaxwarning ("Malformed @nudo:mock …"). The mock tag now requires a name boundary that excludes the-suffix of the file-level family. @nudo:mockwith an empty payload (@nudo:mock fetch =,@nudo:mock g from) matched neither strict grammar, so the directive evaporated silently — no mock, no diagnostic, and the analysis ran against the real API. The three mock grammars are now closed: a tag that matches the lenient pattern but neither strict one is reported throughnudo:directive-syntax.@nudo:skip=> number()(no space between the tag and the payload) dropped the whole payload, so the declared return type never took effect and the signature degraded fromf() => numbertof() => any— ananyleak into the product surface. The separating whitespace is no longer part of the required structure.@nudo:mockfetch = …(no space between the tag and the name) did not even match the lenient tag pattern, so the whole mock was invisible to the scanner: zero diagnostics and the analysis ran against the real implementation. The lenient pattern now sees the glued spelling and reports that a space is required.- A
@nudo:caseexpectation with a trailing comment (=> string() // the result is a number) failed to parse and fell back to an explicitunknown, which satisfies every expectation — the assertion was silently voided and the command reported "1 passed" with exit code0. The trailing comment is now stripped before the expectation is parsed. - A malformed
@nudo:casedid not register an argument-region mask, so@nudo:mock/@nudo:skipwritten inside its arguments leaked out as real directives (false positives, methods dropped from the emitted declaration). Malformed cases now mask their argument region as well; the malformed-name diagnostic is unchanged. - A file-level
@nudo:env/@nudo:mock-modulewritten inside a function body was promoted to whole-file scope: the environment or the module replacement applied to the entire file, with zero diagnostics. File-level directives are now position-gated — a line comment inside a function body is ignored and reported throughnudo:directive-syntax, while top-level positions (file header,exportline, between statements) keep working. The same gate is applied to the text-level extraction used by@nudo:import, so the three file-level families now behave alike.
- A file-level
-
27cc16a: The directive grammar now has a single enforcement face: the case-argument grammar of the check product, the case emitter, the function census and the diagnostic positions are aligned with the parser.
- The check product parses a case witness with its own literal grammar (a
decimal regular expression, and a string sliced off its first and last
character). A witness written as
1e3or"a\tb"therefore did not denote the value the user wrote, and the contract gate reportedwitness ⊭ contractfor a witness that was in fact correct — while the same file, read by the parser, held a different value. The check product now uses the same literal grammar as the parser: JavaScript number semantics (exponent, hex, binary, octal, separators) and JavaScript string semantics (escapes), and a text that is not a single literal is no longer folded into a confident wrong value. - The case emitter wrote a string value into the directive text verbatim, so a
value containing a backslash or the quote character produced a directive
that no longer re-parsed to the same value —
nudo test --freezewrote out a case that failed on the next run. The emitter now escapes what the grammar requires. Non-finite numbers (NaN,Infinity) and bigint literals were dropped from the emitted case entirely (the whole case was abandoned); they are now expressible. - A static class method was visible in the signature surface of
nudo checkbut invisible in the function census ofnudo test/nudo health/nudo contract, because the census only collected instance methods. The census now collects static methods as well, matching the check product. - A directive diagnostic carried no position, so every occurrence of the same problem was reported at the same place and the product surfaces could not point at the offending directive. Diagnostics now carry the position of the offending directive.
- The union splitter of the what-if surface did not treat a backslash as an
escape inside a string, so a type expression containing
\"was split in the wrong place.
- The check product parses a case witness with its own literal grammar (a
decimal regular expression, and a string sliced off its first and last
character). A witness written as
-
fbca6fb: fix: 后置条件证明通道的 Φ 侧接线(返回点路径前提)+ 消除 Φ 的假红
上一片(族 65 收口)把「证据面 = Φ ∧ ret.pred」的 Φ 侧同项判定补上后, 留下两件待决:Φ 侧从未接入生产(
phi参数恒为pTrue),且按其文档 语义接线不健全——Φ 中的界原子可能约束的是另一个项 (if (x > 0) return y),蕴含失败会被判disproved(error),而真实结论 应是「证不出」。本片把两件都收口:
-
消除假红(前置):Φ 侧计入证据面的条件收紧为「同项 ∧ 蕴含该约束 的 pred」(
postcondition.ts的phiSuppliesConstraint)。实测口径:Φ 契约 改前 改后 y > 0(同项但不足以蕴含y > 10)number().gt(10)disproved(error,假红)unprovable(warning,正确)y > 20(同项且足够)number().gt(10)unprovableprovedx > 100(无关项)number().gt(10)unprovableunprovable⇒ Φ 只能把「证不出」升级成「已证明」,绝不制造「确定违约」;引擎自身 收窄(
ret.pred)侧的 fail-closed 口径(守卫弱于契约 ⇒ error)原样保留。 -
接进生产:Φ = 用户引理前提(
@nudo:assume的assumePhi.phi)⇒check.ts(主路径 + skip 分支)→ReturnContractAudit.phi/.phiPremises→check-return.ts→assertImplies(ret, constraint, { phi })。 项身份实测:形参有契约时入口 Abs 由constraintToEntryAbs生成、term = 真实形参名 ⇒ 与前提项同项 ✓;形参无契约时返回项锚在 α 名 ⇒ 对不上 ⇒ Φ 侧不生效(保守少证,不假红)。 -
归因不得静默:证明真的依赖路径前提时(去掉 Φ 就证不出),命中的前提 经
noteAssumeConsumed记进引理账本 ⇒nudo:assume-relied(info)可见—— 用户公理不会被静默消费。skip 分支补齐assumeDisplay,堵住「Φ 被消费却无 归因」的洞。 -
@nudo:invariant未接:它是循环携带界(join / 宽化位强制),循环退出后 的绑定值不必满足它 ⇒ 作为返回点 Φ 不健全。
验证:全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1757 文件 / 14531 用例全绿(exit 0);check-gold(recall=precision=1.0)绿;新增core-bug-1094-postcondition-phi-wiring.test.ts(15 条,含「Φ 永不新增disproved」的性质不变式);既有core-bug-1080的一条断言随假红消除同步 更新(fail-closed 语义改由ret.pred侧承载,Φ 侧单列「证不出」)。已知边界:当前
@nudo:assume文法只允许「名 <= 名」,而蕴含判定的区间 上下文只提取数值界 ⇒ 前提推不出字面界契约 ⇒ Φ 接线虽已生效(生产路径 确实把 Φ 交到证明通道),但暂不翻转任何判据。要让 Φ 真正生效,需要其一: ①@nudo:assume文法支持字面界(如d <= 10);② 把形参契约事实并入返回点 Φ(属可靠性政策决策,与 Bug 346「契约面不得当成事实」的既有口径相关)。 两者都是独立于「接线」的特性,本片未擅自扩展。 -
-
535adcd: fix(core):
then/catch/finally回调返回值的 thenable 采纳 —— 结果 promise 的值域不再是 thenable 对象本身(族 50 · Bug 1052 邻面)原生(ES2023
PerformPromiseThen+PromiseResolve+PromiseResolveThenableJob): 回调的返回值也要走PromiseResolve⇒ 返回值是对象且Get(then)可调用 ⇒ 调then(resolveFn, rejectFn)⇒ 结果 promise 的兑现值 = 该 settle 值 (不是 thenable 对象本身)。await Promise.resolve(1).then(() => ({ then: (r) => r(5) }))⇒ 原生5。引擎此前只认
eff(promise)(unwrapThenable只做「promise ⇒ inner」的单层解包) ⇒ 回调返回带then成员的普通对象时原样穿过 ⇒ 结果 promise 的值域 = thenable 对象本身(promise<{ then: (r) => ? }>)⇒ 与宿主的5互斥 (wrong-exact)⇒ 该值域一路进 dts / zod / guard / standard 产物面。根因:族 38(Bug 1052 本体)已建立唯一的 thenable 采纳机制 (
thenableAdoption/adoptThenableChain),但只接在Promise.resolve/new Promise/await三条通道上 ⇒ 回调返回值这条通道漏接。修法(
packages/core/src/algebra/builtins/promise.ts):复用族 38 的adoptThenableChain(不另造一套——采纳机制唯一),在 then / catch / finally 的回调返回值记账点按Promise.resolve面同款映射:settled+resolved ⇒ 兑现值;settled+rejected ⇒ 拒绝通道(reason);pending(then调过没 settle)⇒ 永挂(unsettled,不猜);undecidable(采纳面不可判)⇒ 原值 + 永挂;noThen/thenNotCallable⇒ 普通值 (原生Get(then)不可调用 ⇒ 以该值兑现,不抛 TypeError)。修后:
Promise.resolve(1).then(() => ({ then: (r) => r(5) }))⇒promise<5>(原生同);Promise.reject("x").catch(() => ({ then: (r) => r(5) }))⇒promise<5>;Promise.resolve(1).finally(() => ({ then: (r) => r(5) }))⇒promise<1>——原生finally不改 settled value(thenable 只作「等待」用,兑现值丢弃);- 回调返回的 thenable 调
reject⇒ 结果被拒、reason 落 rejected 通道 (finally臂的 reason 替换原 reason——原生同款); - 回调返回的 thenable 没 settle ⇒ 结果 promise 永挂(标 unsettled,不猜);
- 兑现值仍是 thenable ⇒ 递归采纳一层(原生同款,深度上限 8 与族 38 一致);
- 非 thenable 对照逐字不变:
then(() => 7)⇒promise<7>;then(() => ({ a: 1 }))⇒promise<{ a: 1 }>;then不是函数 ⇒promise<{ then: 1 }>(确定 fulfilled)。
口径边界(已登记):宿主在微任务里调
then,引擎在求值点抽象地调 (await面 /Promise.resolve面同款近似)⇒ 兑现值同款,但then体副作用的 时序与原生不同。采纳面不可判(any/unknown/fn/开对象/可选then槽)⇒ 仍标 unsettled(settle 不可判,不猜)——与Promise.resolve面同款。未改的记账点(诚实登记):纯 relation 回调(
fnImpl.relation且无 body/apply)的返回值是类型层的值(非运行时对象)⇒ 无 thenable 采纳面 ⇒ 该路径保持原样,未接采纳。 -
5c750f2: Promises keep their rejection channel, and the static methods respect their
thisbinding.- A throwing executor now rejects the promise. The rejection used to be
swallowed, which turned
catchinto dead code and reported a confident wrong value. Promise.all/race/anykeep the rejection channel instead of dropping it, andrace/anyno longer settle with the element promise itself.Promise.allSettledprojects each entry correctly:valueholds the resolved value,reasonholds the rejection reason, andstatusdistinguishes fulfilled from rejected.- A non-callable
then/catchhandler passes the value through unchanged, as in the language, instead of rejecting the promise. Promise.resolve/reject/all/race/any/allSettledare ordinary functions that receivethis.Promise.resolve.call(null, 1)now throws aTypeError(it used to return a value and report no throw), whilePromise.resolve(1)andPromise.resolve.call(Promise, 1)keep working.
- A throwing executor now rejects the promise. The rejection used to be
swallowed, which turned
-
535adcd: fix(core):
Promise.resolve(thenable)/new Promise(resolve => resolve(thenable))走 thenable 采纳 —— promise 的值域不再是 thenable 对象本身(族 38 · Bug 1052)原生(ES2023
PromiseResolve/NewPromiseCapability+PromiseResolveThenableJob): 对非 promise 值,resolve(x)要取then = Get(resolution, "then"), 可调用则调then(resolveFn, rejectFn),由它决定兑现值 ⇒Promise.resolve({ then: (r) => r(1) })兑现1(number)。引擎此前只认
eff(promise)(unwrapThenable只做「promise ⇒ inner」的单层 解包),带then成员的普通对象原样穿过 ⇒ promise 的值域 = thenable 对象 本身(promise<{ then: (r) => ? }>)⇒ 与宿主的1互斥(wrong-exact) ⇒ 该值域一路进 dts / zod / guard / standard 产物面(消费方看到「一个带 then 的 对象」,而运行时兑现的是1)。根因:
thenableRiskOf能识别「这个值可能自带 then 采纳面」,但它的 唯一用途是给 promise 打unsettled标记 ⇒ 风险被识别了,采纳却没做。修法(
packages/core/src/algebra/builtins/promise.ts):- 新增 thenable 采纳机制
thenableAdoption/adoptThenableChain——把「风险面」 一分为二:noThen(确定无then)/thenNotCallable(有then但不可 调用 ⇒ 原生按普通值兑现)/undecidable(any/unknown/fn/开对象 ⇒ 采纳面 不可判 ⇒ 仍标 unsettled)/settled(兑现值 / 拒绝 reason)/pending(then调过但没 settle ⇒ 原生 promise 永挂); - 采纳入口统一走它:
Promise.resolve静态臂、new Promise执行器resolve采集臂、以及await面(exec/runtime/async.ts的adoptThenable复用同一套判定与调用,不另造——await 面的既有语义逐字保留)。
修后:
Promise.resolve({ then: (r) => r(1) })⇒promise<1>(原生同);new Promise((resolve) => resolve({ then: (r) => r(1) }))⇒promise<1>;- 兑现值仍是 thenable ⇒ 递归采纳一层(原生同款);
- 采纳的 settle 语义 = 原生 first-wins(
then同时调 res 与 rej ⇒ 只认第一 次;then在 settle 之后抛错 ⇒ 忽略); - thenable 的
then调reject⇒ 拒绝 reason 落 promise 的 rejected 通道 (await该 promise ⇒ 抛该 reason,catch 臂可达);then体抛错 ⇒ promise 被拒绝; - 负控:
Promise.resolve(1)⇒promise<1>;Promise.resolve({a: 1})⇒promise<{ a: 1 }>;then不是函数 ⇒ 不当作 thenable(原生Get(then)不可调用 ⇒ 以该值兑现)⇒promise<{ then: 1 }>(确定 fulfilled, 不再是 unsettled)。
口径边界(已登记):宿主在微任务里调
then,引擎在求值点抽象地调 (await面同款近似)⇒ 兑现值同款,但then体副作用的时序与原生不同。采纳面不可判(any/unknown/fn/开对象/可选
then槽)⇒ 仍标 unsettled(settle 不可判,不猜)。await面此前在then同时调 res 与 rej 时优先取拒绝 ⇒ 现按原生 first-wins(先 res ⇒ 兑现);该边界无既有断言覆盖(await面其余语义 逐字保留,含「then不可调用 ⇒ 抛 TypeError」的既有口径)。 - 新增 thenable 采纳机制
-
e3b8791: Proxy traps are now dispatched and the invariants of the proxy specification are checked.
- A proxy with a
gettrap was not checked for the invariant that a non-configurable and non-writable property of the target must be reported with the same value, so the trap could report a different value where JavaScript would raise aTypeError. - A proxy with an
ownKeystrap was not checked at all: a duplicate key, a key that is not a string or a symbol, a missing non-configurable key of the target, or an extra key on a non-extensible target were all accepted. The invariant checks are now performed, and the trap is dispatched fromReflect.ownKeys,Object.keysandObject.getOwnPropertyNames. Reflect.setraised aTypeErrorwhere the original returnsfalse, andReflect.deletePropertyreported success where the original raises aTypeErrorfor a non-configurable property of the target.Reflect.getandReflect.getOwnPropertyDescriptordid not dispatch the traps of the proxy at all.- A proxy was only marked as a fresh instance when one of its traps was used, so two proxies over the same target could not be told apart. The mark is now applied where the proxy is created.
- A proxy without a
gettrap fell back to reading the target, and the getter was called with the target as its receiver. The receiver is the proxy now, as the specification requires.
- A proxy with a
-
b6abab4: Proxy traps now receive the real
Symbolkey, not the engine's internal"@@X"string projection.- The engine stores symbol-keyed properties under an internal
"@@X"slot name.obj[Symbol.x]was transpiled into$get(obj, "@@x"), and the Proxyget/set/hastrap dispatch passed that internal name on as the trap's key argument. Handlers that dispatch on the key therefore all failed:typeof kwas"string"instead of"symbol",String(k)was"@@iterator"instead of"Symbol(Symbol.iterator)", andk === Symbol.iteratorwas alwaysfalse. Symbol.iterator in proxywas worse: thehastrap was never dispatched at all, because theinoperator bailed out early on symbol keys.- Symbol-projected keys are now restored to the real symbol at the trap
boundary. The
inoperator looks the key up by its host identity, so thehastrap fires and a symbol-keyed own property is reported correctly. - A user-written string literal
"@@iterator"stays a string key: it is a different property key fromSymbol.iteratorand is still handed to the trap as a string.
- The engine stores symbol-keyed properties under an internal
-
356172a: RegExp state calls evaluate their arguments once, and
deletedispatches the ProxydeletePropertytrap exactly once.re.test(x)/re.exec(x)/re.compile(x)inlined the very same argument source text into two runtime calls ($invoke, which performs the call, and$reStateCall, which reads backlastIndex). Every argument expression therefore ran twice — a counter incremented by the argument ended up at2instead of1. The arguments are now materialized into an array that both channels share. The same fix applies to the optional-chain receiver (re?.test(x),re.exec(x)?.[0]).delete o[k]was emitted twice: once as the expression value ($delRes) and once as the statement-level write-back (o = $del(o, k)). On a plain object the second call is idempotent, but on aProxyeach call dispatched thedeletePropertytrap, so the trap ran twice while the specification allows exactly one call. The trap is now dispatched only by the expression channel; the write-back channel merely probes whether a trap is present and leaves the target untouched.
-
e3b8791: The generated products and the named imports of a module now agree with each other.
- The schema product rendered the brand of a generator as
z.instanceof(GeneratorFunction), which made the generated module fail to load with aReferenceError. The brands that are not globals are downgraded toz.unknown()and the loss is recorded, so the product can always be loaded. - A named import of a function from an environment module wrapped the
declared function in a JavaScript arrow function, which dropped the
declared parameter and return types: the signature showed an invalid
placeholder and the generated declaration file disagreed with it. The
named import now yields the declared function itself, so both import
forms report the same type. The function is still callable: a call and a
newboth dispatch to it.
- The schema product rendered the brand of a generator as
-
a069994: fix(core):
@nudo:assume/@nudo:invariant求值不再复用 generalize 的进程内缓存 (种子求值绕过 L0)generalize的 L0(进程内函数签名 memo)键只装静态身份(源码指纹 / 依赖 / 预算等),不含@nudo:assume引理与@nudo:invariant循环界这两份动态种子 ⇒ 带种子的求值可能命中无种子缓存(或反之),造成两类用户可见错误:- 审计面蒸发(误导性假绿):同一文件第二次
nudo check、只改了无关兄弟函数、 或 IDE/LSP 先跑过一次无种子签名推导后,带引理的函数会命中缓存而跳过重新求值 ⇒ 引理消费账本没被填 ⇒nudo:assume-relied/nudo:invariant-relied不再上屏,用户以为引理没被用上(实际证明仍依赖它)。现在这些场景与冷跑一致: relied info 每次都在。 - 精度泄漏:种子求值折出的界(如
1 - d/max ≥ 0 ∧ ≤ 1)会被写进 L0 ⇒ 之后的无种子签名推导(nudo check签名面 / LSP hover)读到它, 在没有公理的上下文里显示只有引理才能证出的类型。现在无种子推导与冷跑逐字一致。
修复方式:种子非平凡(引理前提非
true或有循环界规格)时,目标函数入口的 generalize 既不读也不写 L0;其余路径的缓存行为不变(无@nudo:assume/@nudo:invariant的项目零变化)。 - 审计面蒸发(误导性假绿):同一文件第二次
-
369a42d: Short-circuit operators evaluate their left operand exactly once.
$forkonly guarantees that the test is evaluated once and that the arms run lazily — the test value is not handed back to the arms, so emitting the left operand's source into an arm evaluated it a second time. A getter, a call or a computed key therefore ran twice (four times for nested??), and an incrementing getter returned a different value on the second read, so the result and the surrounding state were wrong (o.x ?? 5folded2instead of1for a getter counting its own reads;a[i++] ?? "d"folded"undefined|2"instead of"x|1").An impure left operand (getter / call / computed key / increment) that is reused by an arm is now bound to a temporary first, and the test and the arms all refer to that binding. Pure left operands (identifier / literal /
this) keep their previous shape, since re-reading them is not observable. -
29d766d: fix(core):
String.prototype的 ES2017 别名trimLeft/trimRight方法值读不再折成undefined(族 41 · Bug 1055)宿主
String.prototype上真实存在两个 ES2017 别名trimLeft/trimRight(≡trimStart/trimEnd,原生同一内置)。引擎有两套字符串方法名集合:- 方法派发面(
packages/core/src/algebra/methods.ts)——case "trimLeft":/case "trimRight":⇒ 调用路径认识这两个别名; - 方法值读投影面(
packages/core/src/algebra/exec/member-diag.ts的STRING_METHODS白名单)—— 只列了trimStart/trimEnd,漏列这两个 别名 ⇒ 读路径把它们当成「原型上不存在的成员」。
⇒ 同一引擎两套集合自相矛盾:
s.trimLeft()正常返回string,但s.trimLeft读出 exactundefined(原生是function)⇒String.prototype.trimLeft走同一张表 ⇒ 同样落undefined⇒String.prototype.trimLeft.call(s)⇒ 「property 'call' on undefined」⇒ 硬TypeError⇒ L2 门禁假红 (nudo:entry-may-throw)。修法:
STRING_METHODS补"trimLeft"/"trimRight"两个表项(只加表项, 不动任何导出面)。修后:typeof s.trimLeft/typeof s.trimRight⇒function(原生同);String.prototype.trimLeft.call(s)/String.prototype.trimRight.call(s)⇒string,不再记TypeError(L2 假红消失);- 调用面
s.trimLeft()/s.trimRight()不变(≡trimStart/trimEnd); - 负控:表外名字(如
notARealMethod)仍折 exactundefined,仍记TypeError⇒ 没有把整张表改成全放行。
顺带把「表与宿主同名集同源」这条不变量钉住:新回归钉逐名对拍
Object.getOwnPropertyNames(String.prototype)(node v26.10.0 实测:自有方法 50 个 = 本表 50 个,无漏列 / 无多列),防止「派发面认识、读面不认识」的分裂 再次发生。 - 方法派发面(
-
7fea13a:
switchstatements and loop bodies now carry the facts that JavaScript guarantees at those points.- A
breakinside aswitcharm — including inside anifinside the arm — was emitted as areturn, which only ended the innermost thunk. The statements after it still ran. Abreakin an arm now ends the arm and theswitch, and abreakthat belongs to an enclosing loop still ends only that loop. - The test of a
casewas emitted like an ordinary argument, so every case test of theswitchran before theswitchwas entered, even after a case had already matched. The case tests are now evaluated in source order and stop at the matching one, and each test is evaluated exactly once. When the discriminant is abstract and no case can be selected, all case tests are still evaluated, so their side effects are not lost. - A side effect in a case test was rolled back by the snapshot the arm
restores, so
switch (1) { case t(1): n = n + 10; break; }ended withn = 10instead ofn = 11. The baseline is now refreshed after the case test, so the writes of the test survive while the arms stay isolated from each other. - The head of a
for (var … of …)orfor (var … in …)was lowered to a callback parameter. That shadowed the function-levelvarbinding, so reading it after the loop gaveundefined, and every iteration created a new binding, so a closure captured the wrong value. Thevarhead is now a function-level binding, shared by all iterations and still visible after the loop;letandconstheads keep their per-iteration binding. for (o.x of …)andfor (o.x in …)did not write the iteration value back to the member at all, soo.xkept its old value. The head target is now assigned on every iteration, like in JavaScript.- The body of a
for,whileordo-whileloop did not receive the facts of its own test. Afor (; x > 0; ) { return x; }was judged to violate a contract ofnumber().gt(0), andfor (; v !== null; ) { return v.length; }was reported as possibly throwing onnull, even though JavaScript never throws there. The loop body now receives the nullish and the relational facts of the test, in all three loop forms. The first iteration of ado-whilebody is not narrowed, because it runs before the test is evaluated. - A
breakorcontinuein the body of ado-whileescaped the whole function, because the body was executed once outside the loop. The body now always runs inside the loop, sobreakends the loop andcontinuegoes to the test. - A
caselabel did not produce any narrowing fact, so the arm did not know which value it matched and the other arms did not know which values were excluded.switch (x) { case 1: return x; default: return 2; }violated a contract ofnumber().gt(0), andswitch (v) { case null: return 0; default: return v.length; }was reported as possibly throwing onnull. The arms now know the matched value and the excluded values.
- A
-
56f308e: Two
switchdefects are fixed: adefaultthat follows an emptycaseno longer runs its body twice, and abreakinside a loop nested in aswitcharm breaks the loop again.-
In
case 1: default: bodythe default's statements are shared between the case arm (which falls through into them) and the default arm (which runs them when nothing matches). The fall-through merge appended them a second time, so the body ran twice in one arm —switchDefaultAfterEmptyCase()folded"dd"instead of"d"and side effects were doubled. -
The "inside a switch arm" marker was carried into nested loops, so an unlabelled
breakinside such a loop was lowered as "end of arm" instead of "end of loop": the loop ran to completion (f() => 3instead of1). Loop bodies no longer inherit the marker.
-
-
5c750f2: Symbol-keyed properties stay symbol-keyed, and prototypes no longer leak their
constructorinto enumeration.- A property defined with a symbol key is no longer reported as the
string
"@@X".for…in,Object.keys,Object.getOwnPropertyNamesandObject.getOwnPropertyDescriptorsonly list string keys, andReflect.ownKeysreturns the symbol itself (sotypeofis"symbol", as in the language). Object.assigncopies a symbol key as a symbol key instead of downgrading it to a string property."@@toStringTag" in objis nowfalse: the string"@@toStringTag"is not the same key asSymbol.toStringTag.Object.getOwnPropertyDescriptor(proxy, key)dispatches the proxy'sgetOwnPropertyDescriptortrap. It used to never run and always reported a broken descriptor.Object.freeze/Object.seal/Object.preventExtensionsrecord key-level flags, soObject.isFrozen/Object.isSealedreport the right answer, and a frozen property stays frozen.- A function's
constructorproperty is not enumerable any more:for (const k in A.prototype)is empty, as it is in the language. - A regular expression exposes its own
lastIndexproperty, andObject.getOwnPropertyNames(/x/)lists it.
- A property defined with a symbol key is no longer reported as the
string
-
7fd7468: 族 45 修复 S11:Bug 1058 / Bug 1059 —— 引擎内部临时名与用户标识符避让。
同根因(Bug 181 的修复只装在了解构临时名族
_d{n}/_n{n}上 ⇒ 这里只装了一半): 引擎为转译生成的内部绑定一律用固定名发射(arguments槽__nudoArgs/ try 标记__nudoTm_{n}/ catch 载体__nudoE_{n}/ try 内 return 载体__nudoRet/ 写回载体__mutRet/ 函数体 catch 载体__nudoFnRet/ 宿主 rest 形参__margs/__allArgs/ 匿名默认导出合成名__nudoDefaultFn__nudoDefaultClass)⇒ 用户源码里写了同名标识符时两种失效形态都成立:- 同作用域重复词法声明(Bug 1058)⇒ 转译产物不是合法 JS ⇒
new Function编译期SyntaxError⇒ 求值器 fail-closed ⇒ 整模块导出退化为unknown+ 假nudo:opaque-result(「path not covered, or native」—— 误导诊断)⇒ 门禁 exit 0 假绿;连无关的导出也一并失去签名。 - 内层遮蔽用户同名外层绑定(Bug 1059)⇒ 引擎的
const __nudoRet = <用户 表达式>在自己的初始化器里读__nudoRet⇒ TDZReferenceError⇒ 被 用户自己的catch吞掉 ⇒ 原生15被算成0(wrong-exact)⇒ 签名面写成=> 0⇒ 门禁假绿。
修法(
transpile/helpers.ts新增internalTmpName):生成内部名时用userIdentInfo(source).names(源文本里出现过的全部标识符词形,保守超集) 做避让——撞名则加_k后缀并跳过已占用名。避让在整个转译单元生效(不做 作用域分析:用户在内层作用域声明的名字同样会遮蔽外层生成的临时名)⇒ 生成名与 用户标识符词形永不相撞;无碰撞时原名返回 ⇒ 产物逐字不变;同一源文本 ⇒ 同一 名 ⇒ 产物确定性(缓存键 / 差分语料依赖它)。生成与使用成对改名 (声明 / 引用 / 词法槽绑定三处一致)。回归钉:
packages/core/src/algebra/__tests__/eval-bug-1058-1059-temp-name-collision.test.ts(1059 结果15而非0、签名面写15;1058 三族不退化unknown、无假nudo:opaque-result、无关导出仍拿到签名;负控:内部名逐字不变;确定性:两次 转译逐字相同)。 - 同作用域重复词法声明(Bug 1058)⇒ 转译产物不是合法 JS ⇒
-
ed4d259: fix(core): this 载体名
__this避让用户标识符(附录 A#4 · Bug 1160)Bug 1058/1059 约定「引擎内部临时名必须避开用户标识符」。附录 A#4 把
__this载体登记为「实测无害」并显式留到独立一波(1149 / 1151 的钉子断言了该字面 形态)——经逐点探针全部可达:__this是跨发射器协议(真函数 prologuelet __this = $rawThis(this)/ 宿主生成器 hoist 声明,与类/对象方法、构造器、 访问器 thunk、字段 / 静态块 /@@hasInstance安装 thunk 的首参声明),而这些 作用域里求值的是用户源码:- 真函数(声明 / 表达式 / 生成器):用户形参同名 ⇒
let __this与形参 重复声明 SyntaxError ⇒ 整模块 fail-closed;外层 / 块级同名 ⇒ 体内this读到用户绑定、用户读__this读到载体(自信错值)。 - 类 / 对象方法 + 构造器(含函数表达式属性):宿主签名是
(__this, <用户形参>)⇒ 用户形参同名 ⇒ 重复形参 SyntaxError;默认参数、 体内块级同名、super()接收者重绑(块级let __this劫持重绑)同款失效。 - 访问器 / 字段 / 静态块 thunk:thunk 首参
__this遮蔽外层用户绑定 (getter / setter / 实例字段 / 静态字段 / 静态块 / 具名类let C = __this绑定);静态块顶层let __this与 thunk 形参重复声明。 @@hasInstance安装 thunk(静态字段与字符串键静态方法两种形态): 值 / 方法体在 thunk 内求值 ⇒ 同款遮蔽。- 类名恰为
__this:静态块thisParam= 类名与 thunk 首参同名 ⇒ 重复声明 / 自遮蔽。
修法:单一来源
helpers.ts的thisCarrierOf(opts)——根转译单元 (transpileFile/transpileBodyNode)经internalTmpName("__this", opts)在入口分配一次并写入opts.thisSlot,全部声明方与thisParam读方经同一 函数取同名(避让口径 =userIdentInfoOf(opts)= 源文本词形 ∪opts.userIdents;撞名加_k后缀)——不造第二套命名机制。无碰撞时基名原样返回 ⇒ 产物逐字不变(9485 条差分语料 + 19 条手写 方法 / 访问器 / 箭头 / 类字段 / 静态块 / 对象方法 /
new.target/super语料,git archive HEAD旧发射器与新版对拍 0 diff);撞名改名是源文本局部 分配(确定性:同源 ⇒ 同名)⇒ 无缓存键 / ANALYSIS_ABI 变更。诊断语码与 门禁口径不变。 - 真函数(声明 / 表达式 / 生成器):用户形参同名 ⇒
-
ae69b28: Two
returnstatements in the same lexical block inside atryno longer break the whole module.A
returninside atryregion is emitted with a fixed temporary name (const __nudoRet = …). Two such returns in the same block were a duplicateconstdeclaration, which fails at compile time withSyntaxError: Identifier '__nudoRet' has already been declared— the whole module then fails closed, so every function in the file degraded tounknown/neverandnudo checklost the signatures of unrelated functions. Merely having the two returns in the source was enough; the dead code never had to run.Each return now takes its temporary in a block of its own, so the bindings no longer collide. The
returnstays inside that block, which does not change the function-exit semantics. -
5c750f2: Typed array construction and
setnow reject what the language rejects.new Uint8Array(buffer)checks that the remaining bytes are a whole number of elements. A buffer whose length is not a multiple of the element size now throws aRangeErrorinstead of being silently truncated to a shorter array.%TypedArray%.prototype.setchecks that source and target hold the same kind of element. Copying anInt8Arrayinto aUint8Arrayis rejected with aTypeError; copying between two arrays of the same element type keeps working.%TypedArray%.prototype.setconverts every element withToNumber(orToBigIntfor bigint arrays) and reports the failure. A source holding a value that cannot be converted now throws aTypeError(or aSyntaxErrorfor a non-numeric string) instead of being accepted silently.
1.15.2
Patch Changes
- 4513a45: Fix a 5.5x yargs regression from the Bug 116 strict seam: guard shadow
rebinding emitted the guarded identifier as an arrow parameter
(
((arguments) => THUNK)(…)forif (arguments.length === 0)style discriminant/nullish/typeof/rel guards), andarguments/evalare illegal binding names in strict code — the whole module body then died atnew Functioncompile time with "Unexpected eval or arguments in strict mode", fail-closed to empty exports, and since failed evals are never memoized every analysis re-transpiled the file (yargs check 5952ms → 1161ms after the fix). Guard names that cannot be bound in strict mode now skip the narrowing wrapper entirely (same all-or-nothing skip as fork-binding collisions — narrowing is a precision gain, not a semantic obligation). The"use strict"prefix itself is now scoped to sources with ESM syntax (sourceHasEsmSyntax: staticimport/ anyexportstatement ⇒ definitely ESM); sources without it follow Node's.js-without-type:"module"default and stay CommonJS/sloppy, so sloppy-legal constructs (implicit global writes,argumentsbindings) no longer miscompile in CJS files. Docs: the levenshtein@nudo:invariantexample splits its L2 expectation (--ignore-throws RangeError, mirroring the engine test suite) for the legitimateArray.fromarray-like-length may-throw.
1.15.1
Patch Changes
- 76dee40: Category-decision & Proxy-model cluster (root-cause class C7) from the
differential bug report:
Object.prototype.toStringtags abstract bigint prims as"[object BigInt]"via an explicit prim-tag map, and bigint.toStringroutes throughBigInt.prototype.toStringwith literal-radix domain checks (Bug 105); abstract bigint prims are recognized by arithmetic/bitwise coercion — mixedbigint ⊗ numberfolds the native TypeError (or records may-throw for abstract sides) instead of the impossiblenumber | string, andb / 0n/b % 0n/b ** -1nthrow RangeError (Bug 106); borrowed builtin-prototype methods brand-check the receiver (Number.prototype.valueOf.call("5")throws instead of folding"5"), withObject.prototype/Array.prototypestaying generic and Array mutators on primitives now throwing (Bug 108);new <proxy>routes to the proxy's target [[Construct]] (orconstructtrap with result validation) instead of re-entering theProxyconstructor (Bug 122);typeof/instanceofon a proxy see through to the target (typeof new Proxy(fn, {})folds"function",p instanceof Functionfolds true) (Bug 123); the object-level proxy trapsdeleteProperty/defineProperty/setPrototypeOf/preventExtensions/getPrototypeOfare dispatched with strict/Reflect throw-vs-boolean semantics (falsy trap results throw in Object paths) (Bug 124). - 3f3b080: Follow-up to the member-surface and throws-domain clusters: the fn face
of
Function.prototype(hostfn.prototypemember read, Bug 92) and the proto projection used byObject.getPrototypeOf(protoBrandAbs) were two distinct Abs values for the same native object, soObject.getPrototypeOf(g) === Function.prototypefolded wrong-exactfalse.functionProtoAbs()is now the single resident value used by both the fn-shape and base-class-value arms ofprotoOfRecvand the host-function.prototyperead (Bug 58/85 suite restored; nativeextends nullclass values still resolve toFunction.prototype).@nudo:invariantlevenshtein main-target case now splits its L2 expectation (ignoreThrows: ["RangeError"]) for the legitimateArray.fromarray-like-length may-throw added with Bug 129, and the #136 regex-capture signatures are re-pinned to their sound domains — the zero-iteration arm ofwhile ((m = re.exec(s))) … return nullnow joins (Bug 99), soparts/named/orAltkeep their nativenullarm instead of the previously pinned unsound exact. - a3a5dee: Host-record prototype-chain pollution cluster (root-cause class C6) from the
differential bug report: class-spec records (
methods/staticMethods/statics/…) are registered as null-prototype objects and every dispatch site reads them with own-property semantics, soObject.prototypenames (toString,hasOwnProperty,constructor,__proto__, …) are no longer misread as class members —c.toString()stops folding"[object Undefined]",c.hasOwnProperty(k)/c.valueOf()stop throwing phantom host TypeErrors, andc.constructor === Cfolds true (Bug 90).DataView.prototypedispatch consultsDATAVIEW_ACCESS_BITSwithObject.hasOwn, so unmodeled methods (toString,valueOf,hasOwnProperty, …) no longer fold thenumberdomain or phantom RangeErrors (Bug 91).D.hasOwnProperty("m")recognizes own static methods/accessors as non-enumerable own class-value properties (own-only — ancestor statics answer false). - 3338ae5: Computed-key member calls keep their receiver:
obj[key]()where the key is a non-literal expression (a variable,Symbol.iterator, any runtime value) used to fall through transpile to$call($idx(obj, key), …), which has no receiver channel — the method body'sthisread failed and builtin brand checks assumed a throw, folding exactnever(native: the real result). New$invokeKey/$optionalInvokeKeyruntime helpers fold the key (ToPropertyKey literal + well-known symbol →@@nameslot) and re-enter the full$invokedispatch with the receiver bound; optional chains (obj?.[key](),obj[key]?.(), mid-chain hops) route through a newinvokeKeychain hop instead of the receiver-lesscallhop. Bonus precision: static"ab"[Symbol.iterator]().next().valuefolds"a"(iterator face reuses thevaluessingle source of truth), and generatorit[Symbol.iterator]() === itfoldstrue. - 471ddb3: Loop-return join soundness (root-cause class C9) from the differential bug
report: a
returninside awhile/forbody with an abstract test no longer drops the zero-iteration path — the body's return value is collected as one arm and the post-loop statements as the sibling arm (whileGuard(x)withanyfoldsany | 0instead of the unsound exact0);NudoThrowstill propagates and definite-true loops keep bubbling (Bug 99). Generator/async thunk bodies are the target boundary of$loopReturn— absorbed arms merge into the generator terminal value domain / the promise inner domain (async f(x){ while(x<0) return 5; return 9; }foldspromise<5 | 9>with no phantom number arm), which also fixes the pre-existing fork/switch-in-generator phantom-arm family. Bug 1 (guarded plain-variable return contracts) was already fixed by a prior commit (verified against the report's repro matrix). - 2ab2f46:
JSON.stringifyrenders regex match results as arrays: aString.prototype.match/RegExp.prototype.execresult is a native Array (only index elements enumerate into JSON), but the engine modeled it as a plain object shape whoselength/index/inputslots all serialized —JSON.stringify("abc".match(/b/))folded{"0":"b","length":1,"index":1,"input":"abc"}instead of["b"]. Match/exec/matchAll-element results now register an array view (matchArrayViews) that the three JSON consumers honor by serializing the 0..n-1 slots as an array, with thelengthslot explicitly non-enumerable (the only non-enumerable own prop on the native result);Object.keys({...m})enumeration matches native. MatchAll elements are remodeled asmatchResultAbsitself, so[...ms][0].index/.inputfold exactly. The#136member-read surface (m[0],m.length,m.index,m.input, named groups) is unchanged. - babee2b: Member-surface wrong-exactness cluster (root-cause class C2) from the
differential bug report: non-constructible namespaces (
Math/JSON/Reflect/Intl) no longer fabricate a.prototypebrand — the read folds exactundefinedandFunction.prototypetypes as"function"(Bug 92); generator functions keep a distinguishable.prototypeobject (declaration- expression forms) while async/arrow controls stay
undefined(Bug 93); string-form TypedArray indexes (v["1"]) fold the element domain instead of exactundefined(Bug 102); writes to getter-only builtin accessors (v.length = 5) throw the strictTypeError(Bug 103);new <function declaration>()instances resolvef.prototypemembers and"k" in new f()walks the registered chain (Bug 113); every well-known symbol class member (Symbol.iterator/Symbol.species/…) survives definition via the"@@X"projection and builtin constructors expose@@species(Bug 114). Residual:Object.prototypelegacy accessors (__defineGetter__family) now answerinexact true (Bug 15 family). Bug 6/10/14/15/16/17 were already fixed at HEAD (verified, no change).
- expression forms) while async/arrow controls stay
- 4c6666b: Mutation/state/write-back cluster (root-cause class C3) from the differential
bug report: statement-position write-back now covers member targets
(
Object.defineProperty(o.p, …),C.prototype) and optional-chaindelete o?.a(Bug 87/111);String.prototype.match/matchAllhonor the pattern brand's trackedlastIndexwith the specmatchAllflag rewrite (Bug 94); argument-position globalmatch/replace/replaceAllreset the regex binding'slastIndex(Bug 96);RegExp.prototype.compilerecompiles the receiver — source/flags/flag getters/lastIndex fold fresh values and invalid patterns throwSyntaxError(Bug 126);String.prototype.replace/ replaceAlldispatch through a@@replaceslot installed on the pattern (Bug 81); accessor→data descriptor redefinition drops the stale getter and merges flags (Bug 84);Object.defineProperty/definePropertieson tuple/array receivers install/truncate/extend indexes and length instead of silently dropping (Bug 86); descriptor keys coerce viaToPropertyKey— symbol/boolean/null/undefined keys install (well-known symbols behind the@@Xprojection) (Bug 117); non-primitive descriptorvalues (fn/obj/ tuple/bigint/symbol) keep their Abs instead of foldingundefined(Bug 118);Object.assignuses[[Set]]semantics — the__proto__accessor fires and inherited non-writable data properties throw (theproto-slot-keyassign pin is re-anchored to native) (Bug 128); Set/Map deduplicate non-literal keys by reference identity with exact size/get/has/delete folding and soundness guards (Bug 88);new RegExp(undefined)folds the empty pattern(?:)(Bug 95). - 1fed4a4: Placeholder-callable cluster (root-cause class C5) from the differential
bug report: the generator
@@iteratorslot is now a self-returning method (it[Symbol.iterator]() === itfolds true; re-entering through the slot —.next()/ spread — no longer proves a phantom TypeError) (Bug 83); user-class instance/static method first-class values carry anapplyhook that re-enters ordinary dispatch with the caller-supplied receiver, so borrowedm.call(c)/m.apply(c, [])/m.bind(c)()and HOF-passed method values fold the real result instead of exactundefined(Bug 89). Bug 12 (WeakMap/WeakSet method calls) was already fixed by a prior wave (verified, no change). - 70631ed: Protocol single-source cluster (root-cause class C8) from the differential
bug report: array destructuring of
Set/Mapconsumes the same element side tables as spread/for..of/Array.from([a, b] = new Set([1,2])binds real elements;Mapdestructuring yields[k, v]tuples) instead of foldingundefinedand false TypeErrors (Bug 82);for..inre-checks key presence per iteration over the live binding, so keys deleted before being visited are skipped (Bug 98); TypedArray HOF callbacks run once per element for known lengths (≤1024 unroll cap), making side-effect counts exact (Bug 100);Array.fromconsults the object's@@iteratorbefore the array-like half — a non-callable iterator throws, a callable/abstract one yields the iterator path instead of an exact empty array (Bug 110). - 367ef5a: Throws-domain cluster (root-cause class C1) from the differential bug
report:
Object.setPrototypeOfon frozen/sealed/non-extensible targets throwsTypeError(sharedprotoChangeAllowedwithReflect) (Bug 120);Object.keys/values/entries/getOwnPropertyNames,for..in,Object.assignand object spread project TypedArray index keys"0".."n-1"from the length slot instead of folding an exact empty view (Bug 125 + residual);Object.freeze/sealon a non-empty TypedArray throws / records may-throw (Bug 129);String.rawmisuse throws / recordsTypeError(Bug 97);new <TA>(buffer, byteOffset, byteLength)validates bounds and alignment (Bug 101);Array.from({length: 2**32})hits theRangeErrorceiling (Bug 104); literal digits/radix domain checks hoist above the receiver guard (Math.random().toFixed(500)throws) andtoLocaleStringno longer passes args to the redirected hosttoString(Bug 107); spread/rest copy enumerable own properties only (Bug 109); private-name access on a closed plain object throws (Bug 115); module bodies run strict —new Functionseam prefixed with"use strict"andarguments.calleeread/write/delete throw (Bug 116); TypedArray construction and.fromconvert items (bigint/symbol mismatches throw) (Bug 131). Bugs 5/7/11 were already fixed at HEAD (verified, no change). - 8dd2b50: Transpiler special-case cluster (root-cause class C4) from the differential
bug report:
this.#x++/#x--/#x ||= von private fields transpile instead of raisingnudo:unsupportedand fail-closing the whole module (Bug 80); function-declaration bindings passed toObject.*/Reflect.*/in/JSON.stringify/coercing globals are normalized to Abs at the$invokeargument choke point, soObject.keys(declaredFn)no longer crashes the builtin dispatch with an internal TypeError (Bug 85); computed accessor keys in object literals are evaluated exactly once (Bug 112);super.xin a static field initializer resolves through the parent constructor's statics instead of the instance prototype chain (Bug 119). - 725c8e4:
Reflect.constructargument-slot fix (root-cause class C10): the sharedenforceArgsListcall indexedargs[2]for bothapplyandconstruct, so the valid two-argumentReflect.construct(A, [])was analyzed as an unconditional TypeError while genuinely invalid forms (non-object argsList, non-constructor newTarget) passed silently. argsList is now validated atargs[1]forconstruct, and a presentnewTargetis checked for constructability (Bug 121).
1.15.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- aae0f96: Fix stale-cache windows in cache keys and session eviction.
nodeHarvestCacheKeyflooredmtimeMsto whole seconds (same-second, same-size rewrites of@types/nodereused a stale harvest — now uses the raw float mtime, matching the repo-widemtimeMs+sizestrict-equality contract). The path-env cache key/validation only comparedmtimeMs(coarse-mtime filesystems could keep serving a staledefineEnvfactory and re-register it, self-perpetuating — nowmtimeMs+size, and the direct-import URL query carriessizeso the ESM module cache can't replay old content). The path-env fallback copy filename hashed onlypath:mtime— rewritten content now hashes into the filename so a changed file gets a new URL and the ESM cache invalidates naturally. Harvest caches (harvestCache, node not-found cache) had no production eviction —clearAnalysisSessionCaches()now clears both, sopnpm install/ watcher rounds see upgraded or newly installed@typeswithout a process restart.checkMemoKeynow normalizesfilePathviastablePathKey(same file no longer occupies two entries under different path shapes). - 1ccff57: Fix unsound strict numeric endpoints under IEEE rounding. Strict bounds
(
gt/lt) synthesized by endpoint arithmetic (add/sub/mul/div, linear interval propagation) could round inward past the true infimum/supremum and produce false proofs — e.g.x >= 1 && y > 1e-16provedx + y > 1whilef(1, 1.05e-16)returns exactly1in IEEE arithmetic. Strict endpoints are now calibrated with a float-discreteness witness (x > a ⟺ x ≥ nextUp(a)): when the witness result collides with the endpoint, the bound steps one ulp outward (gt(nextDown(E)) ⟺ ge(E)), sox > 0 ⟹ x + 1 > 1now correctly reports> 0.9999999999999999. Non-strict bounds are unaffected (fl monotonicity). Also:gt(x, NaN)(a vacuously-false predicate from0/0literals) is no longer collected as a numeric bound endpoint, matching the existing NaN exclusion semantics. Contracts that relied on the old false strict bounds (e.g. theinterface-derivationexample'sx>0 ⟹ x+4>4) now correctly fail — the example and docs were updated to sound forms (ge(0) ⟹ ge(4)).
1.14.1
Patch Changes
-
c19bd48: Host-global function collection no longer leaks Node lazy-getter warnings, and check hints point at the env directive (fix-12 batch).
hostGlobalFnIdsskips accessor properties by descriptor shape (deny-by-default) instead of a name denylist — bare-node embedding consumers no longer emitExperimentalWarning/DeprecationWarningfor localStorage, punycode (DEP0040), sys (DEP0025), wasi/ffi; only the empirically warning-free, function-valued accessors (Buffer,assert,events,stream,node:test) are read. Future warning-emitting lazy getters are skipped automatically (fail-closed); parity probe on node 26 confirms an identical 122-function collection set.- Opaque-result diagnostics now suggest
/// @nudo:envwhen the file imports builtin modules with no env active.
1.14.0
Minor Changes
-
0d9e7de: Pure-expression equality folding and the
@nudo:invariantloop lemma close #175/#176 —const d = a === b ? 0 : Math.max(a.length, b.length); const max = Math.max(a.length, b.length); return max - dnow provesge(0)with no directive, and levenshtein-style DP loops gain a user-declared invariant channel.subfoldsx − xto exact0(NaN arm preserved) when both operands carry structurally equal terms that passisDeterministicTerm—len#Nidentity-minted leaves plus a deterministic host whitelist (Math.max/min/…, arithmetic). Adoption re-anchors,getmember reads andarg${i}placeholders are rejected, so structurally-equal-but-distinct values never foldsubnow consumes@nudo:assumepremises (symmetric todivAssumeBounds):@nudo:assume d <= maxprovesmax - d ≥ 0— the subtraction formulation of the similarity lemma previously had no working channel- Domain-shared values (arr element handed to two index reads, for-of single representative, callback element args) are marked at hand-out (
len-sharing.ts):abstractLenmints a freshlen#Nper read and the reflexivity fold rejects marked operands —xs[0].length - xs[1].lengthno longer falsely folds to0 @nudo:invariant <name><path> <rel> <number>(dp[*][*] >= 0, scalarlast >= 1): loop analogue of@nudo:assume— parsed in core, seeded per target entry, enforced at loop join/widen on the named binding (element domains / object slots drilled by[*]/.ident), cleared at call boundaries, audited vianudo:invariant-reliedinfo (+nudo:invariant-invalidfor bad syntax). Unguardeddp[m][n]keeps its honestnumber | undefinedOOB read faceArray.from({length}, mapFn)hands the callback a bounded index (ge(0), pluslt(length)when the length term is available); the same bounds now apply to abstract-receiver.map/.forEach/.reduce/...callback indices andentries(); the array-like missing-slot seed no longer pins a false literal0
1.13.0
Minor Changes
-
f5c0c6e: Guard-equality path facts and sum anchoring close the normalised-similarity derivation chain (#170) —
@nudo:assume d <= maxnow proves1 - d/max ∈ [0,1]whenmaxcomes fromMath.max(a.length, b.length)and the body guardsmax === 0, with no per-callee sidecar bounds.===/!==on undecided operands now carry symboliceq/nepredicates (previously folded to an unconstrained boolean), so$forkpushes the equality fact into branch Φ — the else arm ofmax === 0 ? … : …knowsne(max, 0)numericBoundstightens an endpoint when ane(x, n)fact matches its value:x ≠ 0 ∧ x ≥ 0 ⇒ x > 0(cross-source order-independent: the bound and the exclusion may live on the pred and Φ respectively); supplies the strict positive denominator that relational division folding requirescmpno longer applies brandToPrimitiveunboxing foreq/ne— strict equality has no coercion (new Number(5) === 5stays false)@nudo:assumelocal anchoring descends into fork-join sums: each member's term α-renames to the local's name (on that arm the member's value is the local), so ad = cond ? 0 : Math.max(...)callee result still matches the lemma; literal members keep their exact identity0 / xwith a provably non-zero, non-NaN denominator folds to literal0— the literal arm of such a sum no longer poisons the joined quotient bounds
1.12.0
Minor Changes
-
e4e491f:
@nudo:assumename resolution extends from parameters only to parameters ∪ top-levelconst/let/varlocals of the anchored function's body (#165).- names resolve against plain
Identifierdeclarators among the body's direct statements — destructuring, nested blocks, andfor-init declarations stay out; unknown names fail withnudo:assume-invalid(name(s) not bound as parameters or top-level locals) - locals follow SSA semantics — the lemma anchors the bound value at its definition point and applies to the end of the scope; after a reassignment the relevance conservatively lapses (no fold)
- anchoring activates only in the target function's own frame — callee frames see an empty premise slot, so same-name locals there cannot mismatch
- constant bounds still belong to sidecars; since a sidecar cannot reach a function's own locals, a local's constant contract goes on the producing callee's return (e.g. a levenshtein sidecar
return number().ge(0))
- names resolve against plain
Patch Changes
-
1881f97: Fix 38 differential bugs (wrong-definite values / false throws / missed throws) found by native-oracle differential testing, plus remove the differential harness's
concrete()blind spot.Call-site semantics (Bug 46/55/70/47, F1/F4/F5):
- receiver injection is call-site-correct via the
$callthisVal channel — dynamically-assigned/re-assigned/computed-key methods bindthis(no more false always-throwTypeError) super.x = v(instance methods/ctors, incl. compound + computed) emits$setSuper/$setSuperObjwith native setter-lookup semantics (was: invalid transpiled JS, hardSyntaxError)- object-literal
async m()wraps in$async(returns a Promise, not the raw body value) - computed Symbol-key destructuring (
{[Symbol.iterator]: it} = arr) binds; nested rest patterns (...[b, c]) and catch-param patterns (catch ([a,b])/catch ({v})) no longer drop bindings; un-lowerable rest LVals fail closed
Object identity & prototype chains (Bug 56/57/58/63/64/65/67/68/71):
- Proxy retains target + dispatches
get/has/settraps (setreturningfalsethrows strictTypeError);Array.isArray(proxy-of-array)→ true argumentsis branded (Array.isArray(arguments)→ false); error subclasses joinedNAMESPACE_GLOBALS(X.prototype.constructor === X, familytoStringdispatch);$get(Ctor, "prototype")returns a memoized proto brand instead of an anonymous objinstanceoflearnsObject.prototypeterminator (false for everything), classstatic [Symbol.hasInstance], and.prototype-suffixed brand chains (RangeError.prototype instanceof Error→ true);Object.getPrototypeOfhandles class values (B → A),extends null(A.prototype → null), andB.__proto__- array
entries/keys/valuesreturn real iterator objects (isArray false,.nextcallable, spread/for-of exact)
Effects & control flow (Bug 49/51/52/53/54, F2/F3, fork-try join):
- array mutators mutate in place at
$invoketime — expression-order correct (s.pop()+s.pop()), call-receiver receivers persist (m.get("a").push(1)); deferred expression-position rebind machinery removed - generators: >8-yield sequences no longer truncate; spread/for-of continue from the current position;
.return()/.throw()honor try-context (finally return-override → graded union, catch absorbs, no wrong-definite) - async bodies convert throws to definite-rejected promises (
.catchabsorbs;awaitchains reject; thenable adoption); setter bare early-return;keeps the receiver return/throwinside try regions nested in if-arms join correctly (was: folded to fall-through value; also fixes latent callee-frameloopExitsdrops andNudoReturnleaks on raw-host call paths)
Builtin throw domains (Bug 59/60/61/62/73, M1–M5):
JSON.stringify: callable replacers invoked per-entry (throwing replacer → definite throw; never silent no-throw); decidable cycles hard-throwTypeError; symbol-keyed slots never serialize (literal"@@x"string keys still do)Symbol.forinterns container keys via ToString (Symbol.for([1]) === Symbol.for("1")); non-concretizable keys degrade to unknown identityString.prototype.replacepasses the named-groups object to function replacers (groups.dworks, no falseTypeError)Function.lengthstops at the first default/rest param (declarations, expressions, arrows, methods)- missed throws fixed:
'' + Object.create(null), freearguments(ReferenceError),(5n).toFixed,sortwith throwing/impure comparators (effectFree facet; effect-free comparators execute with ES2019 stable-order exact fold),Object.assign('ab', {0:'x'}) - error instances:
nameinherited,message/stackown non-enumerable (hasOwnProperty/propertyIsEnumerablenative-correct); accessor-formSymbol.toStringTaggetters invoked byObject.prototype.toString
Test harness: differential
concrete()no longer masks never-results and abstract placeholders — engine-proven throws compare against the native throw domain (FALSE-THROW), native-throw vs engine-value is a new MISSED-THROW category with aknownMissedThrowspin ledger (rationale-carrying, loud warnings); 638 stale masking pins removed fromskip-baseline.json.Precision residuals (native-exact where native is definite):
- generators:
.throw()into a returning catch foldsdone:true(catch-facts bits: contains-yield/return/rethrow, yield*-delegation poisoning — unclassifiable arms stay sound boolean); fresh-generator spread/Array.from/destructuring-rest/yield*consume the authoritative yield list (exact >8-element tuples, no >8 widening loss) - promise chains: definite-fulfilled
.catchhandler is dead code (exact passthrough); effect-free closed.then/.catch/.finallyhandlers execute synchronously with exact value adoption (await Promise.resolve(21).then(x => x*2)→ 42); then second-arg joins the rejection arm on two-channel receivers (was dropped — unsound); unsettled state modeled as a first-classunsettledfacet - identity: fresh instance ids (WeakMap side table) — distinct promise/generator/iterator/class-instance/literal objects fold
=== false; aliases and adopted references staytrue super.x += 5on a closed parent chain folds exactNaN(missing proto slot readsundefined); static super writes land on the receiver class (native), not the parent- static methods model
thisas the class value (B.m() === B, arrows capture lexically,this.y = 5writes the class, static field initializers see the class);@@hasInstanceadapter forwards the receiver - inherited static member reads walk the constructor's
[[Prototype]]chain:class B extends A { }readsB.x/B.m/B.g(fields incl. computed keys, static blocks, and dynamicA.y = …writes; same Abs reference soB.o === A.o), multi-level chains, own-shadow first; builtin parents dispatch through the host static channel whenextendstargets a real host builtin (class B extends Object {}→B.keys({a:1})exact,class E extends Error {}→typeof E.captureStackTraceis"function"— was wrong-exact"undefined"); presence ("m2" in A/"x" in B) uses the static face (instance methods no longer foldtrueon class values, statics no longer foldfalse); instance receivers no longer dispatch statics (a.staticM()was folding the static result instead of the nativeTypeError); mock/holed parents degrade to sound unknown/boolean - promise executors collect settle calls path-sensitively via a fork-arm token tree:
new Promise((res, rej) => { if (c) res(1); else rej(2); })folds the two-channel{inner: 1, rejected: 2}(the reject arm was silently dropped); same-path sequential settles keep native first-wins; resolving a promise inside a fork arm merges its rejected/unsettled channels into the join face; early executor exits no longer leak the executor scope; chained-then recovery results stay unsettled until the microtask join (was folding the first arm's value) - method default parameters bind like function defaults, with the receiver in scope:
m(a = this.v), object-method/setter/static/destructured forms, arrow-in-default lexicalthis,arguments-reading and rest defaults all fold exact ($arrRestnow delegates theArgumentsbrand) - static field initializers resolve the class's own name:
class C { static n = 3; static x = this === C; }foldstrue(thunks emitlet <Name> = __this;mirroring the native class-body lexical binding — inner-class references, named class expressions, shadowing params, andstatic name = "custom"overrides all native-exact) - error introspection:
Object.getOwnPropertyDescriptoron error brands builds exact data descriptors (flags-aware);Object.hasOwnfolds own-vs-inherited exactly; gOPN returns the native install order (stack, message[, cause][, errors]); catch-param payloads gain thestackslot (was missing) - dev infra: every package gets a package-local vitest config delegating to a shared factory —
cd packages/<p> && ../../node_modules/.bin/vitestresolves@nudojs/*to workspace src (no more stale-dist split-brain)
Final precision wave:
- executor settle-liveness is path-sensitive: a fork arm that ends without a settle call contributes the
unsettledfacet (new Promise(res => { if (c) res(1); })no longer folds barepromise<1>); exit arms (early return / uncaught throw / swallowed catch) are clocked so join-after-exit settles don't cover them;awaitof an unsettled promise degrades through$async(definite awaits stay exact) - static and instance method reads are identity-memoized per defining class entry —
B.m === A.mfoldstrueacross inheritance, distinct/overridden foldfalse; class values expose.length(ctor arity before first default/rest — implicit derived ctors are0, matching the native rest-forwarding constructor) - extensible host parents beyond Object/Error (ArrayBuffer/URL/DataView/WeakRef/…) dispatch inherited statics through the host channel (
typeof AB.isView→"function", absent →undefined, whitelisted pure calls fold) and construct throughevalBuiltinNew(new AB(8).byteLength→ 8); function-expression parents get a stable synthesized identity —B.prototype.constructor === B, memoized fn.prototype(mutable, expando statics land), chain data-slot reads with own-over-inherited precedence,new B() instanceof Base→ true - static-only members invoked on an instance receiver fold a definite
TypeError(never result); rebinding the class's own name inside class bodies (methods, statics, accessors, static blocks, field initializers, arrow captures) folds a definiteTypeError— while the outer class binding stays mutable exactly as native (verified: ESM class bindings are let-like); const names shadowed by params/catch params no longer false-throw
- receiver injection is call-site-correct via the
-
1881f97: Fix fork-arm × try-region early-return join:
return/throwinside try/catch/finally nested in an if-arm folded to the fall-through value instead of the arm's early exit.stmtReturnslearnedTryStatement(finalizer jump-outs cancel, handler/block both-terminal) so try-region returns trigger arm promotion / both-return rewriting- arm-thunk returns now signal via
$loopReturn(conditionalFlow), delivered exactly once bysettleForkArms(double-ret throws joinedNudoReturn; single-ret enters the exits channel — no longer pre-pushed and double-counted) - transpiled function bodies are self-contained:
$catchReturnabsorber keeps raw host calls (nudo export.mjs imports, e2e) from leakingNudoReturn— also fixes the latent leak for loop-returns callAtFunctionBoundaryand the compiled-body$callpath join frameloopExits(ret-arm values were silently dropped → wrong-definite, e.g. arrow functions with loop early-returns)- a lone ret-arm whose sibling arm throws no longer fabricates a fall-through
undefinedcompletion (if (g) return "s"; throw Ewasundefined | "s", now"s"— the statement has no fall-through path, so the join yieldsnever)
-
8466793: Class-surface diagnostics: static-on-instance calls and class-body self-name writes fold exact (P4).
Static-only member on an instance receiver (
class C { static m() {} } new C().m()):- native throws
TypeError(c.misundefined— statics live on the constructor, notX.prototype); the engine previously degraded tounknown(N2 sound stop-gap) - now exact: when the class registry proves the member static-only (registered
staticMethods/staticAccessors/statics/class-value slots anywhere on the chain) and the instance face provably lacks it (no method/accessor/builtin-brand member on the chain, no same-name instance field, no own receiver slot, no chain hole, not anObject.prototypename),$invokethrows a definiteTypeError - guards keep everything else unchanged:
c instanceof C→ true, instance-method calls, member reads (typeof c.m→"undefined"), optional calls (c.m?.()short-circuits toundefined), ctor-assigned own fn slots, same-name instance fields/getters, prototype-chain instance methods shadowing statics, class-value static dispatch
Class-body self-name binding is immutable (native
CreateImmutableBinding):C = v/C++inside methods, accessors, static blocks, and field initializers now folds definiteTypeError(was: silent rebind — N4's documented sound over-approximation); routed through the existing const-assignment channel (constNameson class-body member opts)- the outer binding stays mutable on purpose: native
class C {}; C = 5is legal (ClassDeclarationIsConstantDeclarationis false — verified on Node 26: no-throw,Cbecomes a number); the engine's outer-letemission already matched native and is unchanged, as arelet D = class {}; D = 5and function-scope classes - member writes on the class name (
C.q = v, compound/update/logical-assign) still rebind through the internal root-rebind path — unaffected
Binding-shadow fixes required by the above (wrong-definite throws, pre-existing for module
consttoo):- function-boundary params are subtracted from inherited const bindings:
const K = 1; function f(K) { K = 5; }no longer foldsTypeError(writes the param binding — native no-throw); covers declarations, expressions, arrows (incl. expression bodies), and class methods - catch params likewise:
try { … } catch (K) { K = 5; }with an outerconst K/class-body name no longer falsely throws
- native throws
1.11.3
Patch Changes
-
08d7a55: Fix five exec-surface wrong-concrete bugs (80–84) found by differential testing:
#x in obj(private-fieldinoperator): the leftPrivateNameoperand fell throughisExpressionand compiled to$lit(void 0), so the presence test always returnedfalse. Theinarm now emits the mangled"#x"key via the sharedprivateNameKeySrchelper (also deduped into member read/assign).this.#x += 1(private-field compound assignment): the root-non-rebindable branch emitted a simple assignment using the RHS directly, dropping the operation (+=1assigned1). It now appliescompoundFnto the current$getvalue, mirroring the member-path branch.o + "x"with aSymbol.toPrimitivehook:coerceToStringPartsfolded hook-only objects to the default"[object Object]"tag (wrong concrete string). The fold guard now also checks for an own"@@toPrimitive"slot — hook presence blocks the fold and yields a sound abstract string domain.Array.prototype.concatignoresSymbol.isConcatSpreadable: spreadable objects are now spread as array-likes (ToLength(o.length)elements),lit falsesuppresses spreading, abstract flags degrade toarr(sound).- Private fields leak as enumerable own properties: private slots are now flagged
internalat instance-field registration (not by#name prefix — public string keys like{"#x":1}share the key space and stay visible).for-in,Object.keys/values/entries,hasOwnProperty,getOwnPropertyNames/Descriptors, spread,Object.assign, andJSON.stringifyexclude internal slots; directthis.#xaccess and#x in objslot-presence semantics are unchanged. Class-instance spread/assign now also includes public fields (previously dropped), and Error-family own slots (name/message/stack) are non-enumerable per native semantics. - Class-instance precision follow-ups:
Object.getOwnPropertyDescriptor(new A(), key)now folds exact data/accessor descriptors for public fields (runtimedefinePropertyflags and dynamic getters included) instead of the conservativedescriptor|undefineddomain;JSON.stringifyfolds class instances with prototype getters exactly ({"pub":2}— prototype accessors are not own properties, native never invokes them during stringify; onlytoJSONmethods keep the conservative fold).
1.11.2
Patch Changes
-
82eaae8: Fix
nudo:recursion-truncatedmisattributing call-cycle truncation to "depth/size budget", and makenudo check --jsonbudget stats see the B-path ($callNamed) truncation (issue #158):enterCall/evalEnterCallnow attribute a truncation reason —cycle(same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers orgrow-style recursion) vsdepth/calls(real budget exhaustion). The check diagnostic message, suggestion, structured action, and a newreasonfield on the issue (cycle|depth|calls|budget) split accordingly: cycle says "budget cannot lift this" and never points at@nudo:budget; depth/calls name the exact raisable dimension (@nudo:budget depth=…/calls=…).- The
check --json/ health budget block no longer reportstruncated:falsealongside anudo:recursion-truncatedinfo: B-path counters are latched across execution sessions within one host entry and surfaced asevalCalls/maxEvalCalls/evalCallTruncated, pluscycleTruncatedand a sortedreasons[]set (single-file and multi-file envelopes, and the disk-cache round trip). Fork counters/truncation flags are latched per host entry too (the last-session snapshot could previously erase an already-reportednudo:fork-truncated). - The
@nudo:budgetquickfix (nudo check --fix/ LSP code action) is no longer offered when the truncation reason iscycle; thereasonis plumbed throughcheck --json, the disk cache, LSP diagnostic data, andmaterializeAction. - Raising
@nudo:budgeton a same-args recursion could never lift the truncation — the old message misled real budget investigations into "directive ignored" hypotheses. - Loop-iteration truncation (
#loop-iterations) no longer masquerades as recursion: it now emits its ownnudo:loop-truncatedinfo with an honest message and suggestion (the call-budget knobs cannot lift a loop budget —@nudo:budget calls=/depth=does not apply), gets aloopTruncatedflag in thecheck --json/ health budget block (single-file and multi-file envelopes), and no longer offers the misleading@nudo:budgetquickfix it used to inherit from the recursion branch.
1.11.1
Patch Changes
-
612d64f: Fix loop-mutated array bindings widening with fabricated
(unknown | undefined)[]arms —for…of+pushreturn values now prove against element contracts (issue #156):loop-widen.ts: tuple length growth (push accumulation) is now detected as element-domain growth ({el}) instead of whole-value growth; widening goes througharrify— element domain = join of all observed element domains. No fabricatedunknownelement arm from the empty initial tuple, no baked out-of-boundsundefined(OOB is a read-site fact:$idxon an abstract index already joins the marker; concrete-index optimism matches the engine-widearrinvariant shared withsplice/sortdegradation).- Packed-container slot joins produce sums of objects (
joinValuesdoes not structurally merge object slots);normalizeForWidenstructurally merges same-key-set object sums before the growth tree descends, so sequential states of{ list: [...] }-style accumulators union their element domains instead of widening the zero-element member alone intoarr(unknown). control.tswidenLoopJoin: stops baking the OOB marker into collapsed element domains (hole reads still contribute, they are real element values).postcondition.ts:conf="widened"structural arms (arr/tuple/obj) againstarray(...)/shape(...)contracts (union members traversed) now discharge through per-element/per-field reconciliation — widening loses length/key-openness/bound/path evidence, not the structural domain. Guards unchanged: bounded element contracts (number().gt(0)), mismatched prim domains, and unknown element domains stayunprovable; interrupted loops (abstractbreak) keep the honestunknown[]top.- No-growth loop exits now collapse array-family sums in packed binding slots (
collapseArrSums): a parameter-positionarrbinding whose element domain isunknownabsorbspushvalues (growth detection sees nothing), and the widener's accumulatedjoinAbsused to smear the sequential states into a two-arm sum (unknown[] | (unknown | {v})[]). Sequential states of one binding now union into a singlearr(conf preserved — representation collapse, not widening; equal-length tuple-only joins and non-array sums untouched).
1.11.0
Minor Changes
-
16cda31: Add
@nudo:assume <param> <= <param>user lemmas: cross-variable bound premises participate in relational division folding, so return contracts like1 - d/max ∈ [0,1]become provable (#152).@nudo:assume a >= bis normalized tole(b, a); malformed lemmas or names outside the formal parameter list reportnudo:assume-invalid(error).- Premises are seeded per target-function entry evaluation and never inherited across call boundaries (callee frames are cleared — same-name re-anchoring cannot produce false precision). Recursive calls are conservatively cleared.
- Division folding derives the correlated bound
le(a,b) ∧ b > 0 ⇒ a/b ≤ 1(plus mirrors), which plain interval propagation cannot express; downstream+/-/*folding consumes it as usual. - Proofs that rely on lemmas surface
nudo:assume-relied(info) — user axioms stay audit-visible. - Constraint builders now throw on non-numeric bounds (
number().le("max")previously built a silent string-literal predicate); use@nudo:assumefor cross-variable references.
Patch Changes
-
cce5e58: Fix false
nudo:unproven-returnwarnings when a return value was widened to a prim domain top by the loop-carried-binding widener (issue #151):postcondition.tsnow treatsconf="widened"loop-widen products under the same policy as issue #115 partial arms: widening loses bound/path evidence but not the prim value domain, so domain membership against an unbounded bare prim contract is provable.- The whole-value
isValueSetUnknowngate inassertImpliesno longer swallowsconf="widened"returns before arm distribution; the per-arm gates inassertImpliesSingle(new proved exit) andassertSumArmskeep everything else conservative. isWidenedSumArmalso accepts arm-levelconf="widened"(loop-widen sums carry widened on both parent and arm), enabling the existingprovesBarePrimDomaindischarge for union members such asunion(string(), lit(null)).- Guards unchanged: widened arms with mismatched prim or bounded contracts (
number().gt(0)), and any-derivation FP protection, stayunprovable(neverproved, neverdisproved); non-widened exact-arm semantics are untouched.
-
cce5e58: Fix array mutator spread arguments (
f.push(...xs)) folding to$unknown()and polluting the container element domain (issue #153):- The array-mutator fast path in
transpile/stmt.ts(statement position, identifier/member-path receivers) and the rebind lines ofemitArrMutatorRebindsintranspile/emit.ts(expression position / nested mutators — the rebind line performs the real mutation, so the unknown argument landed in the container) now emit...$elems(<expr>), the same flattening the ordinary call paths have used since DEC-006 K5. Generated code is a JS spread inside the args array literal, so$elems' returnedAbs[]flattens element-wise into$arrMutContainer. - Element precision restored:
const findings = []; findings.push(...check(x)); return findingskeeps the precise per-element tuple fromcheckinstead of[unknown]; mixed arguments keep order (f.push(a, ...xs, b)); spreading an abstract array joins its known element domain via the single representative; spreading a string pushes per code point, matching nativepush(..."ab")semantics.
- The array-mutator fast path in
1.10.2
Patch Changes
-
8806e93: Fix env-brand iteration false warnings and env-global slot writes poisoning whole-function evaluation (issues #147/#148):
iterabilityKind/asyncIterabilityKindnow treat abrandshape as a nominal label delegating to its inner structural face: a brand wrapping an array/tuple/string/@@iteratorobject is total (no moremay throw TypeError — iteration over possibly non-iterableonfor…of/spread over envArray<T>brands such asfs.readdirSync). Non-total inner faces stay may and never degrade to definite (TypedArray/Buffer brands wrap an empty object whose prototype@@iteratoris not modeled). Element domains delegate the same way (elemsOf/$concat): thefor…ofloop variable and spread elements now fold to the inner array element (string | Dirent) instead ofunknown, and a brand wrapping a tuple keeps the precise tuple shape when spread ([...t, ...brandT]stays a tuple, notT[]).- Env-global injection in
runTranspiledbinds globals withletinstead ofconst: a member write likeprocess.exitCode = 1compiles to a root-rebinding write-back chain (process = $set(process, …)), which against aconstbinding threw a native TypeError and poisoned the whole eval (return folded tounknown+nudo:unknown-inference+nudo:entry-may-throw). Env globals are writableglobalThisproperties natively; writes now fold and a later read in the same program run observes the written value.
1.10.1
Patch Changes
- 96090cd: Fix unsound getter loss on object joins:
joinAbs/joinObjectsbuilt the merged object as a fresh Abs identity without migrating the accessor side table, so a getter arm joined with a data arm read as itsundefinedplaceholder ({ get q() { return 42; } }joined with{ q: 0 }readundefined | 0instead of42 | 0). Mixed arms now fold the getter's read domain (evaluated with its original receiver, same as$spread) into the data slot; arms sharing the identical accessor definition (aliases, migrated immutable updates such as loop-widening frames) migrate the registration whole so reads keep dispatching through the side table. The accessor table moved to a leaf modulealgebra/accessors.tssoobjects.tscan consume it without an import cycle;annotateJoinPath's re-wrap now migrates registrations to the final identity.
1.10.0
Minor Changes
-
b8db17b: 参数契约折叠展示(inlay + hover + 签名):
- inlay:侧车
fn()形参表达式原文(如where nullable(astNode))或@nudo:contract指令约束名替代谓词无损展开(lazy 判别联合展开可达数万字符),完整谓词经 LSP inlay tooltip 展示。侧车 ∧ 指令并存时展示expr ∧ name(任一文本缺席则整体回落谓词全展);整表达式别名(import { astNode as N }的裸N)规范化为导入名;派生形参(spread / computed)无静态文本,回落谓词全展。 - hover:参数声明位 hover 折叠为声明形态(
node: nullable(astNode)),函数名 hover 签名的契约参数同口径折叠;函数名 hover 的契约面 display 同步折叠。体内引用位经求值器重放直读引擎求值态 Abs(核心变更):transpilerecordPositions插桩($nodoPos——标识符值读 / 静态成员属性位 / 可选链成员跳属性位,计算成员记表达式起始位;记录并原样返回,语义恒等)+runTranspiled符号执行导出函数(入口 Φ 种子 + 契约参数 Abs),位置直读求值态 Abs——流敏感窄化为引擎求值语义(早退守卫 nullish 剥离 / 判别等值窄化 /!==对偶 / typeof 守卫 /&&/||链,Φ-native$fork臂内withExecPhi+$narrowMemberEq剪影),非 LSP 层近似。显示阶梯:求值态与入口 Abs 等价(leqAbs 双向)或仅剥 nullish 的位置(声明位 / 检查点 / 成员访问对象 / 落回位)→ 折叠声明形态 + 类型值变量链接;窄化位(守卫 then 分支 / 成员读槽位 / 局部量)→ 求值态展示(node: { type: lit("StringLiteral"), value: string } | { type: string }——showLits渲染 lit 判别值与侧车文法同形;开放尾臂按 may 态保守保留——其type: string()值域与 lit 判别重叠,成员读槽位在尾臂缺席 →string | undefinedsound)。重放 fail-closed(求值失败 / 预算超限 / 无契约 / 非导出 / 解构形参)→ 回落声明形态面:||组 then 分支(引擎 phi 合取不能表达析取事实)LSP 层按匹配臂联合源文本窄化(sound);else 分支否定形态有界跳过。折叠面中的类型值变量包为链接([astNode](file://<依赖侧车>#L<定义行>)——经侧车 import 表 / 本地顶层声明 / re-export 一级解析;渲染为 plain markdown——代码块内链接不渲染),替代原独立"契约原文"行;无引用变量的契约回落契约原文行。 - core API:
formatShape(a, { maxDepth, showLits })——showLits把eq(self, lit(v))pred(槽位为get(p, k)字段项、顶层为参数项)渲染为lit(v)(默认 false——既有全部展示面口径不变)。 - 修复:exec 缓存命中(同内容侧车在不同路径——复制的契约)时不重跑
execSidecar,参数折叠文本注册表按路径键在命中路径补登记;此前第二个同内容侧车路径查不到折叠文本、回落谓词全展。
- inlay:侧车
Patch Changes
-
334b914: Discriminant narrowing visible in slot display; mid-token hover resolution
$narrowMemberEqkeep-arm refinement: surviving union members with a compatible discriminant slot now carry theeq(slotTerm, lit)fact on that slot (conjoined with any existing pred).formatShape(showLits)renders it vialitPredValue, so the open-tail arm displays{ type: lit("TemplateLiteral") }afternode.type === 'TemplateLiteral'instead of the unrefined{ type: string };memberEqClassupgrades those members toonly, improving chained discriminant narrowing and complement-arm pruning.any/unknownslots stay untouched (fail-closed markers).litPredValuenow readseq(self, lit)facts throughand-conjunctions, not only top-level eq preds.- LSP A0 hover replay resolves mid-token cursor positions: record keys are Babel start positions (
$nodoPosusesloc.start), so a cursor anywhere inside an identifier span now resolves to that identifier's record instead of falling back to the declared-form fold (previously only the first column hit).
-
94197eb: hover 弹窗可读性与 return 表达式推导:
- pretty 缩进展示:
formatShape(a, { pretty: true })(opts 挂ProjectionBudget.pretty,与showLits同先例)——object 每槽一行 + 尾逗号 + 2 空格缩进递增;union 仅当至少一臂是复合 shape(object/array/map/set/fn 或渲染含{)时按臂断行(|前缀换行),纯 prim/lit 联合保持单行(string | null | undefined不断);截断标记…/…cycle原样内联。默认(不传 pretty)输出字节不变——check 签名 / dts / inlay / 语义 token 面不受影响。应用点仅 hover 面:标识符 hover(identHover / A0 求值态)与 return 表达式 hover;gSig签名、paramDisplayOf声明形态折叠面保持单行。 - 删除「契约原文」链接行:hover 弹窗不再推送
[契约原文](file://…#L<n>)链接(linkedText变量链接面保留);HoverInfo.sidecarPath/sidecarLine字段随唯一消费方一并删除。 - return 表达式推导 hover:transpile
ReturnStatement在recordPositions时把返回值包$nodoPos(src, line, column)记录到return关键字起始位(argument 起始位与内部根标识符读记录同键 first-wins 丢失;emitRet单一 choke point 覆盖 asVar/try/loop/mutator 全路径;裸return;不记录)。LSPabsNodeAtPosition词中回落从 Identifier 泛化为任意带 loc 节点(候选仅当起始键已有记录,取最小 span——词中标识符行为不变);新增无 ident 分支——hoverreturn关键字或表达式内非标识符位(?.[、[0]、.)直接显示推导类型(无 ident 前缀,pretty 渲染)。
- pretty 缩进展示:
-
5e275df: fix: review hardening — Map.groupBy empty-reduce crash, Bug 1 early-exit relational narrowing, fs-error graph-edge degradation, agent tool module graph, brand presence for URLSearchParams/TextDecoder/Intl, generator side-table $copy migration
Map.groupBy/Object.groupBy: shadow-domain join no longer bare-reduces an empty unkeyed list (raw hostTypeError: Reduce of empty array with no initial valueescaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades tounknown.- Early-exit lift path (if-return followed by non-tail statements) now applies the same relational-arm narrowing as the regular IfStatement path (
narrowRelArmThunk), fixing false positives likeif (x >= 0) return x; console.log(x); return 1;under@nudo:contract return nonNeg. extractImportEdgesskips import edges whose target resolution throwsModuleReadError(EACCES/ESTALE, #135) instead of crashing module-graph construction (CLI watch start, incremental rebuild false-green rounds, LSP validation).new Function(...)/new Function("a", "b", ...)validate every argument for the L2 may-throw gate, not just the first.- Brand presence tables: URLSearchParams (methods +
size), TextDecoder (decode+ accessors), Intl.NumberFormat/DateTimeFormat (format/formatRange/parts/resolvedOptions); URLSearchParams joins ITERABLE_BRANDS (@@iterator → function). $copysnapshots migrate generator/match side tables (genDeferred throws, genIter/matchAll elements), so fork/switch-arm rebinding no longer silently drops deferred generator throws.- LSP agent tools (check/hover) build the module graph like the CLI and LSP validation do, fixing cross-module unknown collapse (E5 parity).
1.9.4
Patch Changes
- 2af4016: fix(core): generalize display (hover intension) renders destructured params as
{ a, b }viaformalParamSignatureNamesinstead of the_p0evaluation placeholder, while entryReqs preds and promoted entryShapes/fnRels lookups keep using the placeholder keys (#138) - 2af4016: fix(core): sidecar dot-path keys (
fn({ 'card.grade': string() })) now bind nested destructured params — nestedPaths surface collection, fieldPath-aware projection in check/case scans, and nested obj-Abs synthesis in the refine block; flat binding names keep precedence (#137)
1.9.3
Patch Changes
-
b6495c6: fix(core): regex 捕获组接收者窄化 + exec 抽象匹配 per-index 槽(#136)与方法调用接收者守卫事实
- 抽象 subject 的
re.exec()结果从均质元素 arr(m[0]/m[1]同值string|undefined、无从窄化)改为与具体路径matchResultAbs同构的 per-index 槽 obj:m[0]=string、捕获组槽=string|undefined、length/index/input/具名groups全可读(修前 length/index/input 为 unknown)。 if (m[1].trim().length > 0) out.push(m[1]):方法调用求值到达 ⇒ 接收者非 nullish——该事实经既有臂 thunk 影子参数窄化应用到 if 两臂(短路方向 sound:A && B的 B 位仅真值臂、A || B的 B 位仅假值臂;?.可选链不识别)。修复 1.3.15 数组元素诚实化引入的array(string())误报 constraint-violated(守卫后 push 的元素必为 string)。memberGuardTarget计算键认数值字面量:if (m[1])显式真值守卫与if (o.p)同走 $removeMemberNullish 槽剪影(此前计算键一律不识别)。- 诚实化不回退:无守卫直推仍如实报
string | undefined契约违例;.trim()的 nullish 臂 throws 事实不丢(无契约时仍报 entry-may-throw)。
- 抽象 subject 的
-
04a6d1d: fix(lsp): IDE 面(hover/inlay/check 诊断)接入模块图——跨模块 import 塌缩 unknown 的假空与假红
- 根因:CLI
nudo check经buildCheckInjection把evalAbsModuleGraph模块图传给checkSource/generalizeFromAst,而 LSP 侧同族调用(hover intension、collectAbsInlays、checkToLspDiagnostics)不带图——跨模块 import 不可解析,函数体求值 fail-closed。表现:函数名 hover 显示(_p0: A1) => unknown / conf: opaque(参数无侧车种子 + 返回 unknown),Abs inlay 为空/unknown,且nudo:unproven-return假红(CLI 同文件全绿)。求值引擎本身精确(entry@/combinedAbs 无误),仅 host 装配缺口。 validation.ts新增evalAnalysisModules(filePath, source):evalAbsModuleGraph组装(abs-modules-graph 内容缓存,重复调用廉价;cycle 不注入,与 CLI hasCycle 分支同语义 fail-closed)。lsp-surface.ts函数名 hover 的generalizeFromAst补refine(fromFile/loadModule/autoBind——此前连 refine 都没传,参数丢契约种子成 A1)与modules(经SurfaceReuse.modules)。core/algebra/inlay.tsCollectAbsInlaysOpts增加modules透传给 generalize;server-ide.tshover/inlay 处理器组装并传入图。- 验证(npm-safe scanner decide.js,手写侧车 + 跨模块调用链):修复后 hover = 契约 +
{confidence: 1|0.9|0.7|0.95, grade: "F"|string, …},inlay 三函数全精确,假红诊断 0;全套 vitest 1841 通过。
feat(lsp): 观察选择器——contract 成为与各 case 并排的 ●/○ 选项 + 档线改名
● contract / hw|gen|imp- 档线改名:CodeLens / hover 首行 / inlay 档投影的
● interface / handwritten|generated|implicit统一改为● contract / hw|gen|imp(formatInterfaceTierLine单源,新增INTERFACE_SOURCE_ABBR导出)。 - contract 是观察选择器的一项,与各 case 互斥(IDE 内点 ●/○ 切换,非配置开关):
- 默认
● contract / hw|gen|imp、全部 case○——与分析器默认(无激活 case 不跑 case 种子)一致(此前 case 0 默认显示 ● 与实际观察态不符); - 点击 case(
nudo.selectCase,已有)→ 该 case●、契约转○;点击契约选项(新增nudo.selectContract,executeCommand +nudo/selectContract请求别名,位置参数[uri, fn])→ 取消激活 case(幂等); - inlay 档投影镜像激活态(
●/○ contract / …);persist/draft 动作与call@/entry@观察层不受选择影响。
- 默认
- hover 与 Abs inlay(参数约束/返回 term/pred)不参与选择器(推导面)。
- 根因:CLI
1.9.2
Patch Changes
- c8e0417: Propagate member truthy-guard facts into union containers (issue #129).
$removeMemberNullishnow classifies sum members per the guarded key: members whose read is definitely nullish — a closed shape without the key whose absent read yieldsundefined(noopen/index signature, noObject.prototype/constructorkey, no getter), or a getter-free all-nullish slot value — cannot survive the truthy arm and are pruned; members withT | nullishslot values oroptionalflags are rebuilt with the nullish members stripped and the flag dropped (same refinement the single-object branch has applied since #118, now also migrating the accessor/invariant/nullProto side tables to the rebuilt identity).if (!node.property) returnfollowed by a chained re-readnode.property.typeon a discriminated union with a lenient catch-all arm no longer records a falseproperty 'type' on undefinedmay-throw. Keys whose absent read is unjudgeable —open/index shapes,Object.prototypemethod names andconstructor(proto-chain reads a function), and getter-backed keys (the read returns the getter result, not the placeholder slot) — stay conservatively, as doany/unknownslot values and non-object members; all-pruned sums pass through unchanged and single-member remainders collapse, matching$narrowMemberEqconventions.
1.9.1
Patch Changes
-
bf601e0: Fix class-C abstract-eval under-approximation bugs (4/6/19/21/47/48/53) — loop-carried accumulator widening and iteration element domains.
for/while/do-whileunder abstract conditions andfor-ofover unbounded iterables no longer fold loop-carried counters into exact bounded sums (0 | 1,0..8): exit snapshots are growth-tracked per binding and widened to unbounded sound domains (number/string) when the budget is exhausted, while join-idempotent bindings and all-concrete loops (including definitebreak/continue) keep their exact behavior. Array-literal spread stops polluting element domains ([...xs]→number[]notnumber | unknown[]; empty-tuple join identity isnever, abstract strings spread tostring[]),for (const c of s)/yield* sover abstract strings yieldstringinstead ofunknown, no-initial-valuereduce/reduceRightseed the accumulator from the element domain (killing the phantom string arm of+), array HOFs pass theirthisArgto callbacks (nativeGetThisBinding—[1,2].map(function(){return this.k},{k:7})now evaluates to[7,7]instead ofnever+ false may-throw), andnew Array(n)for abstract numberngives a decidableundefined[]element domain (sparse holes) instead ofunknown[]. The widened bare-prim arms this produces no longer trip return-contract discharge: a loop-widenednumberarm proves against nullable/union contracts with an unbounded same-prim member (issue #102 regression —lev-style DP tables undernullable(number())return contracts no longer emit a spuriousnudo:unproven-returnwarning when the real arms and the OOB marker arm are all covered). -
bf601e0: Fix class-B brand-slot modeling bugs (10/15/22/23/28/29/39/45/46/58/59): Error family
toString/toLocaleStringnow render`${name}: ${message}`andObject.prototype.toStringtags the whole family[object Error]([[ErrorData]]); Error brands carry astack: stringslot.new ArrayBuffer/new SharedArrayBuffer/new DataViewstore construction args as brand slots (byteLength/byteOffset/maxByteLength/resizable/growable; literal-folded, abstract → number). Boxed brands (new String/new Number/new Boolean,Object(prim)) store the wrapped primitive in an internal non-enumerable slot via a singlemakeBoxedAbsbuilder and dispatch instance methods through the unboxed primitive face (valueOfunwraps;charAt/toFixed/… fold). Map/Setkeys/values/entriesreturn iterator objects (statefulnext()→{value, done}plus element side table) so spread/for-of/Array.from/.next()chains evaluate. RegExp brand construction converges on one declarative slot builder coveringsource/flags/lastIndexfor abstract patterns too, plus the 7 flag getters (global/ignoreCase/multiline/unicode/dotAll/sticky/hasIndices) folded from the flags string. URL brands exposehostname/pathname/search/hash/port/username/passwordslots.Date.prototype.getYear/setYeardispatch as number getters/setters.new BigInt()andnew Math()/new JSON()/new Reflect()now deterministically throwTypeError(previously a silent bogus brand, or an internalspecOfcrash swallowed intounknown+ false may-throw). -
bf601e0: Fix class-A call-position dispatch bugs (1/2/5/7/8/11/12/24/26/38/50/51/55): namespace-static and method dispatch tables no longer shadow env declarations with
unknown.Number.isSafeInteger,Date.parse/Date.UTC(literal args fold to exact timestamps),String.rawtagged templates (exact splice on all-literal quasis/subs),Object.defineProperties(returns target, reuses the defineProperty machinery via shared helpers) andObject.getOwnPropertyDescriptors(exact per-slot descriptors for closed objects/tuples) now evaluate. Host URI/escape globals (encodeURIComponent/decodeURIComponent/encodeURI/decodeURI/btoa/atob/escape/unescape) are registered inGLOBAL_FNSwith exact literal folding,stringresult domain for abstract string args, and per-function may-throw faces (URIErrorfor decode*,InvalidCharacterErrorfor btoa/atob). ES2024 statics:Array.fromAsync(promise offrom's element projection with thenable unwrapping),Promise.withResolvers(three-slot object),URL.canParse(exact boolean on literals;URLadded to the namespace routing/env-shadow tables in parity). String method table gainstrimLeft/trimRightaliases, Annex B HTML methods (bold/anchor/link/… exact tag folding), andsearch/match/matchAllarms for abstract/template receivers (number,null | match array, iterator brand; non-globalmatchAllis a definite TypeError); string-literal patterns now fold throughRegExpCreatesemantics ("abc123".search("c")→2), ands.at(n)on abstract receivers includes theundefinedarm.Array.from(<obj>)array-likes read index slots (Array.from({0:"a",1:"b",length:2})→["a","b"]exact tuple) and foldlengthviaToLength("2"→2, missing→0, abstract → element domain). Host global function values are first-class: returningparseIntyields a function type,[1,2,3].map(parseInt)→[1, NaN, NaN], and.call/.apply/object-slot/thenpositions dispatch through the called-position bridge (sharedcallHostGlobalFn) instead of feeding Abs objects to host functions. -
bf601e0: Fix class-D semantic-special-case bugs (13/14/17/18/20/25/30/33/34/36/37/40/42/44/60).
False may-throws eliminated:
s.split(/re/)no longer treats a RegExp separator as a ToString operand (@@splitdelegation never stringifies it);JSON.stringifyon closed builtin brands (Date/RegExp/Map/Set/Error family/URL/ArrayBuffer family — folded exactly:"{}"/ href / ISO string), closed objects with primitive slots, and abstract arrays with non-bigint elements no longer record the BigInt/circular/toJSON may-throw;Reflect.apply(f, thisArg, argsList)replays the call through the$invokeapply path (Math.max→2exact) and no longer flags fn targets as maybe-uncallable.Arithmetic on builtin brands (Bug 25):
-*/%**unary-<>Number()now fold known-brand operands through ToPrimitive — Date → time value (new Date(0) - 1→-1exact,+→ string per the Date default-hint rule), boxednew Number(5)→ the wrapped primitive, RegExp/Map/Set/Error/URL → toString → numeric coercion (abstract-string operands coerce tonumber, wasunknown).Promise rejection channel (Bugs 36+37): the promise eff shape carries a
rejectedreason —Promise.reject(v)and executorreject(v)producepromise<never>(definite rejection),.catch/two-arg.thenreceive the actual reason (Promise.reject(1).catch(e => e)→promise<1>, no phantom unknown arm), and nullish handlers are Identity (p.then(null)passes the settle value through,p.catch(null)passes rejection through).L1 return-contract element enforcement (Bug 30): array contracts now check elements —
return [-1]againstarray(number().gt(0))reportsarray element [0] ⊭ …(precise index) instead of silently proving; abstract elements degrade tounproven-return, empty tuples stay vacuously proved.Expression-position
splice/copyWithinfold exactly ([1,2,3].splice(1,1,9)→[2]); arr-of-union signatures render with parens ((3 | 1 | 2)[], was the ambiguous3 | 1 | 2[]);BigInt(x)on abstract number/string operands records the nativeRangeError/SyntaxErrormay-throw;new URL(...).toJSON()folds href (wasunknown); rest parameters in signature symbolic execution bind an open array (sigLen(...r) => number, was the fixed-1-tuple error1);delete o?.ashort-circuits nullish receivers totrue(was an engine throw — the differential knownFalseThrows canary is removed). -
bf601e0: Fix class-A value-read/reflection bugs (3/9/31/32/41/43/49/54/56/57).
Value reads: abstract-string indexing
s[n]now yieldsstring | undefined(wasunknown); function value propertiesf.name/f.length/f.prototypeare decidable (declaration names and native arity plumbed through host-fnasAbsValand closureabsFunction; arrows foldprototype → undefined);Symbol.<well-known>constants fold to exact symbol literals with precise.description/String(sym)/===.Method value-read channel (Bugs 49+56, single mechanism): reading a prototype method as a value (
"ab".trim,(1).toFixed,Array.prototype.slice,Map.prototype.has, …) yields a first-class callable fn whose apply hook forwards borrowed invocations (v.call(recv, …)/v.apply/v.bind) back into the existing method dispatch —typeof X.prototype.mfolds"function"(was silentundefined/unknown+ false may-throw),Array.prototype.slice.call("abc")folds["a","b","c"],Number.prototype.toString.call(255)folds"255".Reflection mutators: the five
Reflect.set/deleteProperty/defineProperty/setPrototypeOf/preventExtensionsnow apply their state effect to the receiver (in-place slot write/delete, proto marking, ext-state) while keeping native boolean returns;Object.create(proto, descriptors)installs descriptors as own properties (open obj for object protos, null-proto preserved).Enumeration:
Object.create(<obj>)no longer poisons the keys family with a false may-throw (keys/values/entries fold[]);Object.keys/values/entriesclassify non-string primitives ([]) and builtin brands (boxed String →["0","1"], gOPN includeslength); accessor properties are visible toObject.entries/Object.values/Object.getOwnPropertyDescriptor(accessor descriptors{get,set,enumerable,configurable}) andJSON.stringifythrough a singlereadProperty[[Get]] entry point — getter thunks are invoked, the defineProperty+enumerable stringify variant loses its false may-throw, andfor (k in new String(…))no longer enumerateslength.
1.9.0
Minor Changes
- aeb6f7e: Add discriminated-union narrowing for
x.key === 'lit'guards (issue #126). In the arm where the equality fact holds (===true arm /!==false arm), a union parameter is shadow-rebound via the new$narrowMemberEqruntime helper to the subset of members whosekeydomain may equal the literal: arms pinned to a different literal, closed shapes without the key, and nullish-literal members are pruned (three-state classification:only/never/mayvia shape assignability plusimpliesover the slot pred, with a local literal-disequality rule for strings/booleans the prover does not cover). Kind-specific field reads stop recording falsecomputed member on nullish (union arm)may-throws. Recognizes strict equality only (===/!==, literal on either side, string/number/boolean literals, non-computed single-level member), composes across&&/||tests with the existing nullish/typeof guard channels, and applies to ternaries,ifstatements, the early-return promotion path, and optional-chain guards (node?.type === 'lit'also drops the null members). Dual polarity:!==early-returns prune the exactly-literal arm in the fall-through. Boundary (honest residual): a lenient catch-all arm likeshape({ type: string() })admits the discriminant literal, so it is conservatively kept in the fact arm and undeclared index-read fields on it still report one L2 — the parameter domain genuinely admits such values (TypeScript keeps the overlapping arm too and flags the property as missing).
1.8.0
Minor Changes
- 05c2c8c: Add
lazy(() => tpl)self-referential constraint-template builder for recursive shapes (issue #120). A sidecar can now declare recursive structures in one line —export const astNode = shape({ type: string(), object: lazy(() => astNode).optional() })— instead of hand-nesting finite levels. Consumers expand lazy templates under a fixed depth budget (LAZY_TEMPLATE_DEPTH = 3): entry param Abs renders budget-exhausted lazy fields as absent slots (matching manual finite templates, so guarded recursion cuts cleanly at the boundary),instantiateConstraint/instantiateOnTermdegrade to trivially-true predicates,constraintAdmitsNullish/throwConstraintToKinds/literalMeetsConstraintterminate cycles via thunk-identity seen-sets,assertImpliesuses a thunk-identity seen-set with per-path copy-on-branch copies (sibling sum/union arms each fully expand shared lazy members; genuine cycles truncate tounprovable, i.e. the conservativenudo:unproven-returnwarning rather than a false error),formatConstraintrenders two expanded levels plus…, andderefConstraintmemoizes one-level derefs by thunk identity.partial/pick/omit/andCnow deref lazy wrappers before their structure checks.lazyis sidecar-injected viaCONSTRAINT_BUILDERS; the directive grammar still rejects arrow functions, so@nudo:case-style use falls back tounknown(no security-surface change). - 33239da: Adopt declared contract faces at the call boundary (issue #123 fix B): when a callee declares param/return contracts (
*.nudo.jssidecarfn(…)binding or@nudo:contract), contracts stop being enforce-only and become a type face for callers — same-file and cross-module alike. At$call/$callNamed, params with no information (unconstrainedany/ non-litunknownargs) are bound to the declared faces (constraintToEntryAbs), so the callee body re-executes inside the contract domain instead of worst-caseany— the issue's levenshtein callers (levenshtein(a,b) <= 1and const/literal/var variants) no longer inherit the DP body'sToPrimitive of abstract relational operand (Symbol)may-throw; call sites passing already-informative args keep their own face (L1nudo:constraint-violatedat the scan remains the enforcement domain, arity is never extended). The call result is presented through the declared return face — the #102 DP-OOB marker arm (undefined) and widened members no longer leak to callers (probe(a, b) => number, not the inferred union), while scalar literals that satisfy the return constraint keep literal precision andnever/opaque (budget) results are never whitewashed. Return-constraint predicates flow to callers: a callee declarednumber().ge(0)makes caller-side bounds liked + 1 ≥ 1/100 - d ≤ 100(the issue's1 - d/max ≤ 1chain shape) provable. The callee's own check semantics are unchanged — its honestnudo:unproven-returnwarning and inferred signature (marker arm included) stay exactly as before. Faces are attached percheckSourcerun (bridge Abs fns for injected module tables via the dep's ambient sidecar; a scoped name resolver for same-file callees), so nothing is cached into long-lived session state.
Patch Changes
- 3588ddd: Extend guard narrowing to four previously-unhandled forms (issue #118 v3 / #120): (1) assignment-in-test guards —
while ((m = re.exec(content)))/if ((m = f()))now recognize the truthy test as proof that the assigned variable is non-nullish, so reads likem[2].trim()inside the loop body / cons arm no longer report falseentry-may-throw(computed member on nullish (union arm)); the while body is narrowed per iteration via an IIFE inside the body factory, and do-while narrows only the inner$whileSeqcopy (first run precedes any test evaluation). (2) member loose-equality guards —o.p == null/o.p != nullfalsy/truthy arms imply the slot is present and its value non-nullish (loose eq treats a missing slot'sundefinedas null), same facts as truthy-member guards; stricto.p !== nullstays un-narrowed as a documented boundary (undefinedremains possible). (3) multi-name composite guards —obj == null || node.property == nullfall-through now applies both independent facts in one arm (nullishGuardsOf+ multi-param shadow((a, b) => …)(rm a, rm b)); same-name facts merge grains, conflicting member keys keep the first (sound subset). Loop narrowing is skipped whenever the guard name is written inside the loop body (shadow params would swallow writes) or redeclared at body top level; test-side assignment is the canonical idiom and does not skip. - c647af8: Preserve
term/predwhen$copysnapshots obj-shaped Abs values.objOfbuilds values without a term slot, so the obj branch of$copy(unlike tuple/arr/sum/eff/brand) silently dropped them; args crossing the export bridge lost their terms, every level of a recursive call collapsed to the samecallBudgetKeyfingerprint, and the cycle guard cut parent/child frames as a false cycle — the truncatedunknown#opaqueresult then poisoned signatures and return-contract proofs (surfaced by issue #120's recursivelazytemplates).
1.7.10
Patch Changes
- 427da20: Fix false
entry-may-throwreports under three guard forms over optional slots / nullable params (issue #118): (1) member truthy guards —if (o.p)truthy arm /if (!o.p)fall-through now rebind the base to$removeMemberNullish($removeNullish(o), key), stripping nullish members of the slot value and theoptionalflag (the$getjoin withundefinedwas the FP source forproperty 'grade' on undefined); (2) composite mixed disjunction/conjunction —!doc || typeof doc !== 'object'fall-through now narrowsdoc(a single side that is itself a nullish guard suffices; both-sides-different-names stays conservatively un-narrowed); (3) optional-chain truthy guards —if (!files?.length)fall-through narrowsfilesbeforefor (const f of files)(no moreiteration over possibly non-iterable value). Single-level member paths only (computed keys and nestedo.p.qguards are not recognized); unguarded reads/iterations still report. - 427da20: Fix false
entry-may-throw("ToString coercion of abstract operand (Symbol)") on template interpolation ofoptional()/nullable()slots (issue #119):isMaybeBigintOperandno longer treatslit(null)/lit(undefined)sum members (shapeunknown+ literal term) as maybe-bigint/Symbol — ToString/ToNumber of nullish literals is total. Value domains unchanged; unconstrainedanyoperands and obj/fn/brand union arms still record may-throw.
1.7.9
Patch Changes
-
b14ac2d: fix(core): 无界 prim 契约的域隶属可证——裸 prim partial sum 臂不再误降 unproven-return(issue #115):
- 关系比较块(
x < yon narrowed string 字段)保持返回 sum 不合并时,Number(x) - Number(y)派生臂是 term-less partial prim number(parent sum conf=partial,isWidenedSumArm按 any 派生污染臂口径整臂跳过)→ 诚实的return number()契约被误降nudo:unproven-returnwarning(1.3.9 回归;1.3.6 该臂被 nullish 成员访问整臂丢弃故不可见)。 - 修法:
provesBarePrimDomain——契约是无界 prim(裸number()/string():prim + 无显式 pred + 无 int 义务 + 无结构面)时只问域隶属;裸 prim 臂的 partial conf 丢的是界/路径证据,不丢 prim 值域 → 臂 discharged,不降整体 unprovable。 - 口径不动:带界义务(gt/le/int…)对 term-less 臂仍 unprovable;错配 prim 的 disproved FP 保护(gold
nonEmpty面)与 OOB marker / nullish 显式化分支不变。
- 关系比较块(
1.7.8
Patch Changes
-
58b7938: fix(core): class extends Error 的 super(message) 不再静默 no-op——基类构造槽落地(#110)
constructClass对无注册 spec 的基类(env/宿主内建构造器)此前原样返回 thisVal,super(message)的 args 被丢弃:派生实例e.message折假精确undefined #exact(原生为 message 字符串)、e.name同为undefined #exact(原生经原型链为"Error")。#106 恢复class extends Error定义期干净后暴露面增大。修复:
!spec分支对 Error 家族(isErrorCtorName)按 errorBrandAbs 落 name/message 槽——与new Error(...)完全同口径:- lit message 保精确、ToString 折叠(number → "5"、缺省 → "")、AggregateError errors/message/cause 实参序、options.cause 透传;
- any message 构造记录 message-ToString may-throw(
new Error(Symbol())原生抛 TypeError,L2 同new Error(anyMsg)); - brand 名保持被构造实例(B extends A extends Error 中间用户类链不换名、方法派发不断链);name 槽是基类名(原生 Error.prototype.name 经原型链可见),子类自有 name 字段/赋值源序在 super 后照常覆盖;
- 用户同名类优先(getEvalClass 命中即不走内建分支);其余内建基类(Promise/Date/…)维持原样。
1.7.7
Patch Changes
-
d6fa067: fix(core): throws 域判定与值域计算粒度一致(Bug 2/3/23/25)—— L2 门(nudo:entry-may-throw)假阳性消除,守卫已证不抛的代码不再记 may-throw TypeError:
- Bug 2:早退提升路径(transpileFnBodyStmts)补守卫剪影——
if (p === null) return -1;后接非终结尾句(中间绑定/副作用语句)时,尾句在 fork 假值臂内执行,p以剪除 null 后的版本影子重绑,p.major不再撞未剪 null 臂记假 may-throw(与 IfStatement 路径同源;issue #97 五变体不回归)。 - Bug 3:nullish 守卫白名单扩展 + 剪除粒度——识别复合
p === null || p === undefined(否定臂剪 nullish)与typeof u === "undefined"(假值臂只剪 undefined,typeof null === "object"不误剪 null);严格p === null/p === undefined按字面量粒度剪(null === undefined为 false,严格等价只排除该字面量——同时修掉「假值臂连 undefined/null 一起剪」的既有假阴性);&&/||/三元表达式面同享。 - Bug 23:新增 typeof 类型守卫剪枝(typeGuardOf + $narrowTypeOf)——
typeof v === "string"真臂把 v 影子重绑为 union 中 typeof 匹配成员、假臂绑补集(不可判成员保守保留);守卫臂内+/关系/for-of/spread/解构/模板串拿到成员类型,七面(addStr/relStr/forOfStr/spreadStr/destrStr/tmplStr/addNum)零假 L2,typeof v === "number"臂不再产不可能的 string 值臂。 - Bug 25:isMaybeBigintOperand(arithmetic/surface 两处)对 sum 成员感知——纯 prim union(number|string)绝不可能是 Symbol/bigint,
v > "a"类关系运算不再记假 may-throw;obj/fn/brand/any 成员保持原子(对象经 @@toPrimitive 确可返 Symbol),unknown 豁免口径不变。
回归红线:真实可抛路径不剪(严格守卫假值臂的 undefined/null 成员保留并照常报 L2;any 入口守卫后仍诚实 may-throw;unknown 令牌口径不变);check-gold / check-recall-gold / check-real-packages 全绿。
- Bug 2:早退提升路径(transpileFnBodyStmts)补守卫剪影——
-
92e6a5f: fix(core,env): L2 entry-may-throw 假阳性两处(issue #105 / #106)——1.3.5 的 builtin throws 语义对齐(2e5aeb35)引入的回归面:
- #105 typeof 守卫后的 any 不再记假 may-throw:
$narrowTypeOf此前只剪 sum 成员,裸any(无约束入口参数)在守卫事实臂原样保留 →RegExp.exec/test(v)的 subject ToString 档位按 any 记 may-throw。修复:事实臂(keep=true)any 健全窄化为对应 prim(string/number/boolean/bigint/symbol,term/pred/conf 保留;补集臂与 object/function/undefined 不可表示、unknown fail-closed 令牌均保守保留)。npm-safeparseVersion(typeof v !== 'string'+if (!m) return null双守卫 + 捕获组读)恢复干净。无守卫的exec(any)仍如实报(原生exec(Symbol())抛 TypeError,与 check-gold 的 scale(x) 口径一致)。 - #106 env 声明构造器不再报 constructibility 假抛:env 的 Error 族声明为无名 envFn——
$new的按名派发(evalBuiltinNew → errorBrandAbs)拿不到名字,落到通用 fn 分支的 unknown-constructibility 门;$class的 extends 门同样只见 ctor:undefined,class ApiError extends Error定义期误报。修复:envFn支持ctorfacet 并给 relationFn 路径补name盖章;Error 族 / Date / Promise / URL / AbortController / EventEmitter / stream 族声明 ctor:true(Symbol 声明 ctor:false——原生非构造器,new Symbol()/extends Symbol仍定抛);$new的 ctor:true-无-impl 路径回落声明 returnType(保实例面精度,AbortController/EventEmitter 不丢方法槽)。new Error('lit')/new TypeError('lit')/new ApiError(...)/class extends Error在 env 下恢复干净;new Error(anyMsg)仍如实报 message ToString may-throw(node 实测new Error(Symbol())抛 TypeError,与无 env 宿主路径同口径)。
- #105 typeof 守卫后的 any 不再记假 may-throw:
1.7.6
Patch Changes
- 856d8bf: fix(core): SequenceExpression 发射统一括号包裹 —— 逗号序列裸发射
a, b在任何嵌套位都会撕裂宿主结构:对象字面量属性值/类计算键里后续项被解析成新属性的键 →new FunctionSyntaxError → 整文件 eval-incapable;数组元素位一项静默变多项(长度翻倍)。TS 降级#private产物[(_A = new WeakMap(), …, "k")]计算键正是该形态:yargs 全量命中 → 模块图逐依赖求值失败重试(失败不缓存)→ OSS bench yargs hub-edit 4.4x / check-all 2x 回归,CI OSS baseline gate 5 连红。括号在语句位/实参位均合法,统一包裹后语义不变(序列值 = 末项)。
1.7.5
Patch Changes
- 4c3fafd: fix(core): OOB marker 臂不再把返回契约判成 error(issue #102)—— 抽象下标读(循环建表后的
d[m][n])并入的oobUndefmarker(conf=partial 合成 undefined)是引擎精度产物而非用户域 undefined;postcondition 对该臂降级 unprovable(nudo:unproven-returnwarning,gate 不再变红),与 widened 污染臂同口径;契约显式承认 nullish(nullable(...)/union(..., lit(null)))时 marker 臂 discharged(多臂与单臂 proved 口径对称)。真实 nullish 返回臂仍照常nudo:constraint-violatederror;其余真实臂证据充分时仍 disproved。DP / 编辑距离 / 备忘录类「循环建表 + 按构造在界内读取 + number() 返回契约」函数恢复绿门(1.3.4 语义)。已知召回权衡:真实无约束下标越界返回(return a[i])从 error 降为 warning——与 #98 oobUndef 按类压制同族,理想收窄需循环上界×下标关系推理。
1.7.4
Patch Changes
- 0fd8e1a: fix(core): entry-may-throw 双误报修复(issue #97 / #98)——null 守卫后的对象 union 成员读不再报 may-throw(
p === null早退 / 内联三元 /!p/!== null正分支 /?. ??五形态;转译层守卫臂影子重绑$removeNullish,?.续体同构剪枝);循环构建二维数组的嵌套索引读(d[i-1][j])不再折 may-throw / never(非字面量下标键修复、oobUndef 越界标记、widenLoopJoin 循环 widen、.length非负 pred 使new Array(n)豁免 RangeError note、fill()默认窗口元素整体替换、Math min/max sum 实参逐臂判定)。契约版 levenshtein/DP 全绿;无契约 any 实参保持诚实 may-throw 政策不变。
1.7.3
Patch Changes
-
50e50f1: fix(core): analyze 模式顶层剥离(stripEffectfulTopLevel)改结构化——Babel 解析 transpile 产物、按顶层语句整条剥除,替代行级正则 +
endsWith(";")/括号计数启发式。修复三类实证误剥:① 多行语句回调体内行以;/}结尾提前终止跳过 → 语句尾悬空new FunctionSyntaxError(如顶层setTimeout(fn, 100),整模块 fail-closed);② 字符串/模板字面量里的未配对((如"fetch(")被计入$for/$fork括号平衡 → 连带误删后续顶层export function(导出静默 unknown);③ 列 0 的catch (头匹配「未知全局调用」正则 → 顶层 try/catch 一律被剥成悬空块。剥除口径零变更($callNamed未知全局、$for/$fork/$while*与源形态 if/for/while 剥;本地调用、for-of、赋值、$switch/$throw、try/catch、__nudo*簿记保留),35 例新旧差分语料 30 例字节级一致、5 例均为旧实现损坏样本;新增 run-strip-effectful.test.ts 差分护栏,eval-*(64 文件 657 用例)与 core algebra 全量(272 文件 3078 用例)绿。 -
50e50f1: fix(core): Math 原生折叠抛错不再静默拓宽为 number——min/max、round/floor/ceil/trunc、通用 impl 三处 catch 补
noteAbsTruncation(#math-fold-error,check 映射 info 级nudo:math-fold-error,不再误报 recursion-truncated),宿主篡改/环境分叉的Math.*精度损失可观测。leqAbspred 失败文案改用predToString渲染(pred ⊭ x > 5替代裸 op 名),nudo:assign-mismatchsuggestion 直接可读。内部:leq 比较辅助函数改精确CmpPred/Term类型(删除三处as never与弱结构签名,行为零变更);checkSource 消除 sidecar 场景对同一 source 的二次完整 parse(localNamedExports复用一次结果)。 -
50e50f1: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) -
50e50f1: fix(core): filter 元组投影保真 + assign 拓宽补全数组 sum(OSS semver L1 FP)
filter空元组结果从unknown[](无界长度)改为[];不确定谓词对 ≤3 元组 枚举精确子序列和(长度有界——filter 不增元素),更大元组保持无界 arr(sound 旧口径)widenForAssign补全数组 sum 分支:全 tuple/arr 成员的 sum 按 tuple 分支同口径 拓宽为单 arr(可变绑定持数组后赋任意数组是合法 JS);混入 obj/prim 的 sum 仍精确对账- 复合效果:循环 push-join 绑定(
[] | [unknown])重赋map(...).filter(...)不再 假报nudo:assign-mismatch(benchmark/oss 语料 semver/bin/semver.js L109,#91 循环 pack 健全化暴露的既有失真);元素改型等真违例仍报 - lsp:补全面放行 path-conf 元组(filter 子集和臂成员的 length 是诚实字面量), sum 臂 detail 渲染去重
1.7.2
Patch Changes
-
446914f: fix(core): analyze 模式顶层剥离(stripEffectfulTopLevel)改结构化——Babel 解析 transpile 产物、按顶层语句整条剥除,替代行级正则 +
endsWith(";")/括号计数启发式。修复三类实证误剥:① 多行语句回调体内行以;/}结尾提前终止跳过 → 语句尾悬空new FunctionSyntaxError(如顶层setTimeout(fn, 100),整模块 fail-closed);② 字符串/模板字面量里的未配对((如"fetch(")被计入$for/$fork括号平衡 → 连带误删后续顶层export function(导出静默 unknown);③ 列 0 的catch (头匹配「未知全局调用」正则 → 顶层 try/catch 一律被剥成悬空块。剥除口径零变更($callNamed未知全局、$for/$fork/$while*与源形态 if/for/while 剥;本地调用、for-of、赋值、$switch/$throw、try/catch、__nudo*簿记保留),35 例新旧差分语料 30 例字节级一致、5 例均为旧实现损坏样本;新增 run-strip-effectful.test.ts 差分护栏,eval-*(64 文件 657 用例)与 core algebra 全量(272 文件 3078 用例)绿。 -
446914f: fix(core): Math 原生折叠抛错不再静默拓宽为 number——min/max、round/floor/ceil/trunc、通用 impl 三处 catch 补
noteAbsTruncation(#math-fold-error,check 映射 info 级nudo:math-fold-error,不再误报 recursion-truncated),宿主篡改/环境分叉的Math.*精度损失可观测。leqAbspred 失败文案改用predToString渲染(pred ⊭ x > 5替代裸 op 名),nudo:assign-mismatchsuggestion 直接可读。内部:leq 比较辅助函数改精确CmpPred/Term类型(删除三处as never与弱结构签名,行为零变更);checkSource 消除 sidecar 场景对同一 source 的二次完整 parse(localNamedExports复用一次结果)。 -
a00bccc: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) -
39332ca: fix(core): filter 元组投影保真 + assign 拓宽补全数组 sum(OSS semver L1 FP)
filter空元组结果从unknown[](无界长度)改为[];不确定谓词对 ≤3 元组 枚举精确子序列和(长度有界——filter 不增元素),更大元组保持无界 arr(sound 旧口径)widenForAssign补全数组 sum 分支:全 tuple/arr 成员的 sum 按 tuple 分支同口径 拓宽为单 arr(可变绑定持数组后赋任意数组是合法 JS);混入 obj/prim 的 sum 仍精确对账- 复合效果:循环 push-join 绑定(
[] | [unknown])重赋map(...).filter(...)不再 假报nudo:assign-mismatch(benchmark/oss 语料 semver/bin/semver.js L109,#91 循环 pack 健全化暴露的既有失真);元素改型等真违例仍报 - lsp:补全面放行 path-conf 元组(filter 子集和臂成员的 length 是诚实字面量), sum 臂 detail 渲染去重
-
446914f: fix(core): simplifyTerm 的 x1 恒等式不再把 bigint 字面量折成 lit(NaN)(5n1 原生是混型 TypeError,保留原项交算术核 foldBigintBinOp 处理)
1.7.1
Patch Changes
- ef514a8: fix(core): handle fork-joined sum args in arithmetic, bounds, and non-NaN
1.7.0
Minor Changes
-
f6ec0e8: fix #76 (quickfix self-defeating
any()+ false-positive call-site errors):- service/body-read-types: collect full member-read paths (
node.loc.start.line), not just first-level keys. Dereferenced intermediate fields materialize as nested shapes (loc: shape({ start: shape({ line: any() }) })) instead ofany()— anany()slot value keeps its member reads counted as may-throw, so the generated contract could not clear the L2 it targeted (issue: 1/7 warnings cleared; now the nested-read cases clear too). Method accesses (.toLowerCase()) still type the field directly and stop the chain.BodyReadFieldgains optionalfields?: BodyReadField[];shapeDslFromFieldsrecurses. - core/scan:
anyactuals against a shape precondition are no longernudo:constraint-violatederrors — no info, don't guess, matching the scalar-pred channel ("any ≤ 任意目标") and the same function'sunknownhandling. Determined non-object and missing-field actuals still violate (controls pinned).
- service/body-read-types: collect full member-read paths (
1.6.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
1.5.0
Minor Changes
-
64ca356: feat: clamp bounds + scalar-over-sum + action-map quickfixes (#68 #69)
#68 inference
Math.min/Math.max/Math.round(and floor/ceil/trunc) propagate operand numeric bounds:max(0, min(100, n))derives[0, 100].- NaN is explicit (option 1): a possibly-NaN operand yields
NaN | number@bounds, so clamp contracts stay honest;if (Number.isNaN(n)) return …narrows the false arm (ne(n, NaN)) and the guarded clamp is provable. - Scalar return contracts now distribute over sum arms like shape/array
(
nullable(c)+ multi-returnnull | numberis provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings tounproven-returnwarnings instead of errors.
#69 DX
actionsForIssuekinds are materialized as LSP quickfixes with[fix]/[silence]/[review]/[adjust]/[scaffold]titles.nudo check --fix [--only <code>] [--write]reuses the same edit layer (default dry-run prints unified diffs).- Body-read fields auto-fill types from usage (
node.type === "x"→string(), arith →number(), no evidence →any()); never emit emptyshape({}). - L2
entry-may-throwsuggestions include a copyable sidecar clause.
1.4.0
Minor Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
1.3.1
Patch Changes
-
8df9215: fix(contract): array return contracts distribute over sum arms
assertImpliesdistributed shape contracts (constraint.fields) over the members of asumreturn value, but the array branch was reached with the sum still intact and rejected it outright:return shape sum ⊭ array(...)Any function built from the idiomatic "start empty, push conditionally" shape therefore reported a false
nudo:constraint-violated:export function pick(n) {const out = [];if (n > 0) out.push(n);return out; // [] | [n] ⊭ array(number().gt(0))}Each arm is an array on its own (
[]and[n]both satisfy the contract), so the sum is too. Array contracts are structural like shape contracts, so they now distribute over sum members the same way (any-derived members are still skipped, keeping the existing gold-FP protection). Non-array arms still report.Measured on a consumer project (npm-safe):
vetoFindings/decidereturn contracts went fromnudo:constraint-violatederrors to clean, with no other diagnostic movement.
1.3.0
Minor Changes
-
c717017: fix(dx): sidecar load failure reported once (#64) + contract/DX improvements
-
Sidecar load failure dedup (defect): a broken
*.nudo.jsno longer reports the samenudo:interface-loadonce per source export. Unrelated exports are filtered by the sidecar's export names before exec; module-level failures dedup by (path, reason) with one message and(affects N bindings)— wording no longer saysfor 'X'(reads like X itself is broken). -
L2 entry-may-throw actions: the most honest fix (sidecar
fn({ … })param contract) is now the first suggested action, ahead of@nudo:throws. -
Destructured param contracts render:
decide({ grade, findings })with a sidecar field contract shows{ grade, findings }: { grade: string, … }instead ofdecide(_p0: any). -
@nudo:budgetfunction-level budget knob:@nudo:budget forks=20000/calls=… depth=…raises the call/fork budget for that function's evaluation only (restored after). Truncation suggestions point at this knob instead of only globalmaxForks.
-
Patch Changes
-
6bc08c7: fix(env): env globals no longer shadow the host
undefined/NaN/InfinityrunTranspiledinjects every@nudo:envglobal as a module-scopeconst <name> = __nudoEnv["<name>"], which shadows the host global for the whole transpiled body.@nudojs/env/esdeclaresundefined: undef(), andweb/nodeimplyes— so anynudo.envdeclaration shadowedundefined:- the transpiler's own bare
undefinedtext (stmtmissingelsearm, implicit return) and$lit(undefined)received an Abs object; - effect: a conditional
returninside a loop joined tounknown, sofor (const s of list) { if (s === "high") return "l1"; } return "l0";folded tounknowninstead of"l0" | "l1"; NaNbound asprim.num()degraded0 === NaNfrom the definitefalseof native semantics toboolean.
Injection now skips
undefined/NaN/Infinity: the transpiler already hardcodes those identifiers as$lit(...), so the consts had no upside and only shadowed the host.Measured on a consumer project (npm-safe) with
nudo.env = ["es","node","web"]:nudo testwent 39/39 → 23 passed / 10 failed; with this fix it is 33 + 6 planned cases green again, plusopaque-result34 → 28,unknown-inference9 → 6,host-effect-blocked1 → 0 (env-declared builtins now fold instead of failing closed). - the transpiler's own bare
-
d925692: fix(core): transpile emissions no longer depend on host
undefined/NaN/Infinityidentifier identityFollow-up hardening after the env-injection skip fix:
- emit
$lit(void 0)/$lit(0/0)/$lit(1/0)instead of$lit(undefined)/$lit(NaN)/$lit(Infinity)so generated code never reads those identifiers; - omit
$fork's third argument when there is noelsearm (previously emitted a bareundefinedsentinel that broke if the name was shadowed); - share one
HOST_INTRINSIC_NAMEStable between transpile folding and the env inject skip set, so the two lists cannot drift; - free-assignment / fork-binding filters exclude all three intrinsics, not just
undefined.
- emit
1.2.2
Patch Changes
-
662aeb5: fix(env): env-declared
Number/Array/Promise/Dateno longer shadow away call/constructDeclaring
nudo.env(e.g."es") bound these globals as namespace-onlyobjAbsobjects. Once shadowed,Number(x)andnew Array(n)found nothing callable/constructible and degraded tounknown— the opposite of the host identity path (no env), which folds viaGLOBAL_FNS/$new'scls === Array.Dual-facet globals now model both faces (issue #58 option 1):
- Abs
fnmay carry staticslots(Number.isFinite,Array.isArray, …).$get/$inread them;typeofstays"function". $newdispatches Abs constructors by name throughevalBuiltinNew(Array/Date/Promise/Number/String/Boolean/Map/Set/Error), instead of only the Error/Promise special cases.- ES env declares
Number/Array/Promise/Dateas callableenvFnwith static slots and a ctorname, so call, construct, and statics all keep builtin semantics under env shadowing.
Number(s)folds tonumber,new Array(n)to a holey tuple, andNumber.isInteger/Array.isArraystay precise withnudo.envdeclared. - Abs
1.2.1
Patch Changes
-
7b8df37: fix(core): JS semantics — UpdateExpression, optional chain, enumerable, ToPropertyKey, copyWithin, split limit, isPrototypeOf
Seven evaluator/transpile correctness fixes (one commit per class):
x++/x--use ToNumeric ± 1 (bigint gets1n); postfix caches the old value (IEEE 2^53 safe)."5"++is6, not"51".- Optional chains short-circuit the remaining chain (
a?.b.c≡a == null ? undefined : a.b.c), includingo?.length/o?.[k]/g?.()/o.m?.(). RegExptest/execinside a chain still rebindlastIndex. for-in/Object.assignhonorenumerable(sharedenumOwnKeys/isEnumerableViewwithObject.keys).- ToPropertyKey stringifies
null/undefined/booleancomputed keys (o[null]≡o["null"]) for get/set/in/delete. copyWithinoverlap direction uses the resolved window (negative indices no longer flip).split(undefined, limit)uses ToUint32 (0.5/±Infinity→[];-1→2^32-1).Object.prototype.isPrototypeOf(Object.prototype)isfalse.
-
af8cb68: fix(core): JS semantics soundness — JSON space, bigint throws,
__proto__keysJSON.stringifyspace goes through to the host (min(10, ToIntegerOrInfinity));Infinity/(0,1)fractions no longer collapse to compact.- Mixed / invalid bigint ops hard-throw
TypeError/RangeErrorwhen the other operand is definitely non-bigint (number/bool/null/undefined). Abstract operands (any/obj/string-prim for+) no longer fold tonever—1n + sis string concat,1n + x(any) isbigint | stringwith soft may-throw. __proto__own keys survive (JSON.parse, computed literal, method named__proto__, spread/assign copy) viadefineProperty; non-computed{__proto__: v}is the ES prototype special form;Object.setPrototypeOfmissing/undefinedproto throws.
-
ff37d91: fix(core): string-face typing — concat/template with an
anyoperand, abstract.lengthTwo gaps that made provably-string expressions come out as
unknown(and raisednudo:unknown-inferenceon real projects):-
concatStringfell back tounknownwhenever one side had no string-parts view — includingany/unknown. But a string operand determines the result type:"s" + x,x + "s"and`${x}`are allstring(the ToString-throws-on-Symbol path is not modelled here). This contradicteddocs/design/limitations.md's mixed-+narrowing discipline (number ⊗ obj/unknown → number | string) —1 + xnarrowed,"s" + xdid not. Now a definitely-string side yieldsstring(pathconf); all-other cases keep the previousunknown. -
$lenhad no branch for an abstract string prim (template / concat result / abstractstring), so`${x}`.lengthandString(x).lengthfell to the trailingunknown. String length is alwaysnumber; literal strings still fold exactly.
Verified on a real project:
tarballUrl-shaped templates andprintScore/printPublishResult-shaped helpers stop reportingnudo:unknown-inference. -
1.2.0
Minor Changes
-
5ff4202: refactor!: rename B-path / BPath engine identifiers to eval / evaluator
The AST-walk interpreter is long gone, so the dual-engine campaign name "B-path" no longer means anything and forced a glossary entry just to explain itself. The single production evaluation engine is now simply the evaluator (mechanism: transpile →
new Functionon Abs).Breaking renames (no major bump — package has no external users yet):
Old New tryBPathCall/tryBPathCallFulltryEvalCall/tryEvalCallFulltryRunBPathtryRunEvalisBPathCapableisEvalCapableclearBPathCache/trimBPathCache/getBPathCacheSizeclearEvalCache/trimEvalCache/getEvalCacheSizeevictBPathCacheForFilesevictEvalCacheForFilescollectBPathDiagnostics/collectBPathReplacementscollectEvalDiagnostics/collectEvalReplacementsBPathRunResult/BPathDiagnostics/BPathFallback/ …EvalRunResult/EvalDiagnostics/EvalFallback/ …BCallRecord/setBCallCollector/getBCallCollectorEvalCallRecord/setEvalCallCollector/getEvalCallCollectornoteBPathFallback/setBPathFallbackCollectornoteEvalFallback/setEvalFallbackCollectorMAX_B_CALL_DEPTH/MAX_B_TOTAL_CALLS/MAX_B_TOTAL_FORKSMAX_EVAL_CALL_DEPTH/MAX_EVAL_TOTAL_CALLS/MAX_EVAL_TOTAL_FORKSmaxBRuns(sessionCache)maxEvalRunsNUDO_CACHE_MAX_BRUNSNUDO_CACHE_MAX_EVALRUNSSource files
bpath-run.ts/bpath-diagnostics.ts/bpath-*.test.tsare noweval-run.ts/eval-diagnostics.ts/eval-*.test.ts. Docs no longer introduce a "B-path" term or explain why the engine is called B. Historical CHANGELOG / releases-history keep the old name.
Patch Changes
-
5ff4202: fix(core): more JS semantics soundness — Array.of / .at() / postfix ++-- / ToPrimitive
Array.ofpacks arguments into a tuple, not an array of the first element.at()honors ToIntegerOrInfinity (string.at + array.at index)- postfix
++/--writes back inside the expression +honors ToPrimitive/ToString for arrays, objects, undefined- drop dead duplicate
case "promise"in checkNode
1.1.4
Patch Changes
-
634932f: fix(core): Array.prototype method reads no longer hijack
$invoke$getreturnedabsFunction([], { body: noBody })for Array.prototype methods (concat/sort/…).$invoketreated that hollow impl as an object method and$called it, foldinga.concat(b)to exactundefinedandarr.sort()tonever/TypeError — false precision vs the previous conservativeunknown(benchmark gate:array-03/complex-01regressedunknown → mismatch).First-class reads still expose a function-shaped Abs (
typeof a.push === "function"), but without a callable impl so method calls fall through toinvokeArrMethod/ conservativeunknown.
1.1.3
Patch Changes
-
3bf9997: fix(core): JS semantics soundness — ToString args, compare undefined, NaN identity, JSON.stringify
B-path Abs folding corrections so concrete results match native JS:
- string/parse methods (
startsWith/endsWith/includes/split/replace/indexOf/parseInt/parseFloat) honor ToString and missing-arg defaults;splitkeeps the ES special case that an undefined separator returns[ToString(O)]without splitting - relational compare of
lit(undefined)folds via ToNumber (all relations false) - same-var
===is not exacttruewhen the value may be NaN JSON.stringifyof top-level function/symbol returns the JSundefinedvalue- NaN literal identity uses SameValue (assignment/
leq), not=== - drop unsound
x*0=0/x+0=xalgebra identities (NaN/-0/string domain) n % 0folds to NaN;x % kbounds only for finite dividends0nis falsy;Number.is*fold non-number lits to false; globalisNaNcoerces- string index methods (
charAt/slice/…) honor ToNumber and default args - unary minus and
parseInt/parseFloathonor ToNumber/ToInt32 - Math.* folds ToNumber lits (own numeric methods only — no
constructor/toString) - tuple index reads use canonical array index (
a["0"] === a[0]) - call-spread placeholder is
unknown, notundefinedlit
fix(parser): directive scanners (splitTopLevelArgs/ colon / arrow / balanced parens) respect string literals.Review follow-ups folded in:
split(undefined)special case,indexOfreturns number shape on abstract receivers, Math method allowlist. - string/parse methods (
1.1.2
Patch Changes
-
c1f3e93: fix(core): never-execute host side-effect guard also covers
new$newwas not identity-guarded against the host side-effect list (WebSocket/XMLHttpRequest/EventSource), sonew WebSocket(url)only avoided real network I/O by falling through to an empty brand — a coincidence, not an explicit block. Both$callNamedand$newnow shareblockHostSideEffect: identity match fails closed tounknown#opaqueand reportsnudo:host-effect-blocked.
1.1.1
Patch Changes
-
86d1f87: fix(core): never execute host side-effect globals in the B path
$callNamedexecuted any host function it could not fold, so a module callingfetch(url)made the analyzer issue a real network request with Abs arguments ([object Object]):nudo check/nudo testdied withTypeError: Failed to parse URL from [object Object](ERR_INVALID_URL) via an unhandled rejection.setTimeout/setIntervalscheduled real timers the same way.fetch/XMLHttpRequest/WebSocket/EventSource/ timers /queueMicrotask/requestAnimationFrame/requestIdleCallbackare now identity-guarded (aliases included) and fail closed tounknown#opaque, reported through a dedicatednudo:host-effect-blocked(info) diagnostic — notnudo:recursion-truncated. Other host functions still evaluate for real. -
892899d: fix(core): RegExp.exec precision with non-literal subject + nullish return prefilter
Two return-path defects that both show up in the classic "parse and return null on no-match" shape:
-
execRegexBranddocumented "exec → null|tuple 的保守并" for a subject that is not a string literal but returnedundefinedinstead. The caller then fell through to the "method not found" path and the result became the Absundefined:typeof mfolded to the literal"undefined",m === nullfolded tofalse, capture groups stayed unknown, andNumber(m[1])-style returns collapsed.execnow returns the conservativenull | array(string|undefined). -
checkReturnConstraintreported anullreturn as violating ashape({...})contract. litnull/undefinedcannot satisfy any constraint, so reporting it is a false positive (return nullmeans "no value", not "wrong value"). Nullish evidence is now prefiltered there too, matching the parameter-side prefilter (scan-injected-domain, T4 caveat).
Real-world case: a
parseVersion(v)that returnsnullfor unparsable input and{ major: Number(m[1]), … }otherwise — with #40's sum distribution the remaining report was the nullish member alone. -
-
faccd76: fix(check): return-shape contract distributes over branch sums
checkReturnConstraintonly acceptedret.shape.k === "obj", so a return value that is a sum (e.g.if (flag) obj.extra = x; return obj;— the two branch shapes join into a sum when their key sets differ) was reported asnudo:constraint-violatedeven when every member satisfied the declaredshape({...})contract. Real-world hit: sidecarfn({...}, shape({...}))returns with a conditional field.Shape contracts now recurse into sum members (each member must satisfy the contract, issues deduped). Scalar contracts (prim / numeric bounds / domain) still do not distribute: sum members can be operator-derived unions from unconstrained operands (
any + any→number | string) and reporting those is a false positive per the check-gold precision discipline.
3.0.0-beta.0
Major Changes
-
22baf33: feat!: product CLI face only — remove deprecated verbs/aliases; L2 entry may-throw
- BREAKING — deleted with no compatibility layer: verbs
infer/types/interface/refine/generate/emit/guard/doctor/ top-levelwatch/harvest; flags--callsites,--output,--format zod,--dts,--emit-cases; APIabsToZodSchema;InferJson/serializeInferJson→CaseJson/serializeCaseJson; LSP agent toolsnudo.infer/nudo.interface*and aliases →nudo.test/nudo.contract*; config keypackage.json#nudo.interface.*→package.json#nudo.contract.*. Root scriptsinfer/types/interfaceremoved. - Primary verbs:
check/test/contract/export/health/env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell@nudojs/nudojsfollows@nudojs/climajors. - L2: undigested may-throw on entry/export functions is
nudo:entry-may-throw(default error). Configure with--ignore-throws/--entry-throwsorpackage.json#nudo.check.{ignoreThrows,entryThrows}. - Nested try: soft may-throw from an inner try re-homes to the enclosing try frame. Catch rethrow does not digest soft effects.
checkalways prints signatures on success; unconstrained entry params display asany(trueunknown= inference failure +nudo:unknown-inference).testprints every case including syntheticcall@/entry@; only declared@nudo:caseexpectations affect exit.--freeze[=update]solidifies witnesses.- Flags:
--from,export --format dts|guard|schema|standard|all(--dialect zodfor schema),export --out.--jsoncannot combine with--abs. - Design docs consolidated: truth sources
design-kernel-merge.md+design-cli-semantics.md; domain designs compressed to status summaries. - Breaking for CI scripts that still call old verbs or read old config keys.
- BREAKING — deleted with no compatibility layer: verbs
-
0e1432a: feat!: source contract directive is
@nudo:contractonly@nudo:refineand@nudo:interfaceare deleted with no alias layer. The product word is contract end to end (sidecar*.nudo.js,@nudo:contract,nudo contract,package.json#nudo.contract.*).- BREAKING: replace every
@nudo:refine/@nudo:interfacewith@nudo:contract(including@nudo:contract return <constraint>). Grammar is unchanged:@nudo:contract <param> <constraint>. - Constraints still enter Abs as Preds and participate in algebra (
x>0⇒x+1>1) — this is not a call-site validation gate. - Diagnostic codes
nudo:interface-*are unchanged in this release. - Chinese product copy uses 契约, not 精化.
- BREAKING: replace every
-
3c3f9d2: Reduce
@nudojs/corepublic export surface (breaking).Engine machinery is no longer re-exported from
.or./exec. Hosts that need leak/call-budget/hash/derivation/inlay/template/language/scan extras or may-throw · member-diag collectors import@nudojs/core/internalinstead.@nudojs/core(.) keeps the product face only (Abs, check, format, projections, contract builders, B-path$opruntime + transpile).- New subpath
@nudojs/core/internal(minor-escape hatch; no SemVer promise). packages/core/PUBLIC_API.md+public-api.snapshot.jsonupdated; freeze test also asserts product face does not leak internal names.
Product CLI faces (
check/test/contract/export/health) are unchanged.@nudojs/service/@nudojs/lspalready retargeted.
Minor Changes
-
279d73a: fix review gaps on the B-path migration (PR #34 follow-up):
- inject pipeline:
CheckOptions.injectis now threaded into generalize, L2 throws, the record channel, and drift recompute (previously CLI computed mocks/env/replacements but onlymodulesreached core;@nudo:mock/env/replacesources were fail-closedunknown#opaqueundercheckSource). Memo keys use inject content fingerprint (stable across CLI's per-call object allocation).mode: "analyze"always wins;modulesprefersopts.modulestheninject.modules. - L2 class / CJS methods: explicit
throwon class static methods and CJS object methods is no longer hard-coded asthrows: never— NudoThrow/ReferenceError map to throws Abs (same ascallTranspiledExportFull).$callrecords throw exits before returningnever. L2 evaluation now seedsphifromcheckSource. freeIdentifiers: lexical scopes (nested params no longer pollute outer free set); non-computedObjectMethod/ClassMethodkeys are not free refs.callBudgetKey: single defensive implementation for non-Abs args (B-run JS function args).$callcompiled-body path now usesenterCall/exitCall(same budget as apply). Budget keys use fn object identity (stableCallId) instead ofanon#N(false cycles across same-arity functions).MAX_TOTAL_CALLSunified at 20k.- method early-return (correctness):
ObjectMethod/ClassMethod/ propertyFunctionExpressionbodies now go throughtranspileFnBodyStmts(early-return lift) + implicit return — previouslyif (c) return X; return Ysilently always returnedY(false precision vs native). - collectors:
setBCallCollector/setBAssignCollector/setMemberDiagCollector/setAbsTruncationCollectorreturn the previous collector; nested call sites save/restore instead of nulling.
User-visible notes:
- Sources with
@nudo:mock/@nudo:env/@nudo:replaceget real B evaluation undernudo check(CLI already built the inject pack). - Class static / CJS object methods with explicit throws now report
entry-may-throw(L2 no longer misses them). - Object/class methods with early-return branches now fold the same values as native JS (differential batch19).
interface-derivationclass-method roots stay fail-closed (no call-chain derivation) — intentional after ast-eval removal.
- inject pipeline:
Patch Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
2.1.0
Minor Changes
-
69ebbf6: Align product surface with interface-first design:
@nudo:caseis debug /nudo testonly, and theT.*directive grammar is removed.- Directive type expressions accept constraint builders (
number(),lit(),shape(),union(),array(),any(), …) and concrete literals only. BareT.*parses as unknown;parseTypeValueExpris no longer exported — useparseCaseArgExpr. serializeCaseArg/--emit-casesemit builders (number(),union(…)) instead ofT.*.- LSP
typeExprToDirectiveemits builders (number(),union(…),any()). - CLI
inferreports call-site facts (call@L…) anddebug "name"witnesses withObserved:joins — notCase "…"/Combined:as the type product. Contracts stay on*.nudo.js/@nudo:refine. - Constraint builders accept concrete nested literals so directive grammar round-trips.
- Directive type expressions accept constraint builders (
2.0.1
Patch Changes
-
9731238: BREAKING (behavior)
@nudojs/service: handwritten@nudojs/envnow wins over harvest / module-graph modules on overlapping module keys and export names (mergeHarvestUnderEnv). This is the documented B8 priority — harvest only fills missing slots — but analysis results on projects that relied on harvest overwriting a handwritten env export will change.Migration: remove or update the conflicting handwritten
@nudojs/envslot if you needed harvest's version; otherwise no code change. Conflicts emit anudo:env-harvest-conflictwarning listing overwritten module/export names.Also in this service major (additive public surface, riding the required major for the priority change):
- Public harvest helpers:
mergeHarvestUnderEnv(optional per-callonConflict),setEnvHarvestConflictCollector(returns previous; save/restore for nested analysis),getEnvHarvestConflictCollector,clearNodeHarvestCache,getNodeHarvestCacheSize,isHarvestNodeDisabled,HARVEST_NODE_DEFAULT_*. Negative harvest outcomes (not-found/no-dts/failed) are cached in-process;NUDO_HARVEST_NODE=offstays explicit and uncached.clearNodeHarvestCache()also dropsnot-foundmisses so a later@types/nodeinstall is visible in-process.nudo:env-harvest-conflictwarnings point at the conflicting import specifier when found (file-levelline 0otherwise). @nudojs/env(minor):events/stream/querystring; high-frequencyutilslots; Promise APIs only underfs.promises/node:fs/promises(callback-stylefs.readFileetc. no longer pretend to return Promise). Optional Node params (path.basenameext,url.URLbase) keep typed labels (ext?: string) but are not required slots —requiredFnArityskips?/....@nudojs/core(patch):formatShaperenders fn rest labels (...paths) and optional labels (options?) as...name: T/name?: T.leqAbsfn arity uses required slots only (requiredFnArityskips...rest/name?): src is assignable to tgt iffsrc.required ≤ tgt.required(TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). PairwiseparamTypescontravariance is unchanged.@nudojs/lsp(patch): freeze inventory inpublic-api.ts(also exported as@nudojs/lsp/public-api); agent slash requests register fromNUDO_AGENT_TOOL_NAMES;selectCase/getActiveCasesare editor executeCommand + slash-only (not dot-form custom requests).
Migration for env consumers who need bit-stable hover/format strings: pin
@nudojs/env~0.3.0after the next release, and prefer leaf-clean coverage counts (empty{ }shapes are not leaf-clean) over raw resolved ratios. - Public harvest helpers:
2.0.0
Major Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
1.0.1
Patch Changes
-
61b8a6c: Fix soundness issues in Abs evaluation:
parseInthonors hex/octal/binary prefixes and explicit radix (no forced radix 10)Array.isArrayreturns unknown boolean for any/unknown/sum, and sees through brandDate.now()is an unknown number, not a folded wall-clock timestamp- strict numeric bounds win over non-strict at equal value (order-independent)
boundsSatisfiableno longer downgrades strict bounds via redundant ge/le- structural
absShapeKeystops join/dedup collapsing distinct arrays, overloads, brands denoteGuardrenders NaN/±Infinity correctlyString.splitwith non-literal separator returnsarr<string>, not a 1-tuple
1.0.0
Major Changes
-
0fd253f: BREAKING:
@nudojs/cli/evaluator子路径已移除。求值器 API 迁至@nudojs/service/evaluator(消除 cli↔service 工作区环)。迁移:import { … } from "@nudojs/cli/evaluator"→import { … } from "@nudojs/service/evaluator"。架构与正确性批次:
正确性修复(core)
slots[key]原型链泄漏:__proto__/toString/valueOf等键命中 Object.prototype 导致引擎崩溃或误报——新增getSlot守卫并接入 projectBrand / 静态与计算成员访问 / leq / check 五处读取点(eventemitter3 真实包上曾崩溃)Array.from语义修正:与Array.of混用导致Array.from(new Set(arr))误报Set[];现按元素分布(tuple→ 元素 join、string→string[]),未建模可迭代物诚实返回 unknown- 模板
endsWith不健全判定修正:误报 false 的分支改为共享的健全decideEndsWith nudo:assign-mismatch精度:分支/循环体内的可变绑定重赋值(特性检测模式)不再误报;无条件标量改型仍报(金标行为保持)nudo:arg-structure精度:x && x.__esModule && x.default守卫后的成员访问不再计为必填 slot
结构拆分(无行为变化)
- check.ts 2024→748 行:源码级调用图侦察拆至 algebra/scan.ts;AstEnv 类型下沉 ast-env.ts(消 5 处巨石 type-import 环)
- evaluator.ts 5164→4058 行:内置方法语义迁至 builtins/builtin-methods.ts;analyzer.ts LSP 表面拆至 service/lsp-surface.ts
- 模板字符串语义归一:refinements/template.ts 七处重复实现改为委托 algebra/template.ts(单一真理源)
- 容器策略单源:ast-eval 与 B 路径 runtime 共享 containers.ts(>8 元素字面量降级策略一致,B 路径 $concat 修正嵌套近似)
- 求值器域从 @nudojs/cli 迁至 @nudojs/service/evaluator(消除 cli↔service 工作区环;
@nudojs/cli/evaluator子路径移除,改用@nudojs/service/evaluator) - 真实包门禁加固:扫描失败/0 文件即红,不再静默 skip;fixture 包显式声明为 core devDependencies
Minor Changes
-
0f0b7d5: Feature: Interface 分层推导 Phase 1(design-refine-derivation.md)
- 侧车同名自动绑定:
foo.nudo.js导出绑定foo.js本地 named export;手写 >@generated> 隐式合并序 - 约束代数:
lit/union/fn/shift/and/partial/pick/omit - Abs→ 契约投影与字面量域隶属(domain-membership)
- 新诊断:
nudo:interface-drift/interface-domain-exceeds/interface-conflict/interface-cycle/interface-load/interface-name-clash - CLI:
nudo interface(别名refine)分层打印;--emit/--fn/--all/--dry-run/--exit-on-diff/--callsites;nudo check --callsites - 配置:
package.json#nudo.interface.autoBind(默认 true;node_modules 永不 ambient 加载) - LSP:CodeLens interface 默认层 + persist/update;agent 工具
nudo.interface/nudo.interface.emit(emit 路径限制在项目根内) - 新薄壳包
nudo(bin委托@nudojs/cli)
- 侧车同名自动绑定:
Patch Changes
-
a2aac9e: Final review pass on feat/interface Phase 1:
- LSP emit bound live:
handleInterfaceEmitnow passesagentToolDepssoworkspaceRootsreachassertEmitTargetAllowed(was dead in production). - Emit fail-closed: empty
workspaceRootsrejects; no ancestor-package.jsonauthorization fallback;realpathblocks symlink escape; refuse writes undernode_modules. - autoBind kill-switch complete: threaded through scan
generalizeFromAst/ same-fileeiOpts; emptyfromFileno longer ambient-binds.nudo.js. - Conflict skip: conflicted params no longer also emit call-site
constraint-violated; detect eq/eq and eq/bound unsat. - Return contracts: string length bounds (
string().min/max) enforced via domain membership. - Perf/stability: file-local
effectiveInterfacememo in check;take*Sinceon memo hit/miss (no LSP diag theft);shiftrejects non-finite offsets;@generatedmarker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
- LSP emit bound live:
-
de47d84: Review fixes on feat/interface Phase 1:
- autoBind kill-switch: analyzer's cross-file
nudo:interface-domain-exceedspath now readspackage.json#nudo.interface.autoBind(was silently ambient-loading sidecars whenautoBind: false). nudo check --callsites: inject usage-site call records so CI gate can surfacenudo:interface-domain-exceeds(previously only reachable via analyze/interface paths).- Sidecar auto-bind coverage:
localNamedExportsaccepts localexport { x }/export { local as exported }list form (was declaration-only; silent miss for common style). - Directory targets:
isNudoTargetPathexcludes*.nudo.js/*.nudo.tsso check/infer/doctor no longer treat contract modules as source. - VS Code client: documentSelector includes TypeScript; file watcher covers
**/*.{js,mjs,ts}(includes.nudo.tssidecars). - LSP emit: failed
interfaceEmitno longer claims "sidecar written" and skips the invalidation path. - UX: first
--emitwith empty default targets prints a--fn/--alltip;--fn/--allwithout--emitwarn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
- autoBind kill-switch: analyzer's cross-file
-
78f6752: Fix hover, case switching, and NaN folding in Zed-style clients.
const n = double(21)reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.- Relational compare folds mixed concrete lits (
"a" > 3→ false), soif (x > 3)does not join both branches for NaN inputs. joinValuesusesObject.issojoin(NaN, NaN)staysNaN(NaN === NaNis false).workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]).- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes. - Param inlay no longer invents
where x > 3fromif (x > 3) return x— only explicit@nudo:refinecontracts show as preconditions. - Return inlay is a path summary with source param names:
x + 1,x | x * 2(not the refinednumber where x>3 | string | …dump). - Number range narrowing uses exclusive bounds (
> 3, not integer-style>= 4). - Concrete
iftests no longer narrow the tested value into a range (44 > 3keepsxas44). - True branch of
x > kon unknown refines tonumber>… | string(JS ToNumber space). flattenSumkeys prim members by term/pred sonumber=A1>3andnumber=A1*2stay distinct paths.
0.4.0
Minor Changes
-
1d6bb01: 修复抽象执行器的多处精度与门禁缺陷(dogfooding 回归全绿):
- 结构门禁:
@nudo:refine在export function/export const/export default/async声明上被静默丢弃(refine.ts 的声明正则只匹配裸function)——现在导出函数上的参数 refine 真实生效,string()原语约束能拦截first(42)这类调用(退出码 1) - 转译执行(exec/transpile.ts 等):解构形参绑定、
+=等复合赋值、Math.*/Number.isNaN命名空间调用、正则字面量.exec捕获组、可选链真值判断、i++、成员/索引写回、三元表达式、new Array().fill、字符串下标/长度——此前均丢失精确值(case 求值为 unknown),现在@nudo:case ... => expected在这些体上可精确断言(含 OSA 编辑距离 DP 矩阵、semver 比较链) - 早返回折叠:
if (c) return X;语句级$fork的返回值被静默丢弃导致整函数回退到最后一条 return——改为位置感知提升(后续语句整体进 else 分支),join语义与 JS 控制流一致 - bridge:
null字面量可投影为T.literal(null),=> null期望成立
- 结构门禁:
Patch Changes
-
1d233a7: Fix hover and CodeLens case switching in Zed-style clients, and fold JS ToNumber for
- * / %.const n = double(21)now reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]), not only the agent object form.- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes, so selecting a case actually changes the shown types.
0.3.1
Patch Changes
- 21427eb: Fix directive-case args lost in early-return branches: fold
if (c) return X; …tailintoreturn $forkin B-path transpile, and join partial-return fall-through in ASTevalBlock.@nudo:case "A" (92)on a graded if now yields"A";nudo testexpected cases pass; doctor-emittedcall@solidifies correctly. - df1726c: Make
@nudo:envactually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path$invokeimplements string methods and filters union members, andcollectAbsCallRecordsmerges env modules so call@ cases no longer overwrite correct B-path results. - bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - 8d85d99: Fix refine template gate for array()/string() and stop body method calls from inventing object shapes: typeof preds are checked at call sites, refine contracts take priority over structural inference, method names (
p.some/p.replace) are no longer required data fields, array() constraints produce arr entry Abs, and{...base}call-site args resolve file-level bindings.
0.3.0
Minor Changes
-
5786fa5: Promote the B-path (transpile + in-process Abs runtime) to the primary evaluation path for capable sources.
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
export *, require, cycle/depth/missing guards, and env modules (path/node:pathetc.). - Diagnostics,
@nudo:env/ mock injection,call@/entry@provenance, method-missing, unknown-recv, generators, classes, async/await, optional chaining, and destructuring run through B. - When B hosts a file,
evaluateProgramis skipped so TypeValue no longer double-reports. - CLI
check/types/testaccept directories; check uses an Abs-only gate. - LSP hover /
getTypeAtPositionon capable files read the Abs node table;*.nudo.jsedits evict L0 and recheck open parents. - Public core surface now re-exports the algebra API (
Abs, check, generalize, exec, bridge,parseSource,stripTypes).
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
-
5786fa5: Speed up repeated analysis with layered memos and tighter cache contracts.
- Shared parse/AST LRU,
generalizeFromAstL0–L3 (instantiate, α-equivalence, dep fingerprint + LRU), Abs module cache, and session-wide memos with an incremental after-edit path. - Host cache-eviction contract, AST/function-fingerprint memory caps, conservative call-scan depth cap, and fail-open truncated dependency fingerprints.
- Fix session-memo staleness and identity holes so after-edit results stay correct.
- Shared parse/AST LRU,
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version
0.1.0
Minor Changes
- Conceptual design and basic implementation.
@nudojs/service 1.12.3
1.12.3
Patch Changes
-
795e322: Close the 34 bugs from the ABS-15 audit, grouped by root cause rather than patched one at a time.
check— one judgment per decision, so the faces cannot disagree:- a
.tsconstructor annotation (including parameter properties) is now the instance field's domain, soconstructor(private size: number)+area() { return this.size * this.size }reportsnumberinstead of anany-arithmeticnudo:entry-may-throwerror while the dts face already saidnumber; - definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero,
inon a primitive right-hand side, and calling a member an object literal does not have; - the call-site local binding table records every declaration shape (parameters,
catch,for-of/in,let/var, destructuring) as an explicit "no information" entry, so shadowing no longer reads the module-levelconst(false red) and destructured declarations reach the obligation check (false green); - a classic
for (const i = 0; …; i++)head is aconstagain, so the always-throwing step is reported instead of staying green; nudo:capability-deniedjoins the check-face diagnostic whitelist, sonudo checkcan report the cause ofunknownlikenudo test— gated on the report actually showing an inference failure (nudo:unknown-inference), so a plainmodule.exports = …file does not grow a warning about themoduleglobal while the same exports written asexports.xreport nothing.- cross-file evidence from
--fromnow resolves the default export name on both sides, so a renamed default import,import { default as g }andns.default(...)are no longer silently dropped.
nudo export— the publish gate is a semantic judgment (degraded evidence on the published surface AND a declared contract) instead of a three-code whitelist, with declaration truth taken fromeffectiveContract's own resolution. Contract-face diagnostics always block; general degradation (nudo:internal/nudo:unknown-inference) blocks only when it is attributed to an entry that declared a contract (or carries no function, i.e. is module-level). Compatibility: a module whose contract fails to parse (nudo:contract-syntax) now blocks the export (exit 1, no artifacts, diagnostics surfaced) instead of publishing an "accepts everything" validator with exit 0; unannotated modules — and unannotated sibling entries — keep publishing and only see the degradation surfaced.dts projection — one resolvability predicate for type names (TS tokens, runtime globals, local classes, mirrored
interface/type, imported names) plus the missing branches it exposed:export =for single-value CJS modules, member-wise types forexport default {…}and arrays, real re-export statements for imported bindings,extends/type-parameter clauses on namespace members, and destructured parameters that render as a pattern the source can actually write. Compatibility:<fn>Inputkeys a destructured parameter by its field names rather than the internal_p0placeholder, which is not a public name and made the published validator reject the only legal call shape. Two boundaries are pinned: a module that exports a type (export interface/export type) alongsidemodule.exports = valuekeeps the named-export projection (TS forbidsexport =next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than onereturnprojectsunknowninstead of the first return's type (a single-return pick would be narrower than the runtime value).LSP — completion decides the lexical context with a per-character scanner (line and block comments, quotes, templates with
${}nesting, regex bodies and character classes), so a continuation line inside a multi-line template or comment no longer offers rewrites of the literal; member completion merges the instance/static class member table from core's single class-body scan.The
checkentry census behind these runs on the semantic binding index (ADR 0001 stage 1), and stage 1 slice 4.3 replaces the publish gate's shadow comparison with the semantic verdict it was measuring. The public.export surface is unchanged. - a
-
161d156: Switch the
checkentry census to the semantic binding index by default (ADR 0001 stage 1, slice 3). This closes the audit's false-green export shapes: destructured exports, default object literals, anonymous default classes, CJS / ESM class expressions are now real entries. Two index-precision fixes land with it: getters / setters are no longer treated as callable entries, and nested function declarations are no longer mistaken for module-level entries (previously produced falsenudo:opaque-result). The legacy census remains reachable via an internal fallback switch, and the index-face state is part of the check memo and service file/function cache keys so flipping it cannot replay stale results. The public.export surface is unchanged. Stage 1 slice 4.1 adds an internal, off-by-default publish-gate shadow comparison between the existing diagnostic-code whitelist and the typedEvidenceverdict; it only records divergences and does not change any export decision. Stage 1 slice 4.2 switches only the diagnostic surface:nudo exportnow prints degraded evidence codes (nudo:internal,nudo:unknown-inference, …) instead of silently dropping them; blocking and exit codes still followEXPORT_BLOCKING_CODES, so no export decision changes. -
Updated dependencies [795e322]
-
Updated dependencies [161d156]
- @nudojs/core@1.20.1
- @nudojs/env@0.5.11
- @nudojs/harvester@0.6.3
- @nudojs/parser@1.5.11
Version history (64)
1.12.2
Patch Changes
-
190761e: Propagate the source filename into parse-mode selection for pure-JS paths.
parseSourcealready skips the strip-types pass for.js/.mjs/.cjs/.jsx(structurally a no-op there), but service / transpile / module-graph / fingerprint / directive-scan call sites omitted the filename, so JS sources were parsed in ts mode and paid two extra full-AST walks. ThreadingfilenamefromanalyzeFile,transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors andlocalNamedExportsdrops a 9.14 MB self-contained JS file from 20,755ms to 14,594ms (-29.7%); the remaining strip-types share in the profile is ~2% (checkSourcepath 1.7%).兼容性:解析模式由文件扩展名决定(缺省仍为 ts 模式,未知扩展名行为不变);
.js里的 TS-only 语法仍是 syntax-error(Bug 114 / Bug 451 口径不变)。 -
Updated dependencies [c93a32d]
-
Updated dependencies [190761e]
-
Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
- @nudojs/parser@1.5.10
- @nudojs/env@0.5.10
- @nudojs/harvester@0.6.2
1.12.1
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
- @nudojs/env@0.5.9
- @nudojs/harvester@0.6.1
- @nudojs/parser@1.5.9
1.12.0
Minor Changes
-
1a4cabd: ABS-03: dts projection completion — contract generics, readable contract notes, overload arms.
- Contract-side type parameters are now derived from binder vars (
bind:<name>) and emitted only when referenced by a parameter or the return type: the entry-only HOF contract projects asexport declare function processItems<a, b>(items: a[], transform: (x: a) => b): b[];(element domain and callback parameter share the same variable; unreferenced vars are dropped). .d.tsJSDoc gains readableContract:rows (sidecar expression text / constraint rendering). They are notes only — the type face still comes from Abs, andCase:rows keep their debug-witness role.- Function Abs with a declared overload set now projects as a TS object type with per-arm call signatures (declaration order = TS resolution order) instead of collapsing to the union face.
- Schema projection already emits numeric
gt/ge/lt/lebounds; new tests pin bounded output and the honest omission of non-expressible relations (x > y).
- Contract-side type parameters are now derived from binder vars (
-
b57d1d2: ABS-04: test observation face — outermost witnesses survive the budget, and the two paths are discoverable.
- Call-site witness selection now prefers the outermost records (concrete arguments) over internal records whose arguments carry free term variables (α names / derived expressions from recursive or higher-order evaluation). A
sumTo(3)-style top-level witness is no longer pushed out ofcallSiteBudgetby internal records. - When a function has both
@nudo:caseand call-site records, the default run keeps the mutual-exclusion report and prints aboth-pathshint naming those functions, pointing at--both-paths(sources stay labeled: directive vs callsite).--jsonis unaffected; truncation reasons and their next actions keep flowing through the existingnudo:*-truncateddiagnostics. Under--freezethe hint is suppressed:--both-pathscombined with--freezeis a usage error, so the suggestion is not actionable in that run.
- Call-site witness selection now prefers the outermost records (concrete arguments) over internal records whose arguments carry free term variables (α names / derived expressions from recursive or higher-order evaluation). A
-
61c22d5: ABS-11: contract conjunction and projection precision.
and()(andC) now conjoins structural forms: shape ∧ shape (field-level, missing fields preserved, same-field constraints recursively conjoined), array ∧ array (element-level; node preds such as length bounds kept), union ∧ union (member cross-product, capped at 16), and fn ∧ fn (per-parameter and return conjunction; throws merged as a union). Contradictory forms stay fail-closed: prim mismatch, structural × incompatible prim, different structural kinds, and binder/ref/rel conjunction conflicts throw the same conflict path as before.formatConstraintrenders structural nodes' own predicates and optional flags (array(number()).min(2),shape(...).optional()), so length obligations are no longer invisible in diagnostics/derivation output.- dts projection treats contract and derived HOF relations as a conjunction: when a hand-written contract covers some parameters, HOF α variables are structurally unified with the contract Abs (elements / tuple slots / object slots / fn params+returns) and uncovered parameters plus the return position keep their β links instead of degrading to
unknown(e.g.processItems<B_transform>(items: number[], transform: (x0: number) => B_transform): B_transform[]). - Discriminant exhaustiveness warnings are intentionally deferred: the plan requires zero false positives, and no low-noise heuristic is available in this batch (documented in the test header).
-
c8aac63: ABS-14: bounded function-level summaries (5 commits on branch
abs-14, soundness gate revised 2026-11-13).- Single summary cache:
key/fn-summary.tsnow carries optionalformals/argKeys/bounds/pre/effand a per-function entry (fn\0<scope>) on the SAME Map;fnSummaryStats()keeps its instance-level meaning, function-level hits/rejections are exposed byfnSummaryFnLevelStats()(hits= entry found,applied= actually substituted). - Simple bounds with one-way alpha dependency (
key/summary-bounds.ts): reverse deps, unbound vars and complex app terms fail closed;TypeParam.boundsis additive and write-only in this phase (no product consumer yet). - Fast path (
key/summary-fastpath.ts): a hit requires all of- positional formals (
formals[j]= the top-level var of the j-th argument; non-var or aliased arguments fail closed) — storing the sortedvarOrderused to transpose arguments (f(z,y)→f(p,q)returnedq - p); - arg isomorphism: per-position α-normalized
absKeyWithConfkeys (shape × term × pred × conf) — a kind-only signature used to reuse{x:1}summaries for{y:"s"}, length-2 summaries for length-3 tuples, andDatesummaries forRegExp; - full precondition: the formation-time Φ (
pre, renamed formals → current argument vars) must be implied by the current Φ — checking only the simpleboundsprojection droppedapp-term conjuncts, sox % 2 === 0-formed summaries leaked to unconstrained calls. ThensubstAbs(post, map)is applied instead of re-running the body.boundsstays as observable metadata only.
- positional formals (
- All three conservative channels are on by default (
crossModule,bodyUnavailable,budgetTruncated); the degraded channels are verified independently (abs14-degraded-channels.test.ts), gated offsymbolicruns on the read side as well, and their substituted results stay in the instance memo only (cross-instance summaries keep "came from a real body evaluation" provenance). - Equivalence gate:
abs14-equivalence-baseline.test.ts(7 pinned body-path samples) plusabs14-fastpath.test.tscallingdiffAgainstBodyBaseline. The fast side now clears the cache stack, uses a fresh PolyFn and a witness Φ (ABS14_GATE_PHI), so layers 1/2 must miss and the test assertsappliedgrew — the earlier version re-read the same memo entry and never exercised the function-level path. - dts projection: HOF signatures no longer emit type parameters that are not referenced by any parameter or return position (
abs14-dts-reachable.test.ts).
- Single summary cache:
-
3ddcb81: ABS-14 follow-ups (rest-param soundness, degraded channels, dts bounds).
- Soundness fix (core): rest parameters were emitted as
const name = $restBind(...), but fork-arm restoration and member-write lowering rebind that slot (name = ...). Real CJS code such asdebug/src/common.js'sfunction debug(...args) { args[0] = ... }therefore threw V8's nativeTypeError: Assignment to constant variableduring module evaluation, makingnudo checkfail closed withnudo:module-throw. Both emit sites now uselet(native rest bindings are mutable). Regressed byeval-rest-param-rebind.test.ts; reverting toconstmakes all 9 cases fail. - ABS-14 degraded channels enabled:
bodyUnavailableandbudgetTruncatednow default on alongsidecrossModule. The replacement logic is extracted tokey/summary-fastpath.ts#tryDegradedChanneland verified independently byabs14-degraded-channels.test.ts(10 cases): the filled result is byte-identical to the same function's real body result, and no summary / non-isomorphic args / unproven full precondition / formal mismatch / unmapped variable staysunknown #opaque. The read side is gated offsymbolicruns (same as the write side and the cross-module channel, so a priorinstantiatecan never rewrite a signature/dts input), and substituted results stay in the instance memo — cross-instance summaries only ever hold results of a real body evaluation. The equivalence gate is refined accordingly:crossModule≡ current body path, degraded channels ≡ the same function with an available body. - dts bounds (
extends) (service):emit/dts-generator.tsnow translates expressible contractPredleaves into type-parameter constraints — primitivetypeoftags,eq(var, lit)literals, and fully-expressibleorunions. Numeric bounds, lengths, negations andtypeof object|functionare honestly omitted; unbound declarations stay byte-identical. Projection readscontract.params[].abs.preddirectly, soAnalysisResultand its cache cloning are untouched. Covered byabs14-dts-extends.test.tsincluding atsc --noEmitround-trip. - Host-drift test baselines: Node 22 vs v26 globals (
Float16Array,Intl.DurationFormat,URLPattern,CloseEvent, …) and toolchain-injected__*_SHIM_LOADED__names are now handled through the existingVERSION_SKEW/ declared-reason discipline rather than hard assertions; supported hosts keep full coverage.fs.promises.stat(throwIfNoEntry:false)oracle tolerates the Node 22 ENOENT behaviour while engine-side assertions stay strict. - Example docs:
docs/examples/retire-debugnow states that the return face depends on whether the realdebugpackage resolves;verify:examplespins onlyOK/0 error/ export names, notnudo:opaque-result.
The
TypeParam.boundsempty-field debt noted in this changeset was fixed in a follow-up commit (Pred variable-space alignment viaalignSimpleBounds+abs14-bounds-integration.test.ts);attachHofSnapshotnot passingrefinewas re-checked and confirmed to be correct design, not a defect. - Soundness fix (core): rest parameters were emitted as
-
897b19f: > 版本定性(2026-11-05 产品裁决):本批不判定为 breaking 变更 ⇒
changeset 不写 BREAKING / Migration 标注;下方「兼容性」段落只是升级时的 注意点,不是迁移要求。发布级别仍按此前决定走 minor(additive 能力 + 暂无外部用户),不占 major、不触发
scripts/gate-major.mjs。Abs现在携带可选facets槽位容器(callable/protoOwnKeys/brand),三个槽位均已在引擎内启用。缺省不出现 ⇒ 旧Abs的键、投影与leqAbs接受集逐字节不变;但带上槽位的值在以下面给出比以前更精确的判定:callable:类值裸调用判据不再只靠class-mark.ts的 WeakMap 与_rest形参启发式 ⇒ 快照 /substAbs/ 重铸后的类值仍定抛TypeError。该槽位表达「无new的 [[Call]] 定抛」,不是规范IsCallable。protoOwnKeys:原型对象的自有键集随值携带(Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols),不再只能按 brand 名查固定表。brand:生成器对象身份随值携带,dts 的iteratorTSType不再只靠next/@@iterator槽启发式 ⇒ 丢了内部协议槽的重建产物仍投影Generator<T>(泛型实参照旧推导,不输出裸名以免 TS2314)。
兼容性:直接构造
Abs字面量 / 只读取既有字段的代码无需改动 ——facets缺省即旧行为。用Object.keys(abs)、结构化克隆或自有实现的序列化器枚举Abs全部字段的内部代码,需容忍新增的可选facets(不读它即与旧行为一致)。absKey只对非空容器进键 ⇒ 带槽位的值会自然得到不同的 memo / 指纹,无需手工清缓存。coreformatShape的展示面不发布生成器身份(既有契约,逐字不变)。残余批次(同批发布):
- A2 声明/收割面:
declare class类值挂callable:false;JSON.stringify(obj, 类构造器)由may-throw升为确定抛 TypeError。HarvestSig.fn新增callable字段、HARVEST_DISK_ABIv14 → v15(~/.cache/nudo/deps/旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs的absFunctionmock 重建也整包搬运槽位。 - A10 内建原型:
Array/Object/Map/Set/Promise/String/Number/Date/RegExp等的Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols由保守string[]/boolean/symbol[]升为与宿主动态对拍的精确面(键集随 Node 版本给出各自真实值,不写死清单)。 - A10 用户类原型交错定义序:
EvalClassSpec新增可选protoMemberOrder(transpile/class-emit.ts按类体源码序登记、declare.ts::rekey同步换名)。Object.getOwnPropertyNames(用户类.prototype)对「方法与访问器交错定义」的类由保守string[]升为与宿主对拍的精确有序表;静态 / 私有成员不列入。手写 spec / mock 桥 / 旧产物无该字段 ⇒ 回落旧保守域(零回归兜底)。 - A11 TReturn / TNext:
AbsFacets新增可选genReturn/genNext,dts 输出Generator<T, TReturn>/AsyncGenerator<T, TReturn>(恒带类型实参,无 TS2314)。本轮进一步接通 TNext 保守域:makeGenObject填unknown(引擎不建模.next(v)入参 ⇒ 与 TS 该类型形参默认值等价,不是精度承诺),iteratorTSType仅当facets.genNext存在才输出第 3 实参 ⇒Generator<T, TReturn, unknown>;三实参仍恒带<…>,无 TS2314。手工构造 / 无genReturn的旧 Abs 输出逐字不变;填真实 v 域依赖 A1 步骤 4 真挂起(明确停点)。 - A1 步骤 2 骨架(零语义):
exec/match-iter.ts把 7 个元素面读出函数收口到模块私有的幂等触发器表,生产侧不登记 ⇒ eager 时序与全部值面逐字不变;不进任何 barrel,公共 API 冻结不变。为后续「首消费点触发」预置接线,不改变任何对外行为。 - schema / standard / guard 生成器身份投影:已实施,另立 patch changeset(
.changeset/generator-identity-validator-fix.md)。产品裁决「收紧是 bug、不判定为 breaking 变更」⇒ 三面按facets.brand统一收紧;emit-bug-130的无 brand 夹具仍逐字不变(负控制)。z.instanceof路径经运行时实证仍不可行。实施记录见docs/design/architecture-debt.md,生产接线回归见emit-generator-identity-poc.test.ts。
兼容性(补充):① 自行解析磁盘收割 JSON 或依赖
HARVEST_DISK_ABI的下游需接受HarvestSig.fn.callable新字段(旧缓存按 v15 自动失效);② 枚举Abs.facets全部字段的代码需容忍新增的genReturn/genNext(不读即旧行为);③ 曾断言内建原型gOPN为string[]/hasOwn为boolean的内部测试需改为与宿主对拍的精确断言;④ 解析生成器 dts 类型实参的下游需容忍三实参Generator<T, TReturn, unknown>(无genNext的旧手工 Abs 仍两实参 / 一实参,逐字不变);⑤ 自行构造EvalClassSpec的下游可忽略新增的可选protoMemberOrder(缺省即旧两表拼接口径),但曾断言交错类gOPN为string[]的内部测试需改为精确有序断言。Evidence: 三槽各独立全仓回归 0 新增失败;最终 2159 文件 / 17191 用例 0 新增失败;金标 1.0/1.0、真包 0 FP、差分语料 0 回退、公共 API 冻结未变。发布级别按 2026-11-05 产品裁决:整批不判定为 breaking 变更 ⇒ 不写 BREAKING / Migration 标注,仍以 minor 发布(
scripts/gate-major.mjs不触发);一旦有外部用户依赖这些包面,即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」。 -
4361e2e: DX:
nudo test --both-paths(directive + synthesized witnesses in one round) and opt-in HMAC-signed disk cache entries.nudo test <path> --both-paths [--only <names>]: functions with@nudo:casedirectives now can also synthesizecall@/entry@witnesses in the same round (teaching comparison face; default exclusivity unchanged).--jsonseparates the paths viasource: "directive" | "callsite"; exit semantics unchanged (synthetic cases never fail the run).--onlywithout--both-paths, and--both-paths --freeze, are usage errors.- Signed disk cache:
package.json#nudo.cache.sign: true+NUDO_CACHE_KEYsigns every entry (HMAC-SHA256, domain-separated key derivation). Verification failure = miss (recompute, never trust) — a forged CheckJson can no longer pass the gate; signed/unsigned key spaces are separate, so key rotation is a clean full miss. Fail-closed config: sign without a key, or a non-boolean sign, refuses to run (check/contract/health, machine-readable on--json) instead of silently running unsigned.nudo.cachealso accepts an object form{ dir?, sign? }; typo'd keys surface asconfig-shapereport entries. - truncation suggestions: fork/recursion-budget fix values in the analyzer now consume the single-sourced
suggested{Fork,Depth,Calls}Ceilinghelpers from@nudojs/core/internal(same wording as the check face, concrete numbers instead of@nudo:budget depth=…placeholders). - benchmark:
bench-monorepo.mts --corpus <path>runs the S1 benchmark against a real monorepo directory (dynamic hub/mid/leaf targets from the module graph, in-memory edits only — user files are never written; report lands ins1-perf-baseline-real.{md,json}with an honest corpus header).
-
4fc7e19: Rename the remaining Nudo
interfaceterminology tocontractend to end.- Core:
effectiveInterface→effectiveContract,InterfaceSource→ContractSource,InterfaceTierInfo→ContractTierInfo,interfaceTierOf→contractTierOf,takeInterfaceDiags*→takeContractDiags*, and thealgebra/interface/directory →algebra/contract/. - Service:
emitInterface/draftInterface/interfaceSurface→emitContract/draftContract/contractSurface;interface-*.tsfiles →contract-*.ts;ifaceCacheKey→contractCacheKeyand the disk-cache namespaceiface→contract. - Diagnostics:
nudo:interface-*→nudo:contract-*(no alias layer). - CLI/LSP: CodeLens titles
⚡ persist contract/↻ update contract/⚡ draft contract; agent messagesno contract found/no contract changes;CheckIssueactions and hover/inlay fields usecontractSource/contractDisplay/contractActive. - Docs, examples (
contract-derivation/,contract-draft/), API snapshots, and website references updated.
TypeScript's
interfacekeyword, Babel ASTTSInterface*, and historical release notes are intentionally unchanged. - Core:
-
951b256: 静态元素域通道(「第三种」):把生成器的元素域从「隐式编码在
shape数字下标槽、dts 靠CANONICAL_INDEX正则反推」升级为随Abs值携带的 显式承载位,并把源码返回类型注解从「可覆盖观测」降级为一致性校验。core
AbsFacets.genElements?: Abs[]:makeGenObject填$gen的完整 yield 序列(full,不是$arr之后可能 widen 的els;Bug 53 点名前者才是 权威数据)。shape数字槽并存不替换,消费点 / 族 01 口径不变。cloneAbsFacets拷贝数组(Abs 元素按引用共享)⇒snapshotAbs/substAbs/renameAbs/join四处经统一 clone 自动搬运,副本不串台。facetKey新增ge:段(逐项absKey)⇒ 元素域不同的生成器不共享 memo / 指纹;无genElements的旧键逐字节不变。
service
iteratorTSType优先读genElements,严格 fallback:字段为undefined(手工构造 / 静态收割 / 旧 Abs)时仍扫数字槽 ⇒ 旧产物逐字不变。 端到端实测 fork 分支if (f) yield 1; else yield "s"从Generator<unknown>恢复为Generator<number | string>;只有genElements、无数字槽的手工 Abs 也能投影出精确元素类型。FunctionAnalysis.declaredReturnType透传nudoReturnTypeText(此前全仓 只有写入、无读取点);新增nudo:return-annotation-mismatch台账: 声明与观测同为单一基类型且互斥时留痕,产物恒用观测口径(不覆盖、 不用声明兜底)⇒ 不重演 BUG-168 在形参位修掉的「两面相反裁决」。 联合 / 泛型 / 字面量 /unknown一律不判,避免 widen 口径差异被误报。
兼容性:
genElements是可缺省槽位;静态声明收割(harvest)不构造生成器 运行时值 ⇒ 不进HARVEST_DISK_ABI,冷 / 热产物一致。公共导出符号名不变 ⇒ 公共 API 冻结不受影响。已知边界:不解锁 A1 步骤 3 ——
genElements仍由构造期跑体填充, 体延后到首消费点 ⇒ 字段也空,而 dts 是纯投影、导出期无消费点。本变更 只预置了承载位与「未填充」语义;步骤 3 仍需静态 yield 域推断通道或产品 接受Generator<unknown>降级。详见docs/design/generator-laziness.md「dts 元素域通道 · 第三种已落地」。版本定性:新增诊断码 + additive API ⇒ minor;按整批裁决不判定 breaking,无 BREAKING / Migration 标注。
回归:
gen-elements-facet.test.ts(7 例)/emit-gen-elements-facet.test.ts(9 例);全仓1658 入口,20 失败 = 基线 20,0 新增 / 0 消失。 -
a9638c2: Feat: precision-cliff UX —
nudo testcall@symbolic hint +nudo healthprecision counts.nudo test: when a report containscall@symbolic(the symbolic aggregate witness folded from call sites beyondcallSiteBudget), the report tail now appends one actionable note (SYMBOLIC_BUDGET_NOTE, same "fact — action A or action B" shape as thenudo:recursion-truncatedadvice): raisepackage.json#nudo.analysis.callSiteBudget(1–64, default 3) or pin exact witnesses with@nudo:case(limitations §3.2.2 wording — for recursion pin@nudo:case, don't rely on call@). Display-face only: no assertion counting, no exit-code change. Reports withoutcall@symbolicstay byte-identical.nudo health: the Summary line and the--jsonsummary (same source) now carry precision counts —unknownSignatures(functions whose return the engine could not infer; rendersunknown, counted via the sharedinferenceFailedpredicate;@nudo:skipfunctions are declared faces and not counted) andwidenedWitnesses(occurrences of#widened, i.e. witnesses withconf === "widened"— budget-folded symbolic aggregates / loop widening). Informational only, likeuncovered: never gates the exit code. Text Summary reads… · N unknown signature(s) · M #widened witness(es);--jsonsummary gains additive keysunknownSignatures/widenedWitnesses.@nudojs/serviceexportsSYMBOLIC_BUDGET_NOTE(single source for the note text; CLI and tests consume the same constant). Regressions pinned inpackages/nudojs/src/__tests__/precision-hints.test.ts; family-63 health baselines and the e2e health golden updated for the Summary extension (their fixtures now pin src tsconfig per thewriteSrcTsconfigconvention, so they no longer silently test a staledist/).
Patch Changes
-
56d8227: Add the
nudo:capability-denieddiagnostic (ABS-12 R12-D, strict by default). Host globals andnode:modules classified as denied now report this code — values stayunknownand are never executed natively — instead ofnudo:builtin-unknown; denied modules are reported at the import/require site. Module classification only covers builtins (node:prefix ormodule.builtinModules), so relative paths and npm packages keep their existing missing-module channel.NUDO_CAPABILITIES=trusted(orsetCapabilityMode("trusted")) restores the previousbuiltin-unknownsurface and limits runtime identity blocking to the hand-written high-risk list; unclassified names (typos) remainbuiltin-unknownin both modes. Docs updated (EN + zh-Hans). Pinned bycapability-diagnostics.test.ts(strict/trusted, globals/modules/typos). -
47463ae: DX: truncation / host-effect diagnostics now carry concrete fix values and pasteable mock skeletons (suggestion/action text only — severity and exit semantics unchanged).
nudo:fork-truncated: suggestion now carries a computed ceiling from the observed fork count —fix: package.json#nudo.analysis.maxForks=<N> (observed <K> forks this run), or @nudo:budget forks=<N> on the function — non-blocking, withN = max(20000, observed × 1.5 rounded up to the next thousand)(20000 default when stats are unavailable). Still Info / non-blocking. The ceiling helpers (suggestedForkCeiling/suggestedDepthCeiling/suggestedCallsCeiling) are exported on@nudojs/core/internalso the analyzer-side truncation diagnostics consume the same formula instead of a hand-copied one.nudo:host-effect-blocked: suggestion now embeds a pasteable single-line@nudo:mockskeleton per host family —fetchgets@nudo:mock fetch = (url) => ({ ok: true, json: () => ({ id: 1 }) }), the timer/scheduling family gets@nudo:mock <name> = stub().returns(0), and the constructor family (WebSocket/EventSource/XMLHttpRequest) getsstub().returns({ … })(an arrow mock is not constructible —newon it would trade the Info for athrows TypeErrormay-throw). All skeletons verified end-to-end: pasted verbatim into the calling function's JSDoc, the diagnostic disappears and the result regains precision. The structuredmockaction incheck --jsoncarries the same skeleton.nudo:recursion-truncated: the depth/calls arms of the suggestion (and the@nudo:budgetquickfix innudo check --fix/ LSP code actions) now carry concrete values derived from the observed depth/call counts —@nudo:budget depth=128/calls=40000floors (defaults ×2), e.g.raise the function budget with @nudo:budget depth=128 (or narrow the recursion base case / declare @nudo:contract return). The cycle arm keeps the code-level guidance (arguments must vary per level / narrow the base case /@nudo:contract; raising the budget cannot lift it) and never points at@nudo:budget. Legacy cache entries without areasonkeep the oldforks=64quickfix shape.
-
1aab8ff: Bug 修复(非 breaking):导出的运行时校验器没有执行
.d.ts已经声明的生成器类型。zod/standard/guard三个面此前只判「是个对象」,于是把{}、{ next(){} }当成合法的Generator<T>返回值放行。现在按Abs.facets.brand投影身份,三面同时收紧:真同步 / 异步生成器放行,普通对象拒绝。声明面、公共 API 形状、SchemaNode既有成员都没变(只新增一个联合成员),变的是校验器有没有真正执行既有契约 ⇒ 按 soundness patch 发布,不写 BREAKING / Migration 标注(与全批口径一致)。该 changeset 自身不抬级;与同批 minor changeset 合并发布时,包版本取最高的 minor。- 判据单一真源
service/src/emit/generator-identity.ts:只认随值携带的Generator/AsyncGenerator两个 brand;无 brand 的旧 Abs / 手工构造逐字不变 ⇒ 既有产物不需要迁移。2026-11-06 补齐递归:生成器作为对象字段 / 数组元素 / union 臂时同样收紧,由 coredenoteGuardB的递归身份子句与schema-generator.ts::syncGeneratorTags(约束投影通道丢 facets 后按原始 Abs 树同步)共同保证,四面不再相反裁决。 - zod 面内联
z.custom((v) => Object.prototype.toString.call(v) === "[object Generator]");standard 面库版checkNode与产物内联__nudoCheck两份实现同口径;guard 面的身份子句由 coredenoteGuardB递归入口生成(2026-11-06 从顶层前置改为递归,service 不再重复注入)。core 展示面format.ts始终未改(避免 A11 曾致 4 条回归的展示面路径);Shape判别联合、projection.ts约束面也未动。 - 已知边界:
Symbol.toStringTag可伪造(换取跨 realm 可判,与z.instanceof(Date)可改原型伪造同类)。2026-11-06 用node:vm实测对比原型链判据:后者不可伪造,但会误拒跨 realm 的真生成器 ⇒ 结论保留 toStringTag 口径。z.instanceof路线仍不可行(无全局GeneratorFunction)。 - 回归:
emit-generator-identity-poc.test.ts由决策 PoC 升级为 16 例生产接线回归(四面逐值同裁决、真跑、tsc --noEmit --strict、伪造边界、嵌套递归、跨 realm 判据实测);emit 族 502 例全绿,全仓 0 新增失败。
依据:
docs/versioning.md的「判例(2026-11-05)」与docs/design/architecture-debt.md的「schema / guard / standard 生成器身份投影 · 实施记录」。 - 判据单一真源
-
b060986: Bug 修复(翻译口径订正,非 breaking):产品裁定「nudo 的
any含义更接近 TS 的unknown」——nudoany是「任意 JS 值、无约束」,对应 TS 的unknown(top,消费方须先收窄),不是 TS 的any(关闭类型检查的逃生舱)。此前.d.ts是唯一把 nudo any 直译成 TSany的产物面,而 zod / standard / guard 三面运行时校验器早已把 any / unknown 同映为unknown。现在 TS 投影面归一,四面同口径。dts-generator.ts::absToTSTypeB的case "any"由return "any"改为return "unknown";另补齐三处绕过该函数的硬编码:classParamDecl(类构造器 / 静态方法形参)、无签名导出的(...args: unknown[]): anyfallback、泛型基类实参占位。源码注解原文解析的anytoken 白名单、守卫体内部故意的Record<string, any>、case-json/ contract draft /formatAbs等 nudo 展示面均不变。abs.md(en / zh)的「unconstrained entry parameters display asany」规则作用域澄清:它只管 Nudo 自己的展示 / CLI 输出,不管辖 TypeScript 声明产物;nudo check/nudo contract签名面继续区分 any(无约束)与 unknown(推导失败)。docs/design/cli-semantics.md§2 与导出指南 en / zh 同步订正。- 实测收益:生成器宿主调用退化档
Generator<any>→Generator<unknown>;BUG-076 记录的「导出指南承诺unknown+ 点名提示,实现却给any且无提示」矛盾彻底关闭 —— 归一后按「渲染为 unknown」触发的 stderr 提示自动覆盖主路径。 - 兼容性:
.d.ts消费方对未收窄的无约束返回值会遇到 TS2571。按产品裁定性为正确的类型安全提示(引擎确实不知道返回值是什么),先做typeof/ 判别收窄即可;Bug 544 的 tsc 实证已从「假红」改判并保留正反映证。按docs/versioning.md的 soundness 判例走 patch,不写 BREAKING / Migration 标注;该 changeset 自身不抬级,与同批 minor changeset 合并发布时包版本取最高的 minor。 - Evidence:全仓独立改前基线 1659 入口 / 20 失败 = 基线 20;归一实验暴露 26 条新增失败,全部为 TS 产物精确串断言(无功能失败),已按新口径逐条重订;BUG-544 / BUG-076 两个语义级测试整份重写,BUG-003 / BUG-079 / BUG-044 / BUG-168 / BUG-514 / BUG-520 / dts-contract-face / export-dts-evidence 等同步。最终全仓 0 新增失败。
依据:
docs/versioning.md「判例(2026-11-06)」、docs/design/cli-semantics.md§2、packages/website/docs/concepts/abs.md。 -
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
- @nudojs/harvester@0.6.0
- @nudojs/env@0.5.8
- @nudojs/parser@1.5.8
1.11.0
Minor Changes
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
7d7abe4: Dedup batch 4 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the three remaining comment-pinned manual-sync pairs and the largest in-file twins. Pure refactor — outputs byte-identical (vitest --changed 15548 passed, verify:examples 251 checks, public-api freeze 9/9).Comment-confessed sync pairs now single-sourced:
- lsp hover
formatEntryParamShapeLike→ coreformatEntryParamShapevia@nudojs/core/internal(the old comment claimed "core adds no export"; the internal face is the sanctioned route). - lsp
server-code-actionsnorm/resolveRelcopy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) →@nudojs/service/emitexportsnormPosixPath/resolveRelativeSpec; the lsp-only extensions stay at the call site. - standard-schema brand ctor list:
GLOBAL_BRAND_CTOR_NAMESlocal array + Set → schema-generatorRUNTIME_GLOBAL_CTOR_NAME_LIST(single array source; Set +isRuntimeGlobalCtorNamepredicate derive from it; the embedded validator serializes the same array, byte-identical).
In-file twins single-sourced:
- core
hof.ts:predUsesMappedVars/mapHasShapeOnlyVar→ parameterizedpredAnyVarwalker. - core
scan/literal-shapes.ts: 21 structurally identicalconstraintViolatedissue pushes →pushPrecondIssue(message/suggestion templates byte-identical). - core
builtins/promise.ts: then/catch rejected-arm microtask twins →definiteRecoveryPromise/unsettledRecoveryPromise; then-microtask dual reject arms →joinRejectedArm;Promise.alldual reject faces →allRejectFace. - core
check.ts: handwritten return-contract recording block (skip branch + main branch) →recordReturnContract. - core
leq.ts/postcondition.ts: duplicateprimOfsingle-sourced in leq. - core
builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) →taOwnKeysTuple; gOPD class/Error/.prototypeslot→descriptor arms →ownSlotDescriptor; 8 identical nullish-receiver guards →throwIfNullishRecv. - core
builtins/array.ts+template.ts: tuple join folding loops →tupleJoinParts(recv, onSymbol)(symbol element: throw vs abstract — the real semantic fork, parameterized). - core exec runtime:
$whileSeq/$forOfapplyExitJoinclosures → new pureloop-exit-join.tsapplyLoopExitJoin(the discoveredexhausted && widengate difference is an explicit parameter;$forOfpassesexhausted: true, provably equivalent). - core
directive-scan.ts↔ parserfn-directives.ts:CASE_TAG_REGEXscan loop → coreiterCaseTags(text, caseArgSpans)via@nudojs/core/internal(Bug 978 diagnostic actions and downstream regexes stay consumer-side). - service
dts-generator.ts:DtsClassMemberSurfacebase interface —scanClassSurfacereturn type no longer re-declares the member fields (BUG-168/151 docs live once). - lsp:
replay.tsasync env-preload twins sharepreloadEnvsThen, function scope walkers sharewalkFnScope;server-navigation.tsreferences/rename share the gate+parse prologue;hover.tsgeneralize blocks sharetryGeneralizeEnclosing.
Skipped as intentional parallel data or non-identical semantics: env node/web table clones (MessagePort ports, dual Storage, exec options), dts obj-slot widen pair (Bug 240 selective flags vs whole-slot spread), object methods string char-tuple pair (values vs entries elements).
- lsp hover
-
c48fd48: Engine review batch (evaluation-engine design audit; 3 concurrent domains, behavior-preserving except where noted). Full suite green (2113 files / 16579 tests),
verify:examples251 checks green, build + lint + lint:tests clean,public-api-freezegreen (internal face +1:isAbsLike).core transpile:
- Per-unit emit state: the five module-level mutable counters/stacks in
stmt/statement.ts(switchBodySeq/switchBreakSeq/curSwitchBreakLabel/forInRecvSeq/forLoopVarSeq) moved intoTranspileOptions.stmtEmit(StmtEmitState), created fresh per transpile unit. Fixes cross-unit counter bleed: transpiling the same source twice in one process now yields byte-identical output (was 5/6 samples drifting on second pass). Single-module first-transpile output byte-identical vs HEAD (6-sample corpus,cmpclean;__nudoLv*/__nudoSw*/__fir*/__swBody*base names unchanged). - PrivateName key extraction unified: new
privateNameKeyOf(bare#nameor null) is the single extraction point;privateNameKeySrcbuilds on it. The three inlined copies (expr/call.ts,expr/optional-chain.ts,class-emit.tskeyOf) now call it. The dead|| undefinedbranch in optional-chain (#${… ?? ""}is always truthy) deleted. transpile/stmt-predicates.ts→transpile/stmt/predicates.ts(statement-domain file now lives understmt/).userIdentCache: whole-table clear at 64 →BoundedLruMap(64).
core runtime:
isAbsLike(shape+conf) added toabs.ts, exported via@nudojs/core/internal; DEC-006 fail-closed fallback table documented at the definition. ~40 inline"shape" in …guards across exec/** replaced (branch bodies and fallbacks verbatim);check-may-throw.ts's localisAbsValre-definition now aliases it. Behavior delta (bugfix): host objects that merely carry ashapedata property are no longer misdetected as Abs values — they now take the host branch as DEC-006 intends. The one inline check insiderun.ts:712generated-code string is intentionally kept (not a TS-surface check; changing it would alter the runtime injection face).- Collector dual-track residue closed:
yieldStack/genPathSensitive/genJoinOverride(runtime/control.ts) andcallLocStack/absOrigins(member-diag.ts) migrated tocreateScopedSlot+registerCollectorScopeParticipant; module-global fallback behavior unchanged (generator evaluation is synchronous, push/pop paired). $assumeAnchor(≈80 lines) moved out ofruntime/ops.tsintoruntime/assume.ts; ops.ts back to pure arithmetic delegation. Export surface unchanged.runtime/containers.tsis a pure re-export barrel again: the five isomorphic guard wrappers ($idx/$idxSet/$get/$set/$iterCheck) collapsed intoguarded-entry.ts'sguardedEntryfactory (BUG-173 this-access gate / BUG-217 accessor split / BUG-215 iterator-slot guard moved verbatim).
service:
- Three hand-rolled LRU caches (
analysis-file-cache.ts,fn-analysis-cache.ts, eval-run'sevalRunByFile) replaced withBoundedLruMap; the three "matches BoundedLruMap.set" sync comments deleted. Key semantics (stablePathKey / fn-cache prefix / file×mode slot keys) unchanged. - Dead dual-engine capability flag removed:
absModulesOk(constant true since the single-engine merge) deleted fromanalyzer-abs-eval.tsand the@nudojs/serviceexport face; its four call sites constant-folded. This is the only public-API removal in this batch. - Parallel assembly sequences unified:
buildEvalInjection's graph-assembly segment (the historical 5→2 leftover) now parameterizes and callscomposeEvalModules; the real differences (mock seeds enter the graph on the analyzer face vs runtime injection on the inject face, fileDirectives vs from-source, structuredmockModuleErrors) are explicit parameters. Deep-structure probe diff vs HEAD: zero. eval-run.ts(922 lines) split: env/harvest merging →env-modules.ts(pure data face), eval LRU + fingerprints →eval-cache.ts; eval-run keepstryRunEval/tryEvalCall*/cjs dispatch + re-exports. Public face unchanged (no package imports eval-run directly outside service).- Mock fingerprint write-side single source:
mockFingerprint(kind, payload)factory inmock-abs.ts; all five stamping sites go through it, seed-fn entries now stamped too; the reader (absSeedPart) consumesimpl.fingerprintonly (single"nofp"marker when absent, no format-string reconstruction). Cache keys change once (harmless miss).
- Per-unit emit state: the five module-level mutable counters/stacks in
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
-
5cd4106: Dedup batch 2 (jscpd + hand-sync-comment audit): single-source the remaining cross-file / cross-package copies that were pinned together by comments or mirror tests instead of code.
- String-aware scanners (
splitTopLevelArgs/findTopLevelColon/stripJsdocContinuation→ newcore/algebra/text-scan.ts, exported via@nudojs/core/internal): the check face (case-arg split) and the parser directive face each kept verbatim copies — Bug 1009 was exactly this pair drifting (check face treated\as an escape ⇒ one arg fewer ⇒ L2 witness silently skipped).scanWithStringswas dead after the move and is gone. - bigint operand predicates (
isNullishLitOperand/isKnownNonBigintNumeric/isMaybeBigintOperand):surface.tscarried a forked copy ofarithmetic/coerce.ts— itsisMaybeBigintOperandlacked the Bug 946arr/tuplearms and only stayed sound by accident of the catch-all throw. Single source in coerce;foldNumericBinOpnow mirrors foldBigintBinOp's explicit arr/tuple hard-throw so1n & []still throws deterministically. - Bug 946 member-level fix (behavior):
isMaybeCoercionThrowOperandnow recurses intosummembers and skipsarr/tuplemembers —x & 1/1 - xwithx: number | []no longer records a false TypeError may-throw (native never throws; the old member scan dragged arr members into the may-throw channel ⇒ potential L2 false red). Regression-pinned in the Bug 946 suite, including the sound positive control (1n + xon the same union still records may-throw: the number member genuinely throws). collectNestedBodyRangeswiring completed: core exported it via@nudojs/core/internaland its comment claimed parser reuse, but parser still ran a full local copy.file-directives.tsnow consumes the single source.parseIgnoreThrows/configIgnoreThrows: service is the declared single implementation (CLI / LSP / vite-plugin); the CLI kept its own verbatim copy and the LSP test suite used that copy as a mirror oracle. nudojs now re-exports from@nudojs/service; the tautological mirror assertion is replaced by direct-value assertions.absShapeForTsTypeTextvia@nudojs/core/internal: service'stsAnnotationShapewas a hand-synced table replica ("勿单边扩表") with a drift-gate test holding the two copies together; both the replica body and the drift-gate file are gone.- emit section extraction:
interface-derivation-emit.tsandinterface-emitter.tsduplicated the export-statement →{names, bindings}extraction (31 lines) andstripSections(14 lines); both now shareservice/emit/export-section-scan.ts. ScanLiteralCallsOptions: the thin shell's inline opts literal type was a documented structural mirror of the named interface; the shell now consumes the interface directly.
- String-aware scanners (
-
5769211: Dedup batch 5 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the four remaining comment-pinned manual-sync obligations and the seven whole-function twins. Pure refactor — outputs byte-identical (vitest --changed 16815 passed, verify:examples 251 checks, lint + lint:tests clean).Comment-confessed sync pairs now single-sourced:
- transpile
stmt/statement.tsyield try-context bits (raw1|4|8/& 2/~(16|32|64)literals pinned by a "钉死同步" comment to runtimecontrol.tsYIELD_* constants) → new zero-dependency leafexec/yield-bits.ts; runtime (control.tsre-export removed,async.ts) and transpile (statement.ts) both import the named constants. - parser
case-arg.tsTYPE_EXPR_CHAIN_METHODShand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exportsCONSTRAINT_CHAIN_METHOD_NAMES(public barrel, next toCONSTRAINT_BUILDER_NAMES); parity pinned byconstraint-chain-methods.test.ts(method-face drift ⇒ CI red). - service
builtin-prototype.tsBUILTIN_ERROR_CLASSESverbatim 8-name copy of coreERROR_CTOR_NAMES→ imported via@nudojs/core/internal(the dead module-level re-export is removed; no public face change). - core
promise.tsaggregateErrorAbslocal error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated ineval-bug-293-promise-combinator-settle.test.ts(slot-key set / non-enumerable flags / inherited name vserrorBrandAbs).
Whole-function twins single-sourced:
- core
builtins/error/binary.tsmakeArrayBufferAbs/makeSharedArrayBufferAbs→ parameterizedmakeBufferAbs(brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved). - core
transpile/member-path.tsmemberWriteIfe/memberWriteRootIfe→ sharedmemberWriteIfeImpl(only real difference: return written value vs new root). - nudojs
version.tsthree walk-up-to-package.json loops →findPkgDirUpwards+readVersionAt. - nudojs
migrate.tsplanWorkflowRewrites→ delegates toplanWorkflowRewritesIn(findWorkflowDir(from));readPackageJsonDetailed/readMarkerFile→ sharedreadJsonObjectDetailed(path, label)(missing / invalid / unreadable / ok grading unchanged). - service
emit/quickfix-edits.tssidecarClearsEntryThrow/sidecarClearsConstraintViolation→ sharedsidecarClearsDiags(input, codes)(Bug 556 dual-code gate preserved). - core
generalize.tsctorParamCountOf/ctorFormalsOftwin class-ctor walkers → singlectorParamNodesOfwalker (Bug 1031 null-declaration skip lives once; count still raw param length, formals stillformalParamsFromNodes— thethis-param skip semantics unchanged). - lsp
server-commands.tshandleSelectCase/handleSelectContract~20-line resolve→read→caseTargets→knownFunctionNames preamble →resolveCaseTarget(error strings byte-identical).
- transpile
-
fd0fb09: Dedup batch 7 (jscpd
--min-tokens 70re-audit after batch 6: residual same-file fragment twins + one drifted manual-sync pair). Pure refactor — defineEnv deep structural dump (sorted + insertion-order preserving) byte-identical vs HEAD, verify:examples 251 checks green, lint + lint:tests clean.- env
node.ts: Storage slot table ×3 (ctor brand + localStorage + sessionStorage) → singlestorageObjconst (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → sharedexecSyncOptions; Request / Response body-mixin slots (clone/arrayBuffer/blob/formData/json/text, clone returns the respective brand) →bodyMixinSlots(self)factory; EventEmitter core on/once/off/emit →emitterCoreSlotsshared by the EventEmitter brand and theprocessglobal object. - env
node.tspath family — the drifted manual-sync pair: the top-levelpathModuleinlined the whole member table next to theplatformPathMethods(posix/win32)factory and had already drifted (join.requiredonly on the top-level copy).pathModulenow consumes the factory; member order canonicalized to the top-level key order;join's required-arity enforcement is now identical across path/posix/win32 (Bug 877 case 6's claimed parity now real). - env
web.ts: URL.searchParamsslot table and the global URLSearchParams constructor sharesearchParamsCoreSlots(toString / iterator face / size stay per-site; insertion order preserved). - core
builtins/error/binary.ts: DataView ctor andmakeTypedArrayFromBuffersharebufferByteLengthLiteral(brand→inner obj→byteLength slot fold);TypedArray.of's inlined copy of the number-domain item enforcement now callsenforceTaItem(the.ofcause variant is unified into the shared text — no pins). - core
builtins/object/methods.ts:getOwnPropertySymbolsobj arm and brand-inner arm share theownSymbolsTupletail (open/index → undefined, closed → counted tuple). - core
exec/transpile/helpers.ts: the MemberExpression root-identifier walk (assignment / update / stateful-call faces, ×3) →markFreeMemberRoot. - core
scan-call-graph.ts: dynamic-import and require ObjectPattern destructure binding loops →bindPatternImports; top-level class scans (findClassDecl+ module-frame class bindings) shareunwrapExportDecl. - harvester
harvest-dts.ts:resolveIfaceDeclsinner-first relative namespace resolution loop (qualified arm + short-name arm) →addRelativeNsHit;absExtends' twoes.k === "sum"member folds →foldSumFlags(thecs.k === "sum"fold is intentionally different and untouched). - service
analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) shareactualSlotTable(obj direct / brand inner-obj unwrap). - lsp
server-navigation.ts:onDefinitionnow uses the sharednavigationIdentAtpreamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept. - lsp
agent-tools.ts:suggestCase/traceshare theanalyzeToolFilepreamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
- env
-
6eaf219: Engine review batch: harden the transpile↔runtime ABI, converge class-graph identity, and add compile/emit guard rails. No public API changes.
ABI single-sourcing (#1):
$-prefix semantics (rt.ts module param face + analyze-strip strip-keep predicate) now consume one explicit table (isRuntimeOpName/MODULE_FACE_ONLY_OPSin transpile/runtime-import.ts); a drift guard pins the binding-table$-key set ≡ truth table (the 4 internal helpers that accidentally rode the prefix filter are now explicit).Runtime state (#2/#8/#9/#12): state.ts split into phi.ts / host-bridge.ts / exit-stacks.ts with state.ts kept as a byte-identical re-export facade (75 value exports + type face verified unchanged); load-time setter injections for the member/class dispatch cycle converge into exec/hooks.ts (removes the
var-hoisting TDZ defense); may-throw's AsyncLocalStorage + module-level syncCtx dual-write and the bare newTargetStack now run on collector-scope slots; isHostGeneratorFn checks the Bug 325 fnKind stamp before the source-shape regex (regex kept as hoisting-window fallback, documented); narrow.ts sum-filter boilerplate ×5 collapsed into filterSumMembers; guardedPrologueEntry factory covers $in/$del/$delRes; toIOIArg no longer routes through toIOI's absent-folding (private ioiNumberOf core, both helpers derived).Class graph (#3/#4): inheritance-chain walks (statics/method lookup, super family, error-family and JSON-face walks) prefer the per-value
superSpecreference resolved at definition time — multi-module same-name parent classes no longer cross-contaminate via the last-wins bare-name registry (name table kept for display/builtin fallback, collision observation unchanged); all brand-rebranding sites ($super, $new exit) route through a singlerebrandClassAbsprimitive that transfers the full side-table set (inventory + per-table rationale in rebrand.ts header).Transpile (#5/#6/#7): TranspileOptions' 44 fields regrouped into BaseEmitOpts/FlowCtx/NamingCtx/InjectCtx (type-level only, zero call-site churn); new transpile-output-hygiene test parses generated output for the full differential corpus and asserts every
__-prefixed binding comes from the allocator whitelist (9.5k bodies / 7.8k declaration sites); new async-gen compile guard transpiles+compiles all 39 await-position shapes without the disableAsyncGen retry (pins the Bug 1139 false-green class).Service (#10/#11): eval-cache 6-dim key comparison unified into a single evalCacheEntryMatches predicate (read-hit + write-back shared); CJS member dispatch exception handling pinned by a drift-gate test (shares no skeleton with core's export-slot path — rationale documented); stale TypeValue / ast-eval "fallback path" comments rewritten to describe the actual single-engine behavior, write-only dead sets removed.
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
- @nudojs/parser@1.5.7
- @nudojs/harvester@0.5.0
- @nudojs/env@0.5.7
1.10.3
Patch Changes
-
51e69f8: Fix bug-report category 01 (predicate algebra / arithmetic / constraint・leq / postcondition).
- BUG-001: a same-prim literal union used as a return contract is no longer reported violated when the value's predicate already proves membership — the union branch now tries the aggregate (arm ⇒ merged-disjunction) implication before falling back to per-member checks.
- BUG-002:
number().int()'s return obligation is enforced for non-literal returns; failure is reported asnudo:unproven-returninstead of silently staying green. - BUG-027:
export --format dtsno longer widens a non-same-prim literal union to its base type, so the published.d.tsmatches the enforced contract. - BUG-088:
.optional()'s omittable / may-be-undefined semantics survive the contract ⇒ entry-Abs projection; call-site and return positions agree, and the check signature and.d.tsnow express the same optionality. - BUG-208: sidecar
fn()'sthrowsslot splits separators like@nudo:throws, sothrows: "TypeError, RangeError"no longer silently becomes one unknown kind. - BUG-209:
pick()/omit()/partial()preserve theoptionalflag, so legal calls are no longer judged violating anddtskeeps the?.
Regression tests:
core-bug-001-*,core-bug-002-*,core-bug-088-*,core-bug-208-*,core-bug-209-*,service-bug-027-*.追加:BUG-077 / 083 / 106 / 200 已修(IEEE 舍入不再是实数环)+ 4 处授权重钉
根因族:线性区间层把
+ - *当实数环运算、比较归一精确抵消常量 ⇒ 舍入(吸收 / ties-to-even) 被抹掉 ⇒ 假证。修法是统一机制,不是逐例特判:pred.ts的Lin新增rounds(舍入运算次数)与addConstMag(参与舍入的加性常量最大量级);applyCmp把界按舍入前像区间外扩slack = rounds × ½ulp(max(|k|, addConstMag)),方向保持 (gt → lo−、lt → hi+、eq → 两侧);rounds === 0(纯 var/lit、2 的幂缩放、x+x精确加倍) 仍是精确点反解(BUG-077,取 section 方案 B:保真且不丢信息)。proveInCtx在linInterval后按同一 slack 把端点外移(nextDown/nextUp各再退一格), strict 语义保留 ⇒x>0 ⊬ x+1>1,而x>0 ⊨ x+1>=1(直接比较路径)与x>1 ⊨ x+1>1仍可证 (BUG-083)。linInterval按 atom key 稳定排序后累加 ⇒x+y与y+x同结论(BUG-200 的独立根因,Map插入序曾让同一加法换序得出相反结论);linFormsEqual要求两形都精确 (rounds === 0)⇒x*6与x+x+x+x+x+x不再判「同值」(BUG-106,此前把 IEEE 加法当结合律 / 分配律,抛臂被消 ⇒ L2 假绿)。- 「有限证据 ⇒ 环语义」闸门:
atomsFinite(ctx, lin)(所有原子有assumeFinite,或typeof=number ∧ 双侧有限界自动导出)成立时 slack 归零、linFormsEqual的ringOk放行 —— 与linOf既有的ieeeOk口径一致(@nudo:assume-finite的环消去 / 分配律契约不变)。
重钉 4 处(依据 section 声明,不是放宽断言):
文件 原断言 新断言 依据 pred-linof-ieee.test.tsy>1 ⊢ y+1>2truefalseBUG-200:136 触发形态; (1+2**-52)+1 === 2(ties-to-even)pred-assume-finite.test.ts同款truefalse同上 arithmetic.test.tsx>0 ⊢ x+1>1truefalseBUG-200:14-16,27,30;反例 Number.MIN_VALUEexample0.test.tscmp("gt", x+1, 1){ok:true,value:true}{ok:false}(另新增ge⇒{ok:true,value:true}、lt⇒{ok:true,value:false}对照)同上; {ok:false}是真·不可判定(Φ 内既有x=MIN_VALUE的 false 也有x=1的 true),「确定 false 可判定」的口径由新增lt断言单独钉住回归:
core-bug-077-rounding-preimage/core-bug-083-goal-const-cancel/core-bug-106-linforms-eq-ieee/core-bug-200-strict-endpoint-const-cancel(45 例)。 全量packages/core/src/algebra/__tests__:967 文件 / 10 368 测试 / 0 失败。未改动:
arithmetic/cmp.ts:88的造值点本身无错 —— 假事实消除后它自然不再折true。 遗留提示(docs 面,本轮未改):docs/design/cli-semantics.md:347、docs/examples/README.md:29、docs/examples/constraints/README.md:4仍把x>0 ⇒ x+1>1当示例口径。追加:BUG-005 / 006 / 224 / 225 / 010 已修(返回通道漏评 + 端点见证步进 + 项化简域守卫)
- BUG-005(
array(...)的长度界在返回位不执法 ⇒ 假绿):assertImpliesSingle的element分支只对账元素域就proved();array(...)/shape(...)无prim⇒ 约束自身的preds(ge(length(self), n))永远走不到assertScalar。修:新增assertStructuralPreds—— 结构对账 通过后只实例化约束自身的preds(摘掉fields/element/members/prim/fn,否则instantiateOnTerm的 fields 分支会把 preds 丢掉),把length(<返回项>)用已知结构长度 (tuple 元素数 / obj 自有非 internal/symbol/inherited 键数)接地后三值判定:真 ⇒ proved、 假 ⇒ disproved、接地不了 ⇒ unprovable(不再伪装 proved)。 - BUG-006(
lit(null)/lit(undefined)成员的 union 无法证违结构化返回值 ⇒ 只 warning):prim缺失让值相等义务落到「无证据」兜底,而 union 的「任一成员 unprovable ⇒ 整体 unprovable」 把已证伪的number()成员掩盖。修:isBoundedEvidenceMissing只对带界原子 (gt/ge/lt/le)保留「证据缺失」语义;新增valueEqualityDecidable——eq义务的字面量域与 返回项形状域不相交(结构形状 vs 任何字面量;prim vs 域外字面量 / nullish)即可判定 ⇒ 不蕴含即disproved。只认eq(ne在域不相交时是成立,纳入会造假红);同域eq仍是 unprovable(护栏有测试钉住)。 - BUG-224(端点合成丢「最紧可达值」⇒
(x+x)/2假红):Endpoint增加attain?,synthEndpoint用a.attain ?? nextUp(...);新增attainEndpoint只对可精确反解的缩放形态 给可达下界(t + t⇒2·nextUp(E/2);t × 2^k⇒k·nextUp(E/k),上侧对偶),在 mul/div 两端点调用点接入(addsub.ts未改:x+x的 attain 由调用点从分子结构与分子自身 strict 界反解)。 - BUG-225(
roundingAbs丢 strict 见证步进 ⇒Math.ceil假红):strict 端点做见证步进impl(nextUp(lo))/impl(nextDown(hi)),结果记「可达」(不透传 strict,否则会宣称ceil(x) > 1造成新的假红)。 - BUG-010(
simplifyTerm的x - 0 = x缺 number 域守卫):加与surviveMulOne同口径的 守卫 —— 非 number 字面量走 ToNumber("abc" → NaN、true → 1、null → 0、"5" → 5、undefined → NaN),bigint 混型保留原 app;非字面量项仍走x - 0 → x。
回归:
core-bug-005-*/core-bug-006-*/core-bug-224-*/core-bug-225-*/core-bug-010-*(38 例);gold 面check-gold/check-recall-gold/check-shape-gold/engine-depth-gold全绿(248 通过 + 1 expected fail)。既有测试零改动、零重钉。 未改:interface.ts的formatConstraint仍不渲染 array/shape 长度链(违例文案在 postcondition 侧本地补length(return) ≥ n)。追加:BUG-245 / BUG-246 已修(union 源不得重跑聚合谓词;可选槽吸收 undefined)
- BUG-245:
leqWithPred在leqShape的 sum 源分支逐成员跑过leqWithPred(m, tgt, …)(各自含leqPred)后,又在尾部跑一次聚合leqPred(src = sum, tgt); 而 sum 不带顶层 pred(makeSum与constraintToCaseArgAbs都不产)⇒ 聚合检查走「源无谓词」 分支 ⇒ 目标带谓词时即 false ⇒union(number().gt(0), number().gt(5)) ⊭ number().gt(0)—— 假红,且两侧渲染成同一文本。修:sum 源且自身无顶层 pred (!src.pred || src.pred.op === "true")时跳过聚合leqPred。该 pred 守卫是必要的:narrow.ts的{...a, shape: sum}会保留a.pred,真正带顶层 pred 的 sum 仍需聚合检查。 - BUG-246(两面根因):①
leq.ts的 obj 槽分支只对缺失槽认slot.optional, present-but-undefined直接进leqWithPred⇒undefined ⊭ string。改为一条对称规则: 目标可选 ⇔ 源侧「缺失或 undefined」可赋;源槽可选对 required 目标仍失败,纯undefined对 required 目标仍失败。②scan/literal-shapes.ts的checkShapeAgainstAbs才是nudo check侧nudo:constraint-violated的生产者(实测:对该夹具leqAbs调用 0 次,而同族的 BUG-245 夹具 3 次),它同样只对缺失槽认field.optional,随后 prim 门禁报typeof o.a = "string"—— 与签名面a?: string自相矛盾。修:同一共享判定。 共享 helper(leq.ts导出,不经algebra/index.ts再导出 ⇒ 无公共 API / 快照变化):isUndefinedAbs(本仓PrimName不含undefined;undefined是shape unknown + term lit(undefined))、mayBeUndefinedAbs(含 sum 成员递归;null排除, 对齐strictNullChecks)、nonUndefinedAbsValues(剥掉 undefined 臂,[]表示全 undefined)。 两处都先剥后执法,因此{a: number | undefined}对 optionalstring仍失败(未放宽)。
回归:
core-bug-245-union-source-leq.test.ts(7 例)、core-bug-246-optional-slot-undefined.test.ts(13 例:9 代数 + 4 L1 门禁);gold 面 331 通过 + 1 expected fail;public-api-freeze9/9。e2e:optional 夹具nudo checkexit 0 且无nudo:constraint-violated(tsc 亦通过),required 夹具 exit 1 且有该码(tsc TS2322)—— 引擎与 tsc 结论一致。三面同源:check-case-scan.ts的witnessViolations字段循环(@nudo:case见证面) 也改用同一判定;并补真 CLI e2ecli-bug-246-optional-slot-undefined.test.ts(optional 夹具 exit 0 且零nudo:constraint-violated、required 夹具 exit 1 且恰好一条、required + 合法值 exit 0)。追加:BUG-082 / BUG-058 已修(契约 ∪ 默认值域;
String()走 string hint)- BUG-082:契约路径把形参 Abs 整体替换成
constraintToEntryAbs(...),默认值初始化式从未参与 ⇒ 形参域被收窄、返回面随之收窄 ⇒pick(s = "abc")配fn({s: number()}, number())在被调方 判绿(OK, exit 0),而同一契约在零调用点面正确报红。修(section 方案 1):契约绑定时把默认值 类型并入形参定义域(契约域 ∪ 默认值类型;默认值落在域内时保持契约域原样 ⇒ 合法形态零变化)。 实现为generalize.ts内三个纯函数:defaultInitAbsOf(AST 字面量 → Abs)、fnParamNodesOf(按名取最浅层函数节点的形参 AST)、惰性闭包defaultInitAbsOfParam+contractDomainOf(leqAbs(initAbs, entryAbs)通过则原样返回,否则joinAbs)。冲突经既有 L1 返回契约对账 通道执法,未新增诊断码。局限(如实记录):只并入字面量初始化式,s = compute()这类不猜 (避免假红)。.d.ts可省性在 HEAD 上已正确(pick(s?: number)),本次用测试钉住其上游事实 (契约路径下formals[0]仍是{kind:"default", optional:true})。 - BUG-058:
isNullProtoWithoutCoercer是 ToPrimitive 前置闸门的统一调用面,却把 hint 写死"default";String()复用它而没传"string"⇒ 原生不调valueOf的路径被调(用户副作用 凭空多出)。修:isNullProtoWithoutCoercer(a, hint: CoercionHint = "default")(默认值保持"default"⇒+面调用点无需改动、语义不变),builtins/global.ts的String()改传"string";"string"hint 下无自有toString钩子时绝不回退valueOf;用户toString返回非原语时仍回退valueOf—— 这是 ESOrdinaryToPrimitive的规定(node 实测String({toString:()=>({}), valueOf(){c++;return 1}})⇒"1", c=1),删掉回退反而偏离原生。
回归:
core-bug-082-contract-default-param.test.ts(7 例)、core-bug-058-string-hint.test.ts(8 例)。CLI 取证:viaString() => 10变为=> 0(native 0),only-viaPlus.js仍=> 10(native 10)。同族仍未改:methods.ts的String.prototype.concat与模板插值的降级点 (${o}现被降级成$add($add($lit(""), o), $lit("")),与用户写的"" + o逐字同形 ⇒ 信息在 降级处丢失,需专用$toStrop)。追加:BUG-058 模板插值 /
String.prototype.concat面已修(专用$toStrop)${o}原先被降级成$add($add($lit(""), o), $lit("")),与用户写的"" + o逐字同形;而+必须用 default hint(原生"" + o会调valueOf)、模板插值必须用 string hint ⇒ 信息在降级处 丢失,无法靠调用点区分。修:exec/runtime/ops.ts新增$toStr(a)—— 走isNullProtoWithoutCoercer(a, "string")+invokeToPrimitiveHook(a, "string");Symbol⇒ 抛TypeError;字面量 ⇒ 字符串字面量;否则string()并记 may-throw。exec/transpile/expr/atom.ts的TemplateLiteral插值位包一层$toStr;exec/index.ts导出并 在runtime-import.ts的RUNTIME_IMPORT_NAMES登记。另:methods.ts的String.prototype.concat是 ToString 面,也改传"string"。回归:
core-bug-058-string-hint.test.ts扩到含模板插值与concat的副作用计数;coercion 家族 (concat-spreadable、eval-arith-coercion-throws、core-bug-381、core-bug-1121、core-bug-261/262/402等)221 例全绿。追加:
public-api.snapshot.json记录./exec新增的$toStr模板插值的
$toStrop 是./exec的导出(exec/index.ts),快照面必须同步记录——public-api-freeze的./exec分母因此从 208 变 209。该条目属于快照正常演进 (导出面确实多了一个算子),不是放宽门禁。 -
aed8e00: Fix bug-report category 03 (evaluation engine) — verified subset.
- BUG-194:
$copy/$seton a host global no longer crash the engine with a bare TypeError (nudo:internalfalse red); the fork/copy path handles host objects. - BUG-218: Proxy
hastrap gains the ES invariant check, so a trap that violates [[HasProperty]] is a definite TypeError instead of a false green, and the engine no longer prints afalsethe host can never produce. - BUG-219:
delete <host global>.x/"x" in <host global>route through$del/$incorrectly instead of raising a bare TypeError. - BUG-243:
Array.prototype.indexOfno longer clampsfromIndextolen - 1;fromIndex >= lengthreturns-1like the host (the siblinglastIndexOfclamp was already correct). - BUG-244: array-like receivers are no longer mis-reported as may-throw for
sort/reverse/copyWithin/fill, and a comparator returning bigint is recorded asTypeError(host kind) rather than a genericError. - BUG-249:
strictEqAbs's "same Abs ⇒ same value" fold now honours the domain-sharing gate, soxs[0] === xs[1]over a contract-typed array no longer folds totrue. - BUG-254: env-global injection no longer splices names verbatim into
letbindings, so a strict-mode reserved word can no longer produce anew FunctionSyntaxError that fails the whole module closed.
Regression tests:
core-bug-194-*,core-bug-218-*,core-bug-219-*,core-bug-243-*,core-bug-249-*,core-bug-254-*.Known follow-ups NOT covered here (still reproducing): BUG-072, BUG-073, BUG-078, BUG-159, BUG-162, BUG-166, BUG-173, BUG-175, BUG-177.
追加:本轮求值引擎修复
已修复(
tmp/verify-bug.shexit 1 的标注为脚本实证;其余为观察型 fixture,证据是 CLI 签名与回归测试):- BUG-004:类静态方法走
$staticInvoke(D.s1 => 42、D.instance => 7、D => D)。 - BUG-020 / BUG-180:
@nudo:mock作用域收回到声明它的函数(scopeSelectedInject按函数自身的 mock 表过滤),依赖包内的函数同理 ⇒fa() => { from: "A" }、fb()不再误用 A 的 mock、callMock() => "mocked"。既有负控制service-bug-455-mock-scope.test.ts原先钉住「非冲突 mock 是文件级」——与 BUG-020 声明的正确行为相反,已改写为按函数作用域可见。 - BUG-072:
definiteModuleThrowOf认确定性的装载期抛错(IIFE 抛、顶层调用恒抛的 本地函数、nullish 成员读取、非法JSON.parse字面量、类静态块抛)⇒ error 级nudo:module-throw;typeof missing/ 条件分支 / 可选访问的负控制保持干净。 既有core-bug-1158-module-throw-failclosed.test.ts的负控制原先断言JSON.parse("{")/ null 成员读取不得上报——同样与正确行为相反,已改写。 - BUG-073:
evalFallbackOf把用户代码的原生异常归类为module-throw(不再是internal),fallback reason 直接断言。 连带的口径收口(不是放宽断言):模块级原生异常此前会让分析器产出一条 error 级nudo:internal("analysis failed for … engine internal fallback"),现在它是可裁决 的nudo:module-throwerror ——nudo check依旧红、--json依旧ok:false+ error issue、IDE 面依旧可见(lsp-bug-140与nudojs-bug-1145两个回归用例已改到新码,契约文案随之更新)。nudo health的 判据是 drift / case drift / path error / internal 回落,「代码本身必抛」属于 check 的职责 ⇒ health 对该 fixture 报 OK(internal→ FAIL 的反向仍由unsupported:*负控制与 CLI 内部路径守住)。 - BUG-078 / 159 / 166 / 175 / 177:
renameAbs保留optionalParams/holes(稀疏元组仍不可赋给稠密元组);new Storage()不再自信地判成Storage品牌; 用户URL/Error/Map/Date/Promise类遮蔽宿主全局;instanceof的 Proxy/箭头/方法 RHS 产原生TypeError(生成器 RHS 仍是布尔);派生构造器返回对象 时derivedReturnObj => { q: 1 }且无 may-throw。 - BUG-160 / 162:
TextEncoder的encoding/encode/encodeInto齐备、TextDecoder.encoding => "utf-8";web env 保留Event/CustomEvent/Request, node env 诚实报never throws TypeError。 - BUG-165:零
TypeError/entry-may-throw噪音;迭代器 symbol 调用产出迭代器面。 - BUG-173:派生构造器
super()前访问this⇒ 原生ReferenceError(exec/super-access.ts的访问门,构造器体执行期登记)。 - BUG-215 / 216 / 217:不可调用的
@@iterator槽确定抛TypeError;可选调用只读 一次 getter(1,不是"two");计算键成员读走访问器(o[k]→42)。 - BUG-242 / 248 / 259:
indexOf(3,5) => -1/lastIndexOf(3,5) => 2;二元自递归 走解释路径 + L2 α 项剥离(bin => unknown+nudo:recursion-truncated,快且不 OOM, 线性对照不受影响);symbol 键读写(读1、计算写读7、getOwnPropertySymbols().length => 1)。
追加:BUG-172 / BUG-220 已修
- BUG-172(同名类跨模块互相覆盖):注册表本体仍按裸名键(进程级
Map,清理语义不变), 但类规格改为随值携带:exec/class-registry.ts新增classSpecByValue: WeakMap+attachClassSpec/classSpecOfAbs/carryClassSpec,EvalClassSpec.superSpec记录父规格。exec/class/declare.ts去掉私有classImpl表,$class把规格挂到类值、superSpec取自父值身份(不再按名),$new把规格串进 构造与实例,findMethod首链规格优先;class/super.ts仅在携带规格的name等于 当前子类名时使用它(否则派生链会误取最派生规格);runtime/members.ts新增classChainLinks(首链规格优先、其后名字链,保留既有 last-wins 语义);containers/member.ts的静态/实例成员与ownSpec规格优先;containers/obj.ts的 fork 快照分支携带规格。回归core-bug-172-class-registry-scope.test.ts:3 模块图,两边同名Config各读各的(readA()===1/readB()===2,互不可见,kindA/kindB正确)。 残留(已在 changeset 声明):只拿名字、拿不到接收者值的面(Object.prototype.*、Reflect、JSON、denote.ts)保持既有 last-wins 口径。 - BUG-220(无界迭代代表元素 + IteratorClose):无界分支的代表元素由
「第一个具体元素」改为已收集元素的 join(
abstractIterItem+UNBOUNDED_ITEM_JOIN_CAP = 8;空集/超限 ⇒unknown),且在无界步之前只提升一次 ⇒ guard 不再被折叠成确定 false,break臂得以探索。IteratorClose经复核无需改动 (catch→isNudoBreak→iteratorClose(userIter)已可达,return()的写入能到达 循环出口)。回归core-bug-220-unbounded-iterator.test.ts(5 例:复现改"CLOSED"、 有界 break/自然耗尽、精度不受损、元素域为unknown而非字面0、两分支都探索)。 残留(代码内已注明):元素域永不满足 break 条件的无界迭代器仍分析成"CLOSED" #exact; 要让closed进循环 pack 需要把写改到循环体内,与验收口径冲突,故不做特例。
追加:回落分类改为「标签 × 来源 × 可见性」三维(BUG-073 收口)
EvalFallback现带origin("engine" | "host" | "module")与gateFatal(可见性):- 标签(
reason):module来源(transpiled 用户代码)⇒module-throw(BUG-073: 用户代码的原生 ReferenceError / TypeError 是程序自身抛,不是「引擎缺陷」);host(宿主apply钩子 / 宿主函数边界)与engine(引擎自身违约:编译体生成失败、 引擎产出非 Abs 值)⇒internal(DEC-006 canary 保留)。 - 可见性(
gateFatal):装载期逃逸 ⇒ 闸门无法裁决该文件 ⇒true(tryRunTranspiled/tryRunTranspiledDetailed/ 模块求值 catch 标{ loadFailure: true });能力边界unsupported:*与建模内的NudoThrow⇒false(不得假红);调用期异常 ⇒false(该次调用的throws面承载)。 runExportCallGuarded的 Abs-fn 分支按getFnImpl(fn)?.apply ? "host" : "module"传来源, 与$callDispatch的派发顺序(apply 先于编译体)一致;body-fn.ts的编译失败改记engine(否则 transpiler 失败会被误贴成用户代码的抛)。
run-export-guarded中一条既有断言钉的是internal ×1,与 BUG-073 直接冲突(编译体自由名 的原生 ReferenceError 是用户代码的抛)⇒ 重钉为module-throw ×1,并改成两个维度各 断言一条(internal 增量 0 / module-throw 增量 1);可观测面(result unknown + throws ReferenceError)不变。回归修复:
nudo health与nudo check的预算归因必须同源同一文件在
nudo check --json与nudo health两面必须给出同一预算归因(既有health-budget-truth断言)。根因:自递归「有界试算」
runEvalCallBudgetTrial用一次性预算实例跑探针,探针撞 depth/calls 时结果被丢弃(调用方回落 fail-closed),而「撞了预算」这件事只随探针实例一起 被丢弃(withSpeculativeEvalObservability还把截断观测静默了)⇒ 宿主预算面上只剩旁证的 cycle 归因:health 报「call cycle — not a budget limit」,而 check 面(证据域真跑到 64 层)报 「eval depth 64/64」——两面口径分裂,且把「抬@nudo:budget有效」的深递归误报成「抬预算也 解不开的环」。修法:探针截断后把「撞了哪条预算」重新记账到宿主预算实例上 (
CallBudget.noteTruncation,仅类型成员、无新增导出名 ⇒ public API 冻结不变)。 计数/上限取宿主实例的生效上限(@nudo:budget覆盖期间取覆盖值)——试算内部阈值 (depth=5 / calls=512)是实现细节,不上屏。状态机补 calls 截断现场(callsTruncCalls/Limit), 上屏计数必到顶,不出现「3/20000 却标 truncated」。重新记账只进预算面(实例 reasons + 共享原因集),不触发诊断 collector —— 诊断归因(cycle vs 预算,#158)仍由真正跑那条求值的 路径上报,否则会把service-bug-099钉住的 cycle 归因改写成「抬预算可解」。是否有重钉:无(未改任何测试断言)。
残留:① 诊断面措辞仍按各自求值路径分脸(分析器面 cycle / check 面 depth)——HEAD 既有 差异,本次刻意不动;② 重新记账的 depth 取宿主生效上限而非探针阈值;③ 探针阈值 (
generalize.ts,depth=5 / calls=512)未动 ⇒ 收敛半径 6..64 的自递归仍 fail-closed。 - BUG-194:
-
e4190b5: Fix bug-report category 04 (core builtins / collections) — 17 of 26 defects.
- BUG-007: a primitive's prototype method dispatches correctly instead of being reported as absent.
- BUG-008:
Object.getOwnPropertyDescriptor(fn, ...)models a function's ownname/length/prototypeslots. - BUG-009: a regexp literal's flags are canonicalised, so
/a/giand/a/igagree. - BUG-132: a boxed primitive's internal slot is modelled.
- BUG-157:
URLSearchParamsentries()/keys()/values()are no longer reported as carrying an internal slot. - BUG-164: the
Object.prototypelegacy accessor allowlist and the descriptor table are now the same source of truth. - BUG-176:
Reflect.constructon a user class is no longer reported as may-throw. - BUG-181:
Reflect.setwith a primitive receiver is a definiteTypeError, not a false red. - BUG-182: a host function's constructibility facet is decided by IsConstructor, not by
the presence of a
prototypeproperty. - BUG-230 / BUG-260:
Set/Mapcardinality from an abstract iterable is no longer a definite value, andMapTablecarries insertion order so key iteration matches the host andnew Set(xs).sizeagrees withArray.from(new Set(xs)).length. - BUG-276: class-instance enumerable flags are correct, so
getOwnPropertyDescriptor/Object.keysagree with the host. - BUG-277: a builtin brand's user-defined keys are enumerated (
entries/getOwnPropertyNames/getOwnPropertyDescriptors/JSON.stringify). - BUG-278: an
Errorsubclass's inheritednameordering matches the host. - BUG-281:
getOwnPropertyDescriptorson a brand instance matcheskeys/values. - BUG-282: a nested same-name
@nudo:casescope resolves to the nearest binding, and shape contracts fall back to a prototype-chainHasPropertycheck.
Regression tests:
core-bug-{007,008,009,132,157,164,176,181,182,230,260,276,277,278,281, 282}-*(16 files / 106 tests).Known follow-ups NOT covered here (root cause outside this category's file set): BUG-058, BUG-130, BUG-131, BUG-160, BUG-165, BUG-167, BUG-174, BUG-258, BUG-275; and BUG-163's
toJSONhalf (needsexec/runtime/members.tsBUILTIN_BRAND_METHODS.URL— itshosthalf is fixed and tested).追加:本轮内建面修复
已修复(带新回归测试):
- BUG-163(
toJSON半边,至此完整):BUILTIN_BRAND_METHODS.URL增加toString/toJSON,BUILTIN_BRAND_ACCESSORS.URL补组件访问器 ⇒urlToJsonIsUndef() => false、urlToJsonIn() => true(修复前true/false)。 测试:core-bug-163-url-tojson-brand-face.test.ts。 - BUG-174:
TextDecoder构造参数按宿主顺序校验(label 的 ToString → options 字典 → label 查找),抽象 prim / 全 prim 联合的 options 确定抛TypeError,any只记 may-throw。测试:core-bug-174-textdecoder-options.test.ts。 - BUG-183:
btoa/atob缺参确定抛TypeError(其余 6 个全局函数保持把缺参当undefined)。测试:core-bug-183-btoa-atob-missing-arg.test.ts;tmp/verify-bug.sh BUG-183→ exit 1。 - BUG-275:
Object.create(proto)的基对象镜像 proto 自有槽为Slot.inherited(只表示存在性,值为unknown),自有键视图(Object.keys/values/entries、for-in、 spread、JSON)排除inherited⇒ 与原生一致。测试:core-bug-275-object-create-inherited-slot.test.ts;verify-bug.sh BUG-275→ exit 1。
追加:BUG-167 已修(构造点对齐 facet + 投影面读域判定)
- BUG-167:两个
$fnVal构造点(ObjectMethod简写与方法型FunctionExpression)改为发effectFree/closedfacet(getFnFacets静态保守判定,与expr/function.ts:366-373同口径) ⇒ 同一函数体写成方法 vs 写成函数字面量,在 sort 比较器闸门、promise 回调、访问器纯度判定上 不再得出相反结论。叠加的第二处根因:Object.defineProperty(o,k,{get})装的访问器占位槽是unknown,而三个投影面(format.ts、denote.ts、service/emit/dts-generator.ts#slotAbsOf) 会无条件执行用户 getter,把分析期末次读值冻结进签名与 guard ⇒ 签名自信错值、data.b === <literal>恒假。修法:投影面加读域不可判判定(占位槽无 term ⇒ 不执行 getter,presence-only)。判据必须用term === undefined而不是shape.k === "unknown"——$lit(void 0)的shape.k也是"unknown",按 shape 判会把所有访问器判死(首版即此错)。 回归core-bug-167-side-effect-getter-not-frozen.test.ts(10 例,含 Bug 191 / 152 的负控制); 验收组 11 文件 / 148 例全绿(含eval-call-position、eval-match-json-view、exec-join-accessors、exec-define-property-accessor)。 残留(如实记录):对象字面量get访问器的占位槽必须是$lit(void 0)(Bug 191 的读域投影 与 Bug 152 的调用点求值序钉住它,换$unknown()会同时打红两处),彻底修法需在 slot 上引入 显式「读域不可判」标记(abs.tsslot 类型 +exec/runtime/state.ts的$set选项 +descriptor.ts写入);projection.ts(zod / standard-schema 经absToConstraint取读域) 同样仍是执行 getter 的老路。BUG-167 section 的验收 repro 是Object.defineProperty形态, 本修复已覆盖。 - BUG-258(facet 已落地,投影面见 cat-05):数组视图信息原先由
builtins/regexp.ts的WeakSet侧表(按 Abs 身份)承载,只有Array.isArray/ JSON 序列化 / 数组方法派发消费,类型面 看不见。修:abs.ts的{k:"obj"}形状增加view?: "array"facet +markArrayView/isArrayView(不导出到公开面 ⇒ 快照零变化;markArrayView是替换 shape 而 非就地改共享 shape),regexp.ts删除侧表、markMatchArrayView/isMatchArrayView降为薄包装, 消费面(array.ts/json.ts/member.ts派发)只读 facet;运行形状仍是k:"obj"(未改 tuple) ⇒eval-call-position.test.ts:344-350的渲染钉不变。回归core-bug-258-array-view-facet.test.ts。未完成:dts / zod / standard / guard 四个产物面尚未按shape.view === "array"分支;多 case join 时joinObjects重建 shape 不带view(需一侧传递)。
-
6daa52e: Fix bug-report category 05 (rendering / projection / emit generators) — 11 of 17 defects.
- BUG-025: the standard-schema
promisenode testsinstanceof Promisein both the library and the inlined copy, so a non-promise value is rejected instead of accepted. - BUG-031:
litPredValuebecamelitPredValuesand recognisesor(eq(...arm), ...), so a literal-union contract renders as1 | 2 | 3in the signature face, matching the dts face byte for byte. - BUG-087:
showLitsrenders the type (3,"a") instead of leaking the contract DSL spelling (lit(3)) into signatures and slot displays. - BUG-092:
predAsJs/termIsValueemitNumber.isInteger(v)for a%1 === 0predicate and compare field items by value, so nested numeric bounds agree across all four faces. - BUG-095: the
arrbranch usesArray.from(v).every(...)(holes filled withundefined), matching the standard face —[1, , 3]is no longer accepted by the guard. - BUG-097: a slot named like an
Object.prototypeown member is read with bracket access, so the guard compiles undertsc --strict(TS2367 gone). - BUG-098: the
brandbranch drops observed literals deeply, so a brand built from an observed/abc/iornew TypeError("boom")accepts the real value. - BUG-145: a same-name slot produces no inlay hint (it previously rendered another binding's derivation).
- BUG-147: inlay hints cover anonymous default exports (arrow, function expression, and
a
FunctionDeclarationwithout an id). - BUG-158: an
Argumentsbrand no longer emits anArray.isArraypremise while keeping its length/index semantics, so the guard acceptsargumentsat runtime. - BUG-250: the guard declares
const data: anywhen the contract carries an identity clause, soinstanceofnarrowing no longer blocks index reads (tsc --strictTS7053 gone).
Also updates
core-bug-348-lit-literal-signature.test.ts, which pinned thef(x: lit(1))spelling that BUG-087 declares wrong, to the correctedf(x: 1).Regression tests:
core-bug-{031,087,092,095,097,098,145,147,158}-*,service-bug-{025,250}-*.Known follow-ups NOT covered here (root cause outside this category's file set): BUG-091 (needs
lsp/src/lsp-surface/completions.ts), BUG-096 (needsschema-generator.ts), BUG-108 / BUG-169 (needdts-generator.ts+schema-generator.ts), BUG-156 (needsschema-generator.ts), BUG-191 (needsdts-generator.ts:1986-1995).追加:BUG-096 / BUG-169 / BUG-191 已修 + BUG-258 的 facet 与投影面
- BUG-096(键存在性三面不一致):zod 面原生用
key in data(含Object.prototype成员), guard / standard 面减污染键 ⇒Object.create({toString:"s"})在 zod 面被放行。反向改 guard/standard 会改hasPropertyClause的子句文本,而该文本被eval-bug-191-accessor-projection与eval-bug-240-guard-internal-slots逐字钉住 ⇒ 只能把 zod 面补齐:schema-generator.ts对「必填且键名是Object.prototype自有成员」的槽追加.superRefine(沿用同文件__proto__槽的既有模式),子句与 guard 逐字同口径;非污染键不加码(z.object原生判据已与另两面等价)。 同时修正三处自述注释(denote.ts/standard-schema.ts/ 产物__nudoHasProperty)为「三面唯一 规则」。guard / standard 的代码未变。回归service-bug-096-key-presence-parity.test.ts。 - BUG-169(TS 可选形参
b?: T丢失):?在 strip-types 阶段被删(param 节点optional为undefined),formalParamsFromNodes的kind:"id"硬写optional:false;dts 的declaredParamscase"id"硬写hasDefault:false;standard 只认kind==="default"。 修:param-surface.ts的formalParamsFromNodes(params, source?)末尾接withOptionalParams(out, tsOptionalParams(params, source))(无 source 时集合为空 ⇒ 零行为变化,generalize.ts/exec/transpile等未传 source 的调用点不受影响);dts-generator.ts的case "id"改hasDefault: f.optional === true;standard-schema.ts的declarationOptional认kind === "default"∪ (kind === "id"&&optional)。服务面extractFormals(node, source?)与 3 处调用点只做 source 透传(无语义改动)。回归emit-bug-169-ts-optional-params.test.ts(差分口径:三面可省性 ≡ 源码 JS 默认值 ∪ TS?)。 - BUG-191(
export namespace缺失):scan-named-exports.ts的ExportNamedDeclaration声明分支只认 Function/Class/Variable ⇒TSModuleDeclaration落continue被静默丢弃;dts-generator.ts同款缺口且从不发射 ⇒ 消费端 TS2305,而求值器确实物化了NS。修:scan-named-exports.ts新增TSModuleDeclaration分支(登记NS+ 运行时成员键NS.x/NS.f/ 嵌套NS.Inner.y;interface / type 是纯类型不登记,addNamespaceMemberKeys只认export过的成员);dts-generator.ts增加namespaces面并发射export declare namespace NS { … }+ 别名导出(class 发空体;enum/interface/type 镜像原文; 嵌套递归;namespace A.B认尾段)。回归emit-bug-191-export-namespace.test.ts。 - BUG-258(数组视图 facet):数组视图信息原由
builtins/regexp.ts的WeakSet侧表(按 Abs 身份)承载,只有Array.isArray/ JSON 序列化 / 数组方法派发消费,类型面完全看不见 ⇒ 同一个值在 引擎内两个结论。修:abs.ts的{k:"obj"}形状增加view?: "array"facet +markArrayView/isArrayView(不导出到公开面 ⇒ 快照零变化;markArrayView是替换 shape, 不是就地改共享 shape);regexp.ts删除 WeakSet 侧表,markMatchArrayView/isMatchArrayView保留同名同签名降为 facet 薄包装;消费面(array.ts/json.ts/member.ts派发)只读 facet。 运行形状仍是k:"obj"(未改 tuple)⇒eval-call-position.test.ts:344-350的"0":"b"/index:1/input:"abc"仍成立。回归core-bug-258-array-view-facet.test.ts。 未完成(已定位):四个产物面(dts / zod / standard / guard 的 obj 分支)尚未按shape.view === "array"分支;多 case join 时joinObjects重建 shape 不带view,需一侧传递。
追加:BUG-258 四产物面 + BUG-169 zod 面
- BUG-258 产物面(facet 本体见 cat-04):guard 面(
denote.ts)obj 分支改判shape.view === "array"⇒Array.isArray(v)(取代typeof/object+!Array.isArray;槽判据一字 未动 —— exec 结果的0/1/length/index/input/groups全是自有属性);dts 面 (dts-generator.ts)数组视图投影成元组 + 其余自有槽的交集(length由元组隐含),widenParamAbs透传viewfacet(否则形参位会退回对象字面量);zod 面 (schema-generator.ts)SchemaNode.obj增arrayView?: boolean,渲染z.tuple(...)(z.object会拒真实数组),非下标槽记台账non-index slots not validated by z.tuple; standard 面(standard-schema.ts)库函数版与产物版都要求Array.isArray(value),arrayView随节点序列化,产物类型别名NudoSchemaNode补arrayView?: boolean—— 这是修产物类型,不是放宽emit-bug-519-989的 strict 编译门禁。 - BUG-169 zod 面:
nudojs/src/commands/export/contract-face.ts的unifiedParamFace常规形参 分支改为formal.optional === true || formal.kind === "default" || formal.index >= minArity——FormalParam.optional(已接通 TS?)成为唯一事实源;无?的声明仍按观测最少实参元数放宽。 回归用「一键实参」观测把minArity钉在 1,使下标 1 的可省性只可能来自 TS?。
回归:
core-bug-258-array-view-facet.test.ts(6 例)、service-bug-258-array-view-products.test.ts(5 例)、emit-bug-169-ts-optional-params.test.ts(5 例);service/src/emit/__tests__114 文件 / 798 例、core algebra 973 文件 / 10 431 例、 service 242 文件 / 1 318 例全绿。残留:多 case join 的joinObjectsfacet 传递(objects.ts)。 - BUG-025: the standard-schema
-
206713f: Fix bug-report category 06 (directive system) — 5 of 7 defects.
- BUG-013: the scope-boundary guard no longer aborts at the walk root, so a bare-block annotated statement is replaced instead of falling through to a false "matched no expression" warning; the diagnostic now distinguishes "blocked by a nested scope" from "no such expression".
- BUG-086: orphan diagnostics for inline directives are reported per instruction (with the right line/column) instead of being swallowed by a global orphan counter.
- BUG-184:
@nudo:replaceonly matches value-slot expression nodes; binding and key positions fall through to the "matched no expression" warning instead of being transpiled. - BUG-195: an in-body
/// @nudo:importline comment is now reported as misplaced (it previously fell into a silentcontinue). - BUG-283:
@nudo:skip(and the@nudo:puresibling) bind to the shallowest same-name scope instead of the last writer, so an inner function can no longer steal the outer one's skip and an inner-only skip can no longer erase the exported function'sthrowsannotation.
Regression tests:
service-bug-013-*,service-bug-086-*,service-bug-184-*,service-bug-283-*,parser-bug-195-*.Known follow-ups NOT covered here (blocked on core/service call sites outside this category's file set): BUG-020 and BUG-180 (
@nudo:mockscope degrades to file level when there is no same-name conflict) needcore/src/algebra/generalize.ts(scopeSelectedInject/hasMocks),core/src/algebra/check-may-throw.ts(evalThrowsOutcome) andservice/src/abs-modules-graph.ts(evalDep).追加:BUG-080 已修(
@nudo:as在解构声明上被静默丢弃)根因:
exec/transpile/stmt/statement.ts的emitVariableDeclaration里asVar(matchAsOverride(stmt)的结果)只在 Identifier 分支被消费,解构分支(d.id非 Identifier) 从头不读它 ⇒ 覆盖被静默丢弃;而指令本身采集正常(VariableDeclaration是语句,isDirectiveCarrier = isStatement)⇒asTargets非空 ⇒ 连 orphan 诊断都不触发 ⇒ 彻底静默、零诊断。修法:解构分支与 Identifier 分支同口径消费
asVar—— 覆盖值取代 init 的值,原 init 仍求值 (((initSrc), asVar)逗号表达式 ⇒ 副作用与 throws 域保留;@nudo:as是类型覆盖不是求值替换)。 随后emitDestructure照旧逐项$get/$idx,读到的自然是覆盖值 ⇒ 每个绑定按源键(对象模式)/ 位置(数组模式)取自己的槽;改名 / 默认值 / rest / 嵌套模式全部走原生语义,无特判。回归
core-bug-080-as-destructure.test.ts(8 例):对象 / 数组模式、改名绑定、Identifier 对照不退化、 无指令与未标注声明的负控制、原 init 的副作用保留、原 init 的throws域保留;捕获力已实证 (回退该行 ⇒ 前 3 例失败)。循环头解构(
for (const {a} of xs))上的@nudo:as没有 initializer(for-of 头不经emitVariableDeclaration,而是在emitForOfStatement内直接调emitDestructure)⇒ 该形态不施加覆盖, 改为发一条显式nudo:directive-syntax(详见下文「BUG-080 残留收口」)。BUG-080 残留收口:解构子名进绑定表 + 不可用的
@nudo:as载体显式诊断上一节记录的两处残留已收口:
残留 A(假绿)—— 解构声明的子名此前不进顶层绑定表(
$recordBinding只在 Identifier 分支登记)⇒ 该名字在别处被当作实参时解析不出类型 ⇒checkSource的varAbs查不到 ⇒ 调用点的契约检查被整条跳过 ⇒ 同一份值走 Identifier 形态会报nudo:constraint-violated,走解构形态一声不吭。 同一张表还喂collectAbsBindingsFromGraph(hover / IDE 绑定)与mock-abs.ts⇒ 解构名在那些面上也没有 Abs。修法(
packages/core/src/algebra/exec/transpile/stmt/statement.ts的emitVariableDeclaration): 解构分支按 Identifier 分支同口径登记绑定名($recordBinding(name, name),取自collectPatternNames)—— 只限顶层 depth 0;块内 / 形参 / catch / for 头不是顶层绑定(作用域正确)。 覆盖对象 / 改名 / 数组 / 嵌套 / rest / 默认值 / export 包装全部走原生语义,无特判。残留 B(静默)——
@nudo:as标注在无适用目标的语句上时被静默忽略:matchAsOverride只在emitVariableDeclaration与emitReturnStatement被询问,而指令采集接受任意语句 ⇒ 标在 for 头 / for-init / if / 表达式语句 / 函数声明上的@nudo:as被采集却施加不到任何东西 ⇒ 类型不变 + 零诊断(假绿)。 修法(packages/service/src/eval-injection.ts):目标形态白名单 =VariableDeclaration/ReturnStatement/ExportNamedDeclaration(其declaration是变量声明);不在白名单 ⇒ 发一条既有的nudo:directive-syntax(warning 级,不制造假红)且不登记覆盖目标。重钉:无。
文档:
packages/website/docs/concepts/directives.md(§@nudo:as)与 zh-Hans 镜像补两句 —— 解构声明受支持(覆盖施加在初始化表达式上,每个解构名各自绑定推断类型);其它语句形态上不再静默, 而是报nudo:directive-syntax。残留:无。上一版这里写「LSP agent 面采集内联指令时没有诊断通道 ⇒ 新诊断在 IDE 面不可见」—— 实测不成立:
nudo:directive-syntax经check-issues.ts的collectEvalReplacements(source, { diags })→directiveDiagIssues()进CheckIssue,由 LSP 编辑面(validation.ts的collectCheckSupplementIssues→checkIssueToLspDiagnostic,warning 级、source: "nudo-check") 与 agent check 工具(agent-tools.ts的 check 工具)都会发布;只有buildLspInjection()(hover / 补全的注入表装配,不是诊断面)不带 diags 汇。新增回归lsp-bug-080-directive-syntax-ide.test.ts钉住:非法载体(表达式语句 / 函数声明)在编辑面与 推送面各恰好 1 条nudo:directive-syntax(warning、不重复),合法载体(变量声明 /return) 0 条(负控制)。 -
0650ef0: fix(service): 分析器 / 模块图 / 缓存面(BUG-011/012/070/089/101/127/129/139/152/170/171/205/206/207/238/239/240/241/267/268/269/270/273)
模块解析与缓存:
- BUG-238/240 — 裸包
import的 spec 现在携带mode并解析到真实文件(而非包名占位),模块图边与调用点记录据此建立。 - BUG-239 —
exports条件键按 package.json 声明顺序求值;browser仅作兜底,不再无条件优先。 - BUG-267 — pattern 键按 Node
PATTERN_KEY_COMPARE取最具体匹配(./x/*vs./x/*.js)。 - BUG-268 — 裸包解析在最近的已存在
node_modules停止;未命中的exports不再被上层包无声清空为exportsUnresolved=false。 - BUG-269 — 歧义
export *名称不再导出;导入方得到nudo:missing-export,与 Node 的「模糊即不存在」一致。 - BUG-270 —
exports数组回退只发生在 target 非法时;合法但文件缺失是终止态(ERR_MODULE_NOT_FOUND)。 - BUG-273 —
esm目录导入不再猜测index.*;legacy main保留该行为。 - BUG-241 — 磁盘缓存键的入口维度带项目根指纹,依赖维度仍可移植(跨项目不再互相污染)。
- BUG-012 — 函数缓存
envKeyFn补上@nudo:env内容指纹,与另外两层缓存口径一致。
调用点与报告:
- BUG-070/170/171 — 同名调用点仅在冲突时加列号(
call@L6C9);--from目录与重复调用点在合成前去重(先解析再按站点点位去重)。 - BUG-089 — 仅当本文件在该行列确实存在调用表达式时才附加
callSiteFile。 - BUG-127 —
dedupeCallRecords的键纳入调用点身份,不同站点的同名调用不再互相吞并。 - BUG-205 — 期望值判定统一走共享
inferenceFailed,并检查term:lit(null)/lit(undefined)是 exact,不是第三种「推断失败」态。 - BUG-206 —
never期望不再走「满足」短路。 - BUG-207 — 嵌套槽位谓词(
shape({ n: number().gt(0) }))参与判定并按递归formatExpected渲染;CLI 报告面改用 service 的formatExpected。 - BUG-011 — 空调用记录不再解引用
deduped[0]。 - BUG-101 —
isNudoTargetPath接受.cjs/.mts/.cts(排除.d.mts/.d.cts),migrate retire的nudo check .与VERIFY_TARGET_EXTS对齐。 - BUG-129 — 空
--from目录报nudo:path-empty-dir。 - BUG-139 — 静态成员扫描白名单化节点类型,
ClassProperty不再被当作方法。 - BUG-152 — 匿名
export default class注册到default槽位。
已更新的既有测试(原断言钉住声明的错误行为):
service/src/__tests__/resolve-npm-exports.test.ts— 数组回退改为「首个合法 target 即终止(即使文件缺失)」。service/src/__tests__/disk-cache.test.ts— 入口缓存键带项目身份,依赖键保持可移植。service/src/__tests__/target-path.test.ts—.cjs由拒绝改为接受,新增.mts/.cts。
已知未修(根因在本类文件之外,另行跟踪):BUG-019(行号重映射在
emit/case-emitter.ts)、BUG-022(entry 结算重入语义未定)、BUG-045(CJSmodule.exports成员导出面)、BUG-069(生成比较在emit/case-emitter.ts)、BUG-085(withAssumePremises未从 core 导出)。追加:本轮分析器面修复
- BUG-022:
settleEntryOnlyCandidates不再删除注册表条目;记录增长时先摘掉上次合成的 case 再按全量记录重合成 ⇒ 调用点先出现f(3)与后出现f(3)得到同一组见证 (3 witnesses,call@L5/8/11)与逐字节相同的--emit --dry-run契约。 测试:service-bug-022-callsite-domain-order.test.ts。 - BUG-045:
tryEvalCallFull走 core 的 cjs-member 语义(对exports["default"]做$invoke),并在合成调用记录里过滤无位置记录 ⇒obj.js(module.exports = {…})与dot.js(逐成员导出)在 dts/schema/guard 三面逐字节一致(dts 由unknown→number | string)。测试:service-bug-045-cjs-object-export-member、cli-bug-045-cjs-object-export-face。 - BUG-099(递归 / fork 两臂):分析器为整轮装截断收集器(串到
eval-run的嵌套 collector,否则单槽会被静默覆盖),标签映射到nudo:recursion-truncated/nudo:fork-truncated,文案与check同口径 ⇒nudo test与--json(summary.diagnostics)都可见。测试:service-bug-099-*、cli-bug-099-*。 循环臂(nudo:loop-truncated)此前缺 core 导出,现已补LOOP_TRUNCATION_LABEL(@nudojs/core/internal),接线待做。 - BUG-069 的发射侧(见证等价按「文件 + 实参载荷」)已由 emit 类修复并回归;
本条未修的是 CLI
--freeze新增模式的坐标(见 BUG-019)。 - BUG-085 已修:
runAbsView现把extractAssumeSegs的ok段折进前提槽 (withAssumePremises,不是phi),详见 cat-09 changeset。 - BUG-099 循环臂已修:
truncationDiagnostics增加label === LOOP_TRUNCATION_LABEL分支,且必须排在label.startsWith("#")兜底之前(兜底会把#loop-iterations静默吞掉)。nudo test/--json现报nudo:loop-truncated,文案与check面逐字一致 (「A loop did not terminate within its iteration budget …」),anchor 为文件起点 1:0 (事件不带函数归属,check 面同样无位置)。回归:service/src/__tests__/service-bug-099-loop-truncated.test.ts。 注:loop 迭代预算不在@nudo:budget覆盖范围内,故建议文案不提该指令。
追加:可见性判据(
gateFatal)与./internal快照analyzer-orchestrate.ts的 per-file 失败信号判据改为f.reason === "internal" || f.gateFatal === true(标签 ≠ 可见性):BUG-073 把装载期 逃逸改标module-throw后,原判据(只收internal)会让evalFailures变空 ⇒ 闸门丢掉 「模块装载失败 ⇒ 不得判绿」(BUG-072)。三条假红防线(unsupported:*/ 建模内NudoThrow/ 干净文件)不变。service/eval-run.ts的「引擎产出非 Abs 值」回落改传origin: "engine"(引擎自身违约 ⇒internal,与该 guard 的既有语义一致)。packages/core/public-api.snapshot.json追加 4 个./internal导出(引擎机件面,语义上 允许 minor 变动):LOOP_TRUNCATION_LABEL、extractAssumeSegs、isPointConstraint、widenObservationAbs,以及类型AssumeSeg;public-api-freeze测试随之复绿。
- BUG-238/240 — 裸包
-
fe03e18: fix(service): emit / 接口派生面(BUG-003/021/032/040/041/043/079/107/192/203/214/232/233/266/271/272)
- BUG-214 — 仅当全部用例都是
callsite时,主签名对观测返回值做widenObservedReturnAbs;entry@/ 指令用例保留嵌套精度(既有 Bug-565 引脚不变)。 - BUG-232 —
export --out下相对 specifier 按 outDir 重写(新增可选ExportArtifacts.sourcePath);moduleKey仍与路径无关,BUG-016 语义不变。 - BUG-233 — 导出「阻断」判定对齐
EXPORT_BLOCKING_CODES,不再只看severity === "error"。 - BUG-266 — 派生
.nudo.ts侧车写入前补 builder 声明(TS 侧车),复用coreExportNameOf。 - BUG-271 — 侧车 builder 可用性按 core 导出名 比较(
import { lit }不再豁免),必要时生成别名_nudo_lit与declare const … litC。 - BUG-272 — draft 的 builder import 扫描改为调用位匹配
(?<![\w$])b\s*\(,字段名不再误命中。 - BUG-192 — 类型注解先前丢弃任何含
/或换行的注解;现折叠换行,仅拒绝真正的注释标记(//、/*)。 - BUG-203 — Zod
.min()/.max()为码点计数,改为refine(s => s.length >= n)对齐 UTF-16(guard / standard / contract 一致)。 - BUG-003(部分)— 类构造器 / 静态参数未受约束时输出
any(而非unknown),与nudo check及 CLAUDE.md 口径一致。 - BUG-021 — 点观测不再直接成为契约:
widenObservationAbs后再joinThenProject;不可表达的联合保留原始投影兜底。 - BUG-032 —
absToSchemaNodeB增加 bigint 分支(z.bigint()),并去掉「已丢弃」账目。 - BUG-040 — draft 选择与
contract-draft.ts守卫均按 导出名 比较;--fn totallyMissing仍为用法错误(exit 1,不落盘)。 - BUG-041 — 派生段 label 改为包根相对(回退 basename),并以
labelKey()统一身份,旧拼写去重而非并集。 - BUG-043 — 侧车解析错误重新抛出时带侧车路径(原带路径分支为死代码)。
- BUG-079 —
combinedAbs == null的跳过分支改为输出(...args: unknown[]): any,不再整条导出消失。 - BUG-107 —
declaredParams的pattern分支读取FormalParam.optional;pattern + 默认值渲染为_p0?: T,绑定模式名仍必填。
已更新的既有测试(原断言钉住声明的错误行为):
emit/interface-emitter.test.ts(BUG-021,2 处)emit/emit-bug-514-…-dts-export-surface.test.ts(BUG-003:constructor(v: unknown)→any)emit/schema-bug-1046-bigint-literal.test.ts(BUG-032:观测 bigint 由unknown→prim bigint)emit/schema-bound-anchor.test.ts(2 处)、emit/schema-generator.test.ts(1 处)(BUG-203)
未修:
- BUG-196 —— 本夹具不再复现,但当时不是真修:
bar因 BUG-041 的 label 身份变化被报为not_projected,双写者未消除。已由后续轮次收口:CLI / LSP agent 面的根侧车单写者(finalContent+baseContent+skipWrite+directSections)见 cat-11 changeset;LSP add 面新建段并溯源行常用的directCreatedSections见 cat-14 changeset(本文件同属@nudojs/service的发射面)。 - BUG-035 —— 排除无断言
@nudo:case见证会改变契约产物;5 个既有 emit 测试钉住「指令用例 → 字面量契约」,属产品决策。 - BUG-168/189/190 —— 需把
DtsModuleSurface贯穿computeMainSignature/tsParamAnnotation,并改造dtsExportNameOf的返回形状(跨切面)。 - BUG-055/068/074/076/081/093/094/109/119/135/151/197 —— 未开始;其中 BUG-074 的扁平
export default function形态被core-bug-435、emit-bug-514、export-dts-evidence钉住。
追加:观测拓宽改为「点域」判据(BUG-021 的收口)
初版
projectFunctionDsl()对每个 callsite case 无条件拓宽再 join ⇒ 多值 观测域也被塌成number()(area(1); area(-2)写不出union(lit(1), lit(-2))), 与 drift 对账面(core/src/algebra/check-interface-drift.ts)的域判据分叉 ⇒--emit之后 health 恒报漂移(BUG-199)。现改为先 join 后判点:
isPointConstraint(core,与 drift 共用)为真才拓宽, 多值观测域保留字面量并集;带断言的@nudo:case仍一律不拓宽。widenObservationAbs随之移入 core(@nudojs/core/internal),service 内不再保留副本。追加:本轮发射面修复(13 条)
- BUG-168:dts 不再抄不可解析的类型名(
id(x: any)/pair(a: any, b: any));可解析的 本地类补declare class、导入名补import type、class Box<T>保留形参槽。 - BUG-189:一个绑定挂多个导出名全部落地(
export declare function foo+export { foo as default },类同理)。 - BUG-190:
export declare const/let/enum(含成员与字面量初始化器);无绑定值留nudo:unresolved-value台账,TS2305 归零。 - BUG-151:
class B extends A、未导出基类补declare class、实例字段(this.x=…/ 类属性)落地、继承字段不重复。 - BUG-108 / BUG-109:入参面可选性 = 契约级 ∪ 声明级默认值;rest 槽恒可选且只有
一层数组(zod
.optional()、dts...rest: any[])。 - BUG-069:见证等价改按「文件 + 实参载荷」复合键 ⇒ 二次
--freeze输出freeze: no changes.、文件字节不变。 - BUG-081:冲突面带
conflict/undecidable、行尾[unsatisfiable: n]、stderr 同码 error、--json同名字段、exit 1;nudo:interface-undecidable保持 warning(能力边界)。 - BUG-068:nullish 回填在同一次改写里补齐 TS 侧车 builder import(含
nullable as nb别名;JS 侧车不加)。注:缺陷正文里「interface-draft.tsBUILDERS 缺nullable」是过期信息。 - BUG-198:已申报的
@nudo:throws/eff.throws原样进草稿 DSL;仅门禁算出的「可能抛」 写成草稿头可照抄提示(不把「可能抛」变成草稿义务)。
追加:BUG-055 / BUG-119 已修,BUG-197 阻塞点已定位到行
- BUG-055(
--freeze把违约见证搬进被调方):insertGeneratedCaseDirectives()原先只筛 「可序列化 + 非手写」,从不与被写方自己的有效契约比对 ⇒ 调用方的违约被搬进被调方,随后由check-case-scan对着被调方报 error 级nudo:case-inconsistency。修:新增contractGuardOf()/witnessViolation()(emit/case-emitter.ts),读effectiveInterface(...)且只执法source === "handwritten"(与 §3.3 同档);契约位→实参位 映射与调用点面同规则(paramNames.indexOf→locateContractParam);判据与check-case-scan.ts的标量通道同口径(eq/union 走literalMeetsConstraint;纯 bounds 先isIntFlag再按实例化后 pred 逐原子判;optional 的or包裹不执法);不可判 ⇒ 放行 (非字面量、结构/数组/函数域)。违约见证不写入,skip 记新原因contract-violation,归因留在 调用现场nudo:interface-domain-exceeds。宿主接线(filePath/loadModule/autoBind/projectDir)由shared.ts的emitWiringOf()供给,与contractOf/checkSource同源。 回归:service-bug-055-freeze-contract-guard.test.ts、cli-bug-055-freeze-contract-guard.test.ts。 - BUG-119(
--freeze=update静默删除活着的见证):update 链「剥离 → 重算 → 回写」的两层 缺陷:①stripGeneratedCaseDirectives无条件剥离call@;② 回写沿用 add 模式的函数级 「有手写 case ⇒ 整函数跳过」⇒ 跨文件见证无法从当前证据重算时(无契约时分析器不合成跨文件 case)就是净删除且不可恢复,汇总只数「新写出」⇒ 谎报「0 directive(s)」。修:块级守门 (含手写 case 的 JSDoc 块不剥离生成态见证,往返闭合)+InsertCaseOptions.rebuildGenerated(重建阶段按见证身份逐条重建,手写 case 只挡同名,载荷等价只判生成态之间)+reemitUpdate返回removedWitnesses(netRemovedWitnesses按身份配对,行号漂移不算删除), CLI 汇总印(N directive(s) …, K removed)与逐条- call@…。 回归:service-bug-119-freeze-update-rebuild.test.ts、cli-bug-119-freeze-update-keeps-live-witness.test.ts。 - BUG-135 已修:实际改动在 LSP 侧(
a6-relax.ts/server-code-actions.ts),见 cat-14 changeset(relax 改「真写推断面」+ 落盘后验证门;CLI 文案在行为修好后为真,未改口径)。
仍未修 / 阻塞(根因在禁改文件或需产品裁决):
- BUG-035:
projectFunctionDsl()把@nudo:case调试见证投影成契约;emit 测试目录里 5 处 pin 了当前行为,改口径必须重钉 ⇒ 需产品裁决。 - BUG-197 已修:见 cat-02 changeset ——
arityFace接受契约可选位,本地与跨文件共用contractOptionalIndexes映射(位次与interfaceToIndexed同一套,只对handwritten生效),nudo:arg-count不再对契约.optional()的省略实参报红,且不会出现「同文件绿 / 跨文件红」。 - BUG-076:
any是既定口径(docs/concepts/abs.md、CLAUDE.md),真问题是文档表述 (docs/**本轮未改)。
追加:6 处 schema 期望按 BUG-093 重钉(不是放宽)
BUG-093 的声明正确行为 = 数值谓词面必须接受
±Infinity(schema-generator.ts:704-705「satisfies(Infinity)⇒.or(z.literal(Infinity))」,-Infinity同理),否则导出的 zod schema 会拒绝 Abs 域里合法的值。schema-generator.test.ts(5 处)与schema-bound-anchor.test.ts(1 处)钉的是加臂之前的字符串:gt(0)/gte(0)→….or(z.literal(Infinity))(含对象槽内与默认 dialect / module 面)lte(100)/lt(5)→….or(z.literal(-Infinity))
行为断言(
WIDE_NUMBER的 NaN/±Infinity 三臂、int().gte(0)等)原样保留。BUG-035:
@nudo:case的调试见证不再被写成契约(nudo contract --emit)根因:
packages/service/src/emit/interface-emitter.ts的projectFunctionDsl()把source === "directive"的指令 case 与source === "callsite"的调用点证据平权 当域来源 / 返回义务来源 ⇒ 纯点观测见证被投影成契约(fn({ x: lit(5) }, lit(6))), 与nudo check的f(x: any) => number | string自相矛盾:用户为调试加一条@nudo:case就把函数固化成「只接受那个点、只返回那个值」。修法:指令来源内部再分档(新增
emit/domain-cases.ts的isDomainDeclarationCase()/isPointObservationArgs(),判据与 analyzer 侧isPointObservationArgs同源)——- 域声明:实参是约束构建器(
number()/shape()/union()… 的域形状)或 带断言(=> expected)⇒ 可作域来源与返回义务来源; - 纯点观测见证(实参全是字面量且无断言)⇒ 不生成域、不生成返回义务。
口径变化:
directive纯见证不再产出契约(改前:fn({ x: lit(5) }, lit(6)); 改后:无证据 ⇒skipped … (not-projectable),不写侧车)。callsite优先、 BUG-021 观测拓宽、域形状number()的not-projectable口径均不变;domainEvidenceCases()(dts / zod / standard / guard 面)语义不变。重钉清单(原断言钉住「指令用例 → 字面量契约」的错误行为;夹具改为带断言的域声明, 断言文本未动):
emit-bug-523-section-order.test.ts(2 处)、emit-bug-532-value-template-clash.test.ts(1 处)、emit-bug-540-crlf-byte-fidelity.test.ts(1 处)、emit-bug-548-import-name-clash.test.ts(1 处)。 新增回归:emit/__tests__/emit-bug-035-case-witness-not-contract.test.ts(三种 case 形态 + 「有调用点证据时见证不得污染返回义务」+ 分档判据)。残留边界:既有侧车里由见证生成的旧生成段,在 update 模式下按「证据消失 ⇒ 删除该生成段」 处理(见下文「BUG-035 残留收口」);宽域 /
derived-from:段 /@nudo:skip段仍按原策略保留。contract --draft面本就不投影见证的返回义务(projected: false),无需改动。BUG-076:
nudo export --format dts的「无证据参数」口径统一为any(文档侧修正 + 回归锁定)判定:
BUG-076的 section 结论 —— 代码侧「未取证参数渲染any」是有意为之的产品口径 (docs/concepts/abs.md:入口无约束 =any,不因缺证据改用unknown),真正错的是仍在承诺 「unknown+ stderr 点名提示」的两处文档。故本条按文档侧收口,零行为变更。改动:
docs/design/cli-semantics.md§2「已记录例外(export 投影面)」改为any口径,并说明只有 真正推导失败才出现unknown(由nudo:unknown-inference之类引擎债诊断标注)。packages/website/docs/guides/export-ecosystem.md:114/185与 zh-Hans 镜像同步改为any, 删除「export --format dts会打 stderr 提示」的承诺。- 新增
cli-bug-076-unevidenced-any.test.ts(3 例):主路径无证据形参 ⇒any且 stderr 无提示; 契约只覆盖部分形参 ⇒ 未覆盖位仍any;窄路径(@nudo:skip+ 手写契约未覆盖位)⇒unknown+note: <fn>.<param> rendered as unknown …(两条路径都实测可达 ⇒reportUnevidencedParams不是死代码,只是只在窄路径出现)。 helpers/run-cli.ts新增writeSrcTsconfig():CLI 子进程按 cwd 找 tsconfig,否则会落到共享dist/旧构建(测试钉源码语义的前提)。
重钉:BUG-021(调用点点观测拓宽)
调用点点观测不再直接成为字面量契约 —— 先
widenObservationAbs再joinThenProject⇒ 一次alpha({ x: 5 })折出shape({ x: number() })、返回5折出number()。据此重钉:packages/nudojs/src/__tests__/cli-bug-657-emit-fn-unmatched.test.ts「对照组:名字正确 ⇒ 只改那一个」的断言由toContain("+export const alpha = fn({ p: shape({ x: lit(5) }) }, lit(5));")改为toContain("+export const alpha = fn({ p: shape({ x: number() }) }, number());")。 「只改 alpha、beta 不出现-/+」与同文件「全部未命中 ⇒ 用法错误 + 侧车逐字不变」 「连 dry-run 预览都不给」「部分命中 ⇒skipped nope (not-an-export)」三组断言未改动。
BUG-035 残留收口:证据消失 ⇒ 旧生成段被删(不再「保留原段」)
根因:
emitInterface的 update 分支把「不可投影」一律当成「今天没有证据 ⇒ 把落盘的段原样保留」。 BUG-035 之后@nudo:case见证不再进契约 ⇒ 由见证写出的旧段(fn({ x: lit(5) }, lit(6)))却因此 永久留在侧车里,与nudo check的结论(f(x: any) => number | string)长期矛盾。修法(
packages/service/src/emit/section-provenance.ts新增,interface-emitter.ts接线): 落盘的@generated段在两个条件同时成立时被删除 —— ① 当前投影确实无证据(无调用点、无域声明 case、无 entry 推断、且非@nudo:skip; 「有证据但表达不出来」不算无证据 ⇒ 保留); ② 该段的证据可证明来自本文件(无// derived-from:标签,且某个顶层槽钉住了单个字面量 —— 今天的发射器会把调用点点观测拓宽(BUG-021),故单字面量域只可能来自本文件的域声明 /entry@)。 删除沿用既有「死段」路径(整段 + 尾随换行),填充EmitInterfaceResult.removed, 发一条 infonudo:interface-not-projectable(「evidence disappeared — dropping its generated section…」), 人类面formatEmitSummary增一行removed: <names>,机器面(nudo contract --emit --json) 增removed字段。重钉:无(既有断言一条未动;
interface-emitter.test.ts的「update 无证据保留原段」用例 其段是宽域 ⇒ 不满足「可证明来自本文件」⇒ 原样通过)。残留:① 宽域且来自本文件调用点的段,调用点消失后仍保留 —— 已收口(见下 「BUG-035 证据范围收口」:生成段记
// evidence: local|external,宽域段也能判定); ② BUG-021 之前的旧侧车,点字面量--from段与见证段不可区分,可能被删 (--dry-run可先预览);③ 只看顶层槽 ⇒shape({ x: lit(1) })形态的旧段保守保留 (现格式下由// evidence:判定,不再受此限);④ 带// derived-from:标签的段保留。追加:BUG-035 证据范围收口 —— 生成段记录
// evidence:,宽域段也能判定刷新症状(上一轮收口后仍留的最后一条边界):删除陈旧段的判据只能「证明」单点字面量域的 证据在文件内(今天的发射模型把调用点观测拓宽,单点字面量只可能来自文件内 case/entry)。 调用点来源的宽域段(
fn({ x: number() }, number()))与「--from采集的使用现场记录来源段」 逐字同形 ⇒ 调用点被删后宽域段只能保守留存(侧车继续承诺今天已不存在的域,与nudo check签名面矛盾);反过来盲删又会丢掉--from段的用户契约。修法(侧车格式变更):
FunctionAnalysis.externalEvidence(analyzer-orchestrate-uncached.ts的合成路径):本函数的 callsite 证据是否混入--from外部记录。判据取去重前的匹配集 ⇒ 保守方向永远是「少删」; 该字段是纯增量(cloneFunctionAnalysis走浅展开,缓存回放不丢)。- 生成段由三行变四行:
@generated/// source:/// evidence: local|external/ export (interface-emitter.ts的sectionText;roundTrip自检同文本,故自检与写盘同源)。 section-provenance.ts:新增sectionEvidenceScope();sectionEvidenceIsInFile()改为 「无derived-from标签 且(local标记 或 旧侧车无标记时的单点字面量启发式)」。 ⇒local宽域段在「今天没有证据」时可证「证据没了」⇒ 删段;external段与旧侧车宽域段 继续保留。旧侧车(无// evidence:行)行为完全不变;旧段在因内容变化被重写时自动带上标记。- 标记是确定性函数(证据范围只取决于本轮是否用了外部记录)⇒ 二次发射逐字节相同。
重钉(2 处,均为「当轮格式」更新,断言文本一条未动):
service/src/emit/__tests__/emit-bug-523-section-order.test.ts的SIDECAR夹具 (注释即「首次 emit 生成的形态」)补// evidence: local—— 该文件钉的是段序不重排 / 无改动,不是段的行数。lsp/src/__tests__/lsp-bug-196-single-writer-sidecar.test.ts的SIDECAR_CONVERGED补// evidence: local—— 该文件钉的是 add/update 逐字节收敛,格式变更后收敛态随之更新。
新回归:
emit/__tests__/emit-bug-035-evidence-scope.test.ts(7 例)—— ① 宽域local段 在调用点消失后被删(+removed台账 + info 诊断);②--from外部记录来源段带external标记、证据缺失时留存且逐字节不变;③ 旧侧车宽域段留存(迁移期零回归);④ 旧侧车单点字面量段 仍按旧启发式删除;⑤derived-from段即使带local标记也留存;⑥ 标记确定性/幂等; ⑦ 本地与外部记录混合 ⇒external(保守方向)。文档:
packages/website/docs/guides/contract.md与 zh-Hans 镜像的侧车示例与 dry-run diff 示例补// evidence: local(该行是两版之间的上下文行,hunk 头不变)。 - BUG-214 — 仅当全部用例都是
-
9ff1709: Fix bug-report category 14 (LSP IDE surface) — BUG-140.
- BUG-140:
nudo:internal(analysis failed ⇒ the gate cannot decide the file) is now published on the LSP diagnostic face too, so the IDE no longer shows a file that the CLI rejects with exit 1 as completely clean. The diagnostic is emitted from the shared analysis path, so every consumer (CLI, LSP, vite-plugin) sees the same source, and the CLI's ownnudo:internaloutput is unchanged (no duplicate).
The service-side emit of the diagnostic landed with the vite-plugin category commit (
packages/service/src/analyzer-orchestrate.ts); this changeset covers the LSP-facing behaviour and its regression test.Regression test:
lsp-bug-140-internal-diagnostic.test.ts.追加:本轮 IDE / CLI 面修复
tmp/verify-bug.sh直接验证(exit 1 = 不再复现):BUG-185、BUG-186、BUG-187、BUG-188、 BUG-201、BUG-202、BUG-227、BUG-235、BUG-236、BUG-237、BUG-262、BUG-263、BUG-274。 带新回归测试:BUG-024、BUG-034、BUG-071、BUG-090、BUG-091、BUG-104、BUG-105、BUG-133、 BUG-134、BUG-136、BUG-146、BUG-014、BUG-019、BUG-044、BUG-074(16 个新测试文件 / 44 例)。口径变更(不是放宽断言):
- BUG-133:数值 case 只改
u自己的槽位并能清掉诊断;shape 形参那组 fixture 改为撤回该 action —— 唯一可用的文本改写会命中返回槽,且可证明无法清除诊断, 与其改错槽位,不如不给这个 action。 - BUG-019 残留(语义未变):首次
--freeze(新增模式)写出的见证名仍是插入前 坐标;--freeze=update是修复路径(现已按最终文件坐标重算、保留已正确项、幂等)。
未修复(同一子系统,已定位):
- BUG-247 inlay 侧:
packages/core/src/algebra/inlay.ts:304的generalizeFromAst跑在 invariant 公理播种之外,@nudo:invariant对 inlay 文本无效(公理与对照都打印: number)。播种入口invariantSpecsOf/assumePremisesPhiOf私有于core/algebra/check.ts:672,831,withInvariantSpecs在core/algebra/exec/runtime/state.ts:134且未从core/index.ts/core/internal.ts导出。hover 侧已修(=> 0 | number)。 - BUG-140 回归测试重基线:
const x = undefinedGlobalAtTopLevel在 BUG-073 之后归 类为module-throw(不再走internal回落),测试改为断言「错误级诊断必须发布」 的同一契约(细节见 cat-03 追加)。
既有测试更新(均为口径跟随,未删断言):
lsp-bug-463-484-signature-param-names(detail 改为 BUG-091 声明的格式、签名标签解析出真实返回类型)、lsp-bug-711-nested-call-signature(标签unknown→ 推断出的真实返回)、cli-bug-63b-path-errors-face(干净test --json基线新增 BUG-014 要求的"errors": 0/"ok": true)。追加:三条回归的收口(env 诊断去重、调用点插入位、两条负控重钉)
validation.ts:checkToLspDiagnostics里collectCheckSupplementIssues会把 service 的envUnresolvedIssues也发一遍,而 editor 面已有专属 env 通道(validateText与 pull 两处显式调envUnresolvedDiags)⇒ 同一事实两条通道各发一次(重复诊断 1 → 2 条); 且 check 通道那份对「按名字记录」的条目(e.path是名字本身、非绝对路径)不按本文件 env 名单过滤 ⇒ 同目录别的文件的无 path 诊断被误吸。修:check 通道跳过DIAG.envUnresolved,事实归属交给 live 通道(它按本文件 env 名单/路径双向收窄,且缓存 命中轮仍发布)。解锁env-unresolved-diag(4 条)与lsp-bug-470-937第 2 条。server-code-actions.ts:BUG-263 的形参身份把「形参位实参不是对象字面量」一律判为不可 插入,而该实参若是原始值字面量(string/number/bool/null/bigint/template),运行时不 可能是对象 ⇒ 形参身份自相矛盾、回落「唯一对象字面量实参」口径(多个仍不猜;表达式仍 不下发,保住「绝不猜位置」)。解锁lsp-bug-737(2 条)。- 两条 signatureHelp 负控钉的
(a: any, b: any) => unknown正是 BUG-104 判红的症状 (声明空壳 label 与同面 hover / CLI 互斥);空壳不采纳后给精确签名(a: any, b: any) => number | string(a + b两侧any⇒ JS+的 ToPrimitive 并集) ⇒ 按 BUG-104 声明的正确行为重钉 label,parameters长度/参数名断言原样保留。
追加:BUG-135 与 BUG-247 收口(relax 真写推断面;inlay 内部 id 不外泄)
- BUG-135:动作标题与 CLI 机器面都承诺「放宽到推断面」,但唯一实现只做
stripNumericPreds⇒ 落盘number()(基类型),既不是推断面、也消不掉诊断 (any ⊭ number()),且没有落盘后验证门。修:lsp/src/a6-relax.ts新增relaxSidecarReturnToSurface()(把fn(…, <返回槽>)的第二个顶层实参整体改写为给定推断面 文本,含括号 / 字符串 / 注释感知的实参切分);server-code-actions.ts取 check 同源推断面 (checkSource→NudoSig.abs,与 CLI 签名行 / hover 同源)渲染为侧车文本(精确投影 ⇒lit(0)/number().gt(40)/union(lit…);any⇒any();widened/partial prim ⇒ 基类型), 并加落盘后验证门(sidecarRelaxClearsTarget增codes参数,重跑 check;诊断残留或界面 装载失败 ⇒ 不下发,与 BUG-134「不给消不掉诊断的假修复」同例)。 - BUG-247(inlay 侧):
entrySeedsOfFn的播种本身是对的(inlay 已随@nudo:invariant变0 | number);残留真缺陷在渲染——invariant-apply.ts铸造的内部 idinv#N只在成员 顶层var处被拦,循环值参与算术时(inv#2 + 1是 app 项)漏网 ⇒ IDE 印: inv#2 + 1 | NaN,而 check / hover 印number | NaN(内部 id 上屏 + 两面互斥)。修:core/algebra/inlay.ts新增hasInternalInvId()走整棵 term 树,命中即退形状 (formatShape),与 check 面同一位置渲染同源。回归含真 LSP server 的 hover / inlay 逐字对拍。
追加:BUG-196(add 面)—— add 模式新建的直写段也要带
// derived-from:溯源行症状:
nudo.contract.emit的 add 模式下,本轮直写分支新建的段永远不带溯源行。 根因是两步顺序的合成:① 直写分支(dry-run)把新段追加进基底 D;② 派生分支以 D 为基底时findGeneratedSectionText在 D 里找到了这个刚建的段 ⇒ 命中 add 面「既有段不可动 ⇒no-change」跳过 ⇒ 标签行被丢弃。后果:add 面与 update 面对同一份输入收敛出不同字节, 且下游「靠derived-from反查根」失去锚点。修法(不改 add 面「既有内容不动」的契约,只区分「本轮新建」与「此前既有」):
packages/service/src/emit/interface-derivation-emit.ts:emitDerivedFromRoot新增可选directCreatedSections(= 本轮直写分支新建的段名)。add 面只在 「直写负责(directSections)+ 本轮新建(directCreatedSections)」时允许把标签行并进去; 此前既有的段仍走原no-change跳过。合并后与既有段逐字相同 ⇒ 仍按no-change(不空转 rewrite)。- 组装面:这类段已在基底里 ⇒ add 面必须就地替换(新增
replaceSectionsInPlace(), 段边界同collectGeneratedSectionsRaw:@generated头 → export 语句末,段外字节与段序逐字保留); 旧实现只做「追加」,会把同一导出名写成两段(非法 ESM ⇒ 整份侧车装载失败)。既有新段的追加路径不变。 packages/lsp/src/agent-tools.ts:serializedEmit在mode === "add"时传directCreatedSections: new Set(direct.written)(add 面written恰好 = 本轮新建段;update 面 无此语义,不传)。CLI 不受影响(contract-emit.ts的派生分支恒为mode: "update")。
回归:
lsp-bug-196-single-writer-sidecar.test.ts的 add 用例扩为断言 「直写正文 +// derived-from: lib.js:tag+ 同一段只有一份 + 收敛态逐字节(与 update 面相同)+ 根侧车只写一次」;新增 add 幂等用例(第二跑逐字不变、不写盘、不报Updated)。 - BUG-140:
-
37e9aa0: Fix bug-report category 17 (vite-plugin gate surface).
- BUG-110: the plugin's report face and gate face agree on
ignoreThrows, so the same project no longer yields contradictory verdicts between the two faces. - BUG-111: project-level env is resolved from the project root rather than the importing
file's directory, and env-module exports are merged with
mergeHarvestUnderEnvinstead of object spread — so adding an unrelated@nudo:envline no longer flips the gate from green to red, and harvest-only exports are no longer dropped. - BUG-221: project-level env resolves against the project base dir, so the plugin gate matches the evaluator.
- BUG-222: a project-level env load failure is no longer silent in the plugin; it reports
nudo:env-unresolvedlike the CLI and LSP instead of a false green.
Regression tests:
vite-bug-110-*,vite-bug-111-*,vite-bug-221-*,vite-bug-222-*.Note: BUG-140 (listed in this category file but whose defect is the LSP diagnostic face missing
nudo:internal) is NOT covered here; it belongs to category 14. - BUG-110: the plugin's report face and gate face agree on
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [206713f]
-
Updated dependencies [0650ef0]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
-
Updated dependencies [afd7c36]
-
Updated dependencies [7231e87]
- @nudojs/core@1.17.2
- @nudojs/parser@1.5.6
- @nudojs/env@0.5.6
- @nudojs/harvester@0.4.6
1.10.2
Patch Changes
-
d726525: Fix the OSS real-package benchmark regressions (perf) and the
nudo:assign-mismatchfalse positive.Perf — the analysis pipeline repeated whole-file work per candidate:
localNamedExports(source → local export-name table) is now memoized per source text and computed once per candidate loop instead of once per candidate. It parses witherrorRecovery, which deliberately bypasses the AST LRU ⇒ a single-file analysis re-parsed the whole file 5 151 times (451 MB of repeated parsing; the TS strip pass alone 36.6 s). A singlecommander/lib/command.jsanalysis went from 59.2 s → 4.1 s.- Function-directive scopes (
listFnDirectiveScopes) are memoized per AST object (the scope walk was repeated per function × per refine site). - The source-level lexer scan (
scanSource) and the file-level directive gate ranges (bodyGateRanges) are memoized per source text — the three file-level directive extractors each re-walked the whole AST. - The TS strip pass is skipped for JS-mode sources: the
jsx-only plugin set cannot produce TS-only nodes, so the pass was a structural no-op that still paid two full AST walks per parse. - The
@nudo:directive count inside the strip pass now runs only when the caller asks for a report (it was dead work on every parse).
Fix —
nudo:assign-mismatchno longer fires on function parameter reassignment. A JS parameter has no declared type: the analysed "previous value" is the shape of the actual argument at that call site, so normalising a parameter (global(globals) { globals = [].concat(globals); … }in yargs) was reported asarr ⊭ prim string— a false positive on the OSS corpus. The check keeps its obligation for bindings with a declared value (let n = 1; n = "str"still reports). -
Updated dependencies [d726525]
- @nudojs/core@1.17.1
- @nudojs/env@0.5.5
- @nudojs/harvester@0.4.5
- @nudojs/parser@1.5.5
1.10.1
Patch Changes
-
0438f10: Fix evaluator correctness and remove duplicated machinery:
- Respect user bindings named
undefined/NaN/Infinity(module bindings, parameters) instead of unconditionally folding them; keep exact literal folding for unshadowed reads, suppress undefined-literal narrowing facts when the name is bound, and honor the same bindings in callee position (NaN(1)) and at the expression entry (declarations inside the expression itself). - Separate private top-level functions from the module export surface:
export *precedence is restored, private named imports now reportnudo:missing-export,transpileSourceno longer emitsexportfor private functions, and analysis keeps a non-enumerable local-function table (so same-name re-exports/CJS exports do not shadow analyzed locals). - Make the generated runtime import list a single source of truth (it is now self-consistent with
@nudojs/core/exec), dedupeRUNTIME_IMPORT_RE, and share thenew Functioncompile scaffold. - Dedupe the A/B call budgets and the two
@nudo:purememo caches behind shared factories; either public clear API now invalidates both. - Single-pass, memoized function facet analysis; dedupe Error/mutator/class-chain/nullish tables; remove dead service evaluator modules.
- Split the evaluator's largest dispatch functions (
$invokeInner,$get/$set,invokeArrMethod,transpileStatement) and move narrowing ops out ofruntime/async.ts.
- Respect user bindings named
-
6ebf5a4: Evaluator engine correctness, host transpile cutover, and dedupe.
-
Fix
Object.assignsecond-class calls (const g = Object.assign; g(target, src),.call/.apply) so obj/tuple targets are mutated in place with native alias visibility; direct and builtin paths now share oneperformObjectAssigncore. Frozen targets only reject a real[[Set]](empty/null/undefined sources no longer report a false TypeError; unknown key sets become may-throw), and sealed targets dispatch own accessors through$set(setters still run; getter-only still rejects). -
Fix function-value join/dedupe: branch-dependent expando slots, nested function values, anonymous/named same-shape functions,
optionalParams/ctor/paramTypes/returnTypedifferences no longer fold to a wrong exact value.$copysnapshots fn shapes independently and migrates impl/slot ownership, null-proto, and fresh-instance identity. Alias groups are scoped lexically, so fork snapshots ($copy) no longer breakconst b = aalias identity across nested functions or shadowed blocks. -
Make
renameShape/snapshotAbsstructure-preserving: tupleholes/rest, fnslots/optionalParams/ctor, obj slotsymbolKey/internal/inherited, brand/eff metadata. -
Fix compiled-body lexical scope and strictness: block-scoped
let/const/for/catch/class/static-block bindings no longer hide enclosing closures;strictis threaded from ESM/CJS source through core/service/parser Abs-fn constructors, and class bodies are always strict. An explicit"use strict"directive prologue now marks a CJS script source strict, and CJS class-method bodies compile as strict too. -
Replace the transpile→ESM-text→regex-rewrite round-trip with
transpileModule()metadata + host-target emission (__nudoBindImport/__nudoExport*, no runtime import line, no generated-code re-parse). Analyze-mode top-level stripping now happens during emission. Namespace-onlyimport * as nsnow emits valid ESM. -
Fix
$setfail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of usingundefinedas a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on.shape. -
Fix
$switchimplicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading tounknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-locallet/const/function/class(including nested blocks,forheads andcatchparams) never enter it, so an arm-local name can no longer copy/rebind a same-named outer binding and break its alias identity. -
Fix free-write collection for nested functions: hoisted
var/ function-declaration names of a nested function body now shadow writes inside that body instead of being recorded as free writes of the enclosing unit (previously emitted$copy(<name>)for a binding that does not exist there, yielding a falseReferenceError/neverand an error-levelnudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-blockletno longer drops a legitimate sibling write from the fork set. -
Module top level is now an alias-group scope boundary:
const b = aat module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object. -
Object.assignonto a sealed / non-extensible brand (prototype) target now rejects a new own key with TypeError (native parity) while existing writable keys, own setters and owner-class members still assign. -
Dedupe shared machinery: fork-arm wrapper, structural Abs keys, dependency-aware memo store + module identities, class-instance bridge, numeric bounds, internal-slot visibility, env-skip derivation from
NAMESPACE_GLOBALS, proto walk, path projection, sum-arg dispatch,undefAbs, RegExp brand predicate, export-call exception skeleton. -
BREAKING: Remove the dead public engine symbols instead of deprecating them: the module-level
phistack (currentPhi/pushPhi/popPhi/resetPhi/withPhiConstraint/describePhi),$while/$forIter/$asyncReturn/$staticInit/$thisGet/$thisSet, the HOF promotion helpers (createHofCollectCtx/promoteParamShape/tryPromote*/HofCollectCtx/AstEnv.hofCollect), the dead relation helpersalphaOf/betaOf, andgeneralizeAll.$staticInvokealso leaves the public surface (previously exported from.and./exec): it is now engine-internal, still implemented for thecheck-may-throwclass bridge. Retire dead internallanguage.tsexports (keepgetClassChain/wrapPromise).Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from
@nudojs/core/@nudojs/core/exec;$staticInvokeis no longer reachable from a host. -
Rename
exec/class-regex.tstoexec/regexp-runtime.tsto match its RegExp-brand role.
-
-
Updated dependencies [f1d4958]
-
Updated dependencies [0438f10]
-
Updated dependencies [6ebf5a4]
- @nudojs/env@0.5.4
- @nudojs/core@1.17.0
- @nudojs/parser@1.5.4
- @nudojs/harvester@0.4.4
1.10.0
Minor Changes
-
2d96c29:
@nudojs/service新增公开导出absolutizeEnvSpec(env 规格的绝对化入口) ⇒ 纯增量(additive)⇒ minor。fix: 并发 review 收口的 10 条缺陷(闸门假红/假绿 · IDE/CLI 口径分裂 · 机器面谎报)
上一片(并发 review 收口 25 条 + 族 65/1094 两轮)之后又做了一轮并发 review(5 个分片 × 只读审查 + 逐条代码层复核)⇒ 查出 10 条该轮改动 引入或遗留的缺陷,本片一次性收口。核心仍是闸门可信度:
nudo check是 CI 闸门,假红卡死用户仓库、假绿让门禁空转。本片新增 7 个回归测试文件(全部含「修前红 / 修后绿」实测),另补 1 个 残留洞(指令作用域闸门)。
高危(4 条 · 闸门级)
-
构造器 may-throw 证据被整体丢弃且「归因落点」根本不存在 ⇒ L2 闸门假绿 (
core/algebra/check-may-throw.ts·core/algebra/scan-top-functions.ts·core/algebra/check.ts):实例方法桥把构造器跑在独立 may-throw 会话里 (软效果不进方法域 ⇒ 假红已消除),但硬抛(无条件throw)也被catch {}吞掉;而注释声称"归因给new C()入口"——该入口并不存在 (scan-top-functions.ts只登记Class.method,跳过 ctor)⇒export class A { constructor(x){ throw new TypeError("boom"); } }在 check 闸门与 test 见证面双面零诊断(0 error / 0 warning / exit 0)。 修法:新增类导出入口普查面listClassEntryNames(new C()是真实入口) ⇒ 类入口并入 L2 入口表(check.ts),构造器的硬抛进 throws 域、报在 类声明位置;构造器的软效果(any 补位的强制转换)仍不进 ⇒ 普通类 不触发 error 级nudo:entry-may-throw(假红不回归)。另:类入口的@nudo:throws申报落点 = 构造器 scope(C.constructor)⇒ 用户已申报不再被卡 (declaredThrowsForEntry)。 -
同一「裸实例兜底」在值域通道产出自信的错值 ⇒ 方法签名折
never+ 假红 (core/algebra/generalize.ts):兜底实例的内层是空 obj ⇒ 构造器写过的 字段被建模成「确定不存在」⇒this.v读成确定的undefined、this.v + 1读成确定的NaN;this.v.toFixed(2)在虚构实例上抛 ⇒ 签名never(谎称"该方法必抛、恒返回 never")⇒ 连带 error 级nudo:entry-may-throw。修法:兜底实例内层改 unknown(构造器写过的 字段 = 不可知,不是"缺槽")⇒ 不折确定错值、不在虚构实例上抛 ⇒ 签名落unknown,且方法体照常求值(不退化成整体 opaque)。与上一条同源,两处 就地复刻的孪生实现已互相点名,防止再漂移。 -
Proxy
getOwnPropertyDescriptor不变量新增规则的 3 处阈值错误 ⇒ 假红 (core/algebra/builtins/object/descriptor.ts):上一片新增的enforceProxyGetOwnPropDescInvariant在 Object 面与 Reflect 面同时接线, 三处口径与 node v26.10.0 不符 ⇒ native 不抛、引擎抛 TypeError ⇒ error 级nudo:entry-may-throw⇒ 直接卡 CI:- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
IsCompatiblePropertyDescriptor只在current.[[Configurable]]为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判; frozen被当成enumerable:false⇒Object.freeze只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);- 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒
defineProperty把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落configurable:true⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen不再改 enumerable;靶侧三标志 统一复用同文件currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
-
项目级 env 的「两层基准」只做了一半 ⇒ 分析器通道丢 env 全局 / IDE 与 CLI 结论相反(
service/src/analyzer-orchestrate*.ts·service/evaluator/env-loader.ts·lsp/src/validation.ts·lsp/src/agent-tools.ts):上一片把项目级 env 改为按项目根解析,但只改了预载侧;收集期仍用原始相对名查表, 而相对说明符只有唯一候选(按文件目录解析)⇒ 与预载登记的 key 不匹配 ⇒ 只要被分析文件声明了任何@nudo:env(哪怕是内建名node),项目级 path env 就对它完全不可见 ⇒ 返回面退never+ 假阳nudo:builtin-unknown; 同时 LSP 的env-unresolved诊断按「记录时的 preload 目录」归档 ⇒ 项目级 env 的失败被静默吞掉(IDE 假绿,CLI 同刻仍报)。 修法:绝对化规则收进env-loader.ts的单一 helper(absolutizeEnvSpec), 预载侧 / 收集期 / 缓存键 / LSP 注入 / LSP 诊断五处共用;LSP 诊断按fileEnvBaseDir + projectEnvBaseDir双取合并去重。改后 IDE 与 CLI 对同一 文件结论一致。
中危(4 条)
-
migrate strip --write把「未写盘」的成功行报成wrote(nudojs/src/migrate.ts·nudojs/src/commands/migrate.ts):库面在有失败时整批零写盘(原子性)并给 成功行附注记,命令层却把注记行当普通成功行推入results,人类面用opts.write ? "wrote" : "dry"无条件打wrote⇒ 同一行既说 "wrote" 又说 "not written",而磁盘上根本没有.js;--json侧只有一条自由文本notes能区分 ⇒ 机器消费方极易误判已产出。修法:新增机器可判定的writeStatus("written"/"not-written"/"planned"),人类面按逐行 状态措辞(wrote/not written/dry)。 -
HOF 元组元素域把已知的 null/undefined 压成
any(core/algebra/hof.ts): 引擎把null/undefined建模成unknown形状 + lit 项,而元素域按 shape kind 判"域是否可知" ⇒ 把已知类型误判成"域不可知" ⇒[null]的元素域从null退成any、[1,null]退成any(应为number | null);any是"自信的任意值",参与算术即强制转换 ⇒ 记 may-throw ⇒ L2 假红面。修法:三分类——已知 nullish(不参与异型判定、只贡献 可空性,用仓内既有makeSum表达联合)、真·推断失败(退unknown, 不是any)、其它(同型判定不变,异型仍退any)。 -
文件级指令的作用域闸门未覆盖
ArrayExpression/ObjectPattern/ArrayPattern(parser/src/directives/file-directives.ts·core/algebra/directive-scan.ts): 写在数组字面量 / 解构模式里的@nudo:env被静默提升成整文件生效(零诊断, 越权)。修法:两侧孪生闸门同步扩到三类嵌套体(两通道 23 组样例逐例一致)。 -
引理账本写入是「死写」(
core/algebra/check-return.ts):Φ 侧的消费在 证明段里记进账本,而调用方传入的consumedAssume快照取自调用之前 ⇒ Φ 侧的写入永远读不到 ⇒ 账本与归因两套口径(changeset 宣称的"经noteAssumeConsumed记进账本 ⇒ 归因可见"实际断在取数时序上)。 修法:归因集就地取账本(读在写之后)⇒ 账本是"消费过"的唯一事实源, 调用方快照退化为兜底。
验证
- 全仓
tsc --noEmit(pnpm run lint)0 错误;pnpm run buildexit 0; pnpm run test全量绿(1757+ 文件 / 14500+ 用例,exit 0);- 新增 8 个回归测试文件,全部修前红 / 修后绿实测(红数由回滚修复逐条复核):
core-bug-1095(Proxy 阈值,22 例 · 修前 12 红)、core-bug-1096(构造器 归因,11 例 · 修前 6 红)、core-bug-1097(HOF 元素域,15 例 · 修前 10 红)、core-bug-1102+parser-bug-1101(指令闸门,79 例 · 修前 12 红)、core-bug-1103(引理账本,5 例 · 修前 1 红)、service-bug-1098+lsp-bug-1099+lsp-bug-1104(env 两层基准,11 例 · 修前 6 红)、nudojs-bug-1100(migrate strip 写盘状态,6 例 · 修前 5 红)—— 合计 149 例; - 产品 CLI 面逐条复现核对:
nudo check对"构造器必抛"报 error 级nudo:entry-may-throw(归在类入口)、对"构造器软 throw"零 error; Proxy 三场景(可配置靶异形态 / 冻结靶 / brand 靶)零 error;migrate strip --write失败批输出not written且磁盘零写盘、--json带writeStatus: "not-written";项目级 env + 文件级 env 并存时nudo check得f() => 42(修前为never+ 假阳)。
已知边界 / 未闭合
- Proxy
gOPD仍有 3 处漏抛(靶不可扩展且键不存在时报configurable:true; 靶不可写+不可配置而陷阱省略value;靶为不可配置访问器且 get/set 身份不同)—— 基线同样不抛(非本次回归),新增抛点有制造新假红的风险 ⇒ 已把 node v26.10.0 实测矩阵写进core-bug-1095测试文件注释,留待单独立项。 - 不可配置访问器靶现在也会比对
enumerable(原生确实抛)——属收紧, 若有用例依赖旧的"访问器靶跳过该比对"需按原生重判。 - HOF 异型元素仍退
any([1,"a"])——既有保守口径,本片未窄化成联合。 - 真·未知 ⇒
unknown会让该 α 恰为返回类型时多一条 warning 级nudo:unknown-inference(级别 warning,不影响 L2 闸门)。 - 进程级
lastEnvBaseDir单槽(同步analyzeFile路径下的文件级相对名) 与 Windows 下isPathEnvName只认/均为既有基线,本片未动。 - MCP
nudo check工具面(同步、无 path env 预载)与migrate strip --json顶层形态不统一(成功=裸数组 / 失败=对象信封)仍待单独立项。
-
-
97f28ed: BREAKING: 产物面(dts / zod / standard / case)的形参位形状变了 —— 数组解构形参现在按元素下标聚合成元组,TS 的
this: T接收者标注不再 被当成形参。谁会坏:消费方
import生成产物并按旧形状调用的代码 ——- 数组解构形参(
fn({ a: number() })对[a, b]):dts 面此前给{ a: number }、zod 面给z.object({ a: … })(与真实形参形态颠倒), 现在给元组([ a, b ]/z.tuple([…]))⇒ 旧形状的调用点类型不兼容; this: T接收者标注:dts 多一个形参(消费方吃TS2554假红)、zod 多一个 字面量槽"this"、standard 多一个幽灵导出<fn>_this⇒ 这些幽灵位现在 全部消失。
怎么迁移:重新生成产物;数组解构形参按数组传参;消费方若引用过
<fn>_this之类幽灵导出,直接删掉(它们本就不存在)。fix(service, nudojs): 期望判定严格化、数组解构的产物面按元素下标寻址、
--assume的界落到形参前提、this接收者标注不进形参表- Bug 396(
@nudo:case期望判定):leqAbs的「同 prim 字面量视为可赋」捷径在 对象槽位上连字面量相等性都不比 ⇒shape({ a: lit(2) })这类期望永不被 执法(case 期望恒[ok]、nudo:case-expected零诊断 ⇒ 假绿),而同一份 契约在手写侧车面走逐字段约束树能抓到 ⇒ 两面自相矛盾。caseExpectedSatisfied补一道「期望槽里的字面量按值比较」(含嵌套对象槽),只作用于期望判定,leqAbs的既有语义一字不动(core 侧那一行不改 —— gold 的assign-compatible/wider依赖该口径)。 - Bug 394(产物面):数组解构形参的字段级侧车契约(
fn({ a: number() })对[a, b]来说a是下标 0 的元素,不是属性键)此前被摊成对象槽 ⇒ dts 给{ a: number }、zod 给z.object({ a: … })⇒ 产物输入面与真实形参形态 完全颠倒(合法数组调用被判红、非法对象调用被放行)。现在 dts / zod / standard 三面都按元素下标聚合成元组(未契约的元素位留any——无约束, 不是 unknown),dts 的声明名渲染成数组形态[ a, b ]。 - Bug 397(产物半):TS 的
this: T是接收者标注、不是运行时形参 —— service 侧形参表入口extractFormals现在兜底过滤它并重排 index (index 是形参表内的位置 ⇒ 实参位靠它对齐)⇒ dts / zod / standard / case 四个产物面不再多出一槽(dts 多一个形参 ⇒ 消费方吃 TS2554 假红;zod 多一个字面量 槽"this"⇒ 对每一个真实调用值报假红;standard 多一个幽灵导出<fn>_this)。 - Bug 976(CLI 半):
--assume声明的界此前被顶成写死的x>0⇒ 用户写--assume 'x>-5'时观察面只给"pos"(x=-1的分支被当成不可达 ⇒ 说谎)。 现在把用户声明的界(按形参名归并、同一形参多条取合取)落进形参自己的前提 (替换写死的默认,不是与它合取),并与 core 半 (buildArgsFromAssume的bounds形参)同批接线;契约的义务与用户的界并存 (契约 pred ∧ 用户界)⇒ 契约不被削弱、用户的界也不被顶掉。
- 数组解构形参(
-
cc9b638: BREAKING: 重复声明
@nudo:mock-module的诊断码与默认严重级变了 —— 分析器通道此前把它一律报成nudo:module-missing(error,fail-closed), 现在按错误种类还原码:重复声明 ⇒nudo:mock-invalid(warning,与 check 面同码同级);mock 文件缺失 / 装载失败 / 点名缺失 ⇒nudo:module-missing(error,fail-closed)逐字不变。谁会坏:按诊断码分流 / 静音 / 快照的下游 —— 重复声明这一路径的码从
nudo:module-missing变成nudo:mock-invalid,严重级从 error 变成 warning ⇒- 只静音
nudo:module-missing的规则不再静音重复声明(改按nudo:mock-invalid静音); - 把
nudo:module-missing当 error 断言的快照 / 闸门变红→变黄(重复声明 不再拦构建)。
怎么迁移:按新码
nudo:mock-invalid调整静音规则与快照;真正的模块缺失 / 装载失败仍是nudo:module-missing(error),语义不变。fix(service): 指令诊断的码归因与文案贯通 ——
@nudo:mock-module重复声明不再被说成「模块缺失」(Bug 1062 / 1063 收口)上一版把两条指令的本体修好了(
@nudo:replace目标未命中 ⇒ 显式诊断;@nudo:mock-module重复声明 ⇒ 显式诊断 + 导出名并集),但码在nudo test/health面上丢了:分析器通道把composed.mockErrors(只有 message)一律映射成固定码nudo:module-missing⇒「重复声明」被说成 「模块缺失」(归因错误:码与文案不自洽),且重复声明这种指令写法歧义被按 fail-closed 的 error 级上报。- 码归因:分析器通道按错误种类还原码 —— 重复声明 ⇒
nudo:mock-invalid(warning,与 check 面同码同级:指令写法有歧义,导出表取并集 ⇒ 分析仍然 sound);mock 文件缺失 / 装载失败 / 点名缺失 ⇒nudo:module-missing(error,fail-closed)逐字不变。 - 文案贯通:check 补充通道的 suggestion 按具体种类分族 —— 重复声明 ⇒ 「只保留一条声明」;导出名缺失 ⇒ 点名那个缺失的导出;表达式解析失败 / 文件缺失 ⇒ 原句逐字保留。
- 同族表缺口:service 侧 body-read 的「接收者无歧义是 string」证据集补
trimLeft/trimRight(宿主String.prototype上真实存在的trimStart/trimEnd别名;Array 上不存在这两个方法 ⇒ 不触发该表刻意 排除includes/indexOf的那类歧义)⇒param.trimLeft()能推出param: string()(补前只是保守漏证据,不是假红)。
回归钉
packages/service/src/__tests__/service-bug-1062-1063-diag-attribution.test.ts: 码归因(含「不得再被说成nudo:module-missing」负控)、既有码不被误改、 suggestion 分族文案、body-read 的trimLeft推断 +includes负控。 - 只静音
-
b0878e3: BREAKING: standard 面的返回面导出名从
<fn>Return改名成<fn>Output(名字不再随符号来源翻转)。谁会坏:生成产物后
import { <fn>Return } from "*.nudo.standard"的消费方 —— 有返回契约时导出名此前叫<fn>Return、走观测时叫<fn>Output,现在恒叫<fn>Output⇒ 旧名import断(消费方tsc --noEmit会红)。怎么迁移:把
import { <fn>Return }改成import { <fn>Output }(内容不变: 仍按「契约返回优先,否则观测返回」取值);重新生成产物。nudo export的 standard / guard 两面不再丢符号名与可选性。- standard 面的返回面导出名恒为
<fn>Output(Bug 614)。此前返回面的名字 与符号来源耦合:有返回契约时叫<fn>Return,走观测时叫<fn>Output,同一 个函数换个源码状态就换了名字——下游import { <fn>Output } from "*.nudo.standard"直接报错,而同一次导出的 zod 面恒叫<fn>Output, 两面同物异名。现在名字与来源解耦,恒叫<fn>Output(内容仍按「契约返回优 先,否则观测返回」取值)。 - standard 面的顶层形参保住可选性(Bug 627)。顶层形参导出走的是独立值节
点(不是对象槽),结构上无处挂
optional,契约允许的undefined被运行时 拒收(number().optional()的形参,act_x.validate(undefined)应当通过)。 现在契约级可选性(StandardSchemaFunctionSpec.inputs[].optional)与声明级 可选性(默认形参)都被保真:可选位的整参校验器接受undefined(T | undefined,与 zod 面.optional()同判据),<fn>Input的对应槽位 带optional(键可缺席)。 - guard 面的导出名可以模块内去重(Bug 608)。守卫名此前只过字符清洗
(
A.b→isA_bOutput),两个不同的源函数清洗后同名就会在同一份守卫产物里 产生两个export function isA_bOutput(node 下SyntaxError,tsc 下TS2323/TS2393)。generateGuardFunctionFromAbs(name, abs, used?)现在 接受一个模块级去重集合(与 zod 面safeExportIdent(name, used)同一套 口径:isA_bOutput/isA_bOutput_2);不传该集合时行为与旧版一致。
- standard 面的返回面导出名恒为
-
e6c4586: agent 工具面的载荷新增了
assertions段 /pathErrors[]段与新诊断码 (nudo:path-not-found/nudo:path-not-target);@nudojs/service新增了 一批公开导出(mergeCheckIssues/directiveDiagIssues/mockFromErrorIssues/envUnresolvedIssues/collectCheckSupplementIssues/buildTestReport/pathNotFoundError/targetPathError/formatPathErrorText等)⇒ 纯增量 (additive)⇒ minor。LSP agent 工具面(
nudo/check/nudo/test)与 CLI 的通道对齐:补回 check 的补充诊断通道、test 的断言汇总、imported 段、路径错误信封与 「分析目标」闸门。nudo/check此前只跑裸checkSource,CLI 侧并入 check 报告的三条补充 通道(指令文法nudo:directive-syntax、mock 装载失败nudo:module-missing、path env 未解析nudo:env-unresolved)一条都没接 ⇒ 同一文件 CLI / LSP 编辑器面 / agent 面给出三份 issue 集(agent 面把 「指令写错了」整条吞掉,mock 文件缺失判绿)。并入逻辑下沉到@nudojs/service(mergeCheckIssues/directiveDiagIssues/mockFromErrorIssues/collectCheckSupplementIssues),三面共用同一份。nudo/test此前没有assertions段 ⇒ 消费方分不出「见证通过」与「见证 失败」。现在并入与 CLInudo test --json同口径的assertions(passed / failed / unchecked,service 的buildTestReport)。nudo/test的文本面此前不渲染 imported(外部)函数 ⇒ CLI 有的(imported)段在 IDE 面整段消失,而头部计数仍把外部 case 算进去 (「3 case」只印 2 条)。现在按来源模块分组渲染,段头--- <mod> (imported) ---。nudo/test的functions过滤只重算本地 case 数 ⇒summary.cases与自身 payload 矛盾(summary 说 1、payload 躺着 2)。外部函数不在过滤 范围内,其 case 仍留在 payload 里 ⇒ 计数改为与 payload 同源。nudo/check/nudo/test此前没有「分析目标」闸门 ⇒ 对侧车契约文件报 「0 fn / 0 error」判绿(CLI 对同一文件 exit 1「Not an analysis target」),nudo/test还把契约 DSL 构造器(fn(...)/shape(...)) 当成真实调用点报成 case。入口现在复用与 CLI 同一份目标判定 (isNudoTargetPath+ 侧车 /.d.ts/ JSX 排除),非分析目标返回nudo:path-not-target。nudo/check/nudo/test此前对不存在的文件只返回裸ENOENT文本 (format:"json"也不返回 JSON)。现在走结构化路径错误通道 (pathErrors[]+nudo:path-not-found+ suggestion),与 CLIcheck --json/test --json同构。nudo/test的functions入参此前零校验:传字符串被逐字符建集合(函数 全被滤掉 ⇒ 全空报告的假空结论),传数字 / 对象时过滤被整体跳过(静默 失效)。畸形入参现在一律工具错误(isError: true)。
-
e6c4586: 三个 contract 工具新增入参
from?: string[](--from等价通道),@nudojs/service新增公开导出collectCallsiteRecords(+ 类型CallsiteRecords)⇒ 纯增量 (additive)⇒ minor。fix(lsp,service): 族 25 A2 —— 契约面四条缺陷(762 / 765 / 766 / 994)
- 762
nudo.contract.emit现在与 CLInudo contract --emit同序同口径: 先emitDerivedFromRoot(root 驱动下行推导),再emitInterface(本地侧车)。 此前工具从不调派生步 ⇒ CLI 写得出的下游侧车(add.nudo.js)在 IDE 面 永远不产生,且结果文本把「引擎没做的那一步」说成「name-clash」——误导性诊断。 下游侧车的写盘边界与本地侧车同口径(必须落在 workspace roots 内)。 - 765 源文件 open buffer 与磁盘文本不一致时拒绝写盘(可诊断错误: save or discard before emit)——此前只挡了侧车自己的脏 buffer,源文件的脏 buffer 会把未保存的代码形状写进侧车,磁盘源码却一个字节没变。
- 766 emit 写盘边界改按路径分量判定逃逸(
..或..+ 分隔符), 不再误杀..dotted.js/...triple.js/..cfg/x.js这类合法路径名; root 外的文件与指向 root 外的符号链接仍然拒绝。 - 994 三个 contract 工具(
nudo/contract/nudo/contract.draft/nudo/contract.emit)新增from?: string[](--from等价通道):跨文件 调用点证据参与契约求解,接口面/草稿/落盘与 CLInudo contract --from同口径。 证据采集下沉到 service:新增导出collectCallsiteRecords(+ 类型CallsiteRecords)。
- 762
-
e6c4586: BREAKING: LSP 协议契约变了(
packages/lsp/PUBLIC_API.md这份冻结清单 本版本同步更新)——- 失败面统一成
{ success: false, error, isError: true }:nudo/selectCase/nudo/selectContract/nudo/getActiveCases此前对 非法入参答{"success": true}(或幽灵条目),现在答结构化错误信封 ⇒ 客户端按success分支的代码路径变了; AGENT_TOOL_SOURCES的值同步为新的共享数据源(analyzeFile→analyzeFileAsync;check→checkSource + mergeCheckIssues + serializeCheckJson;test→analyzeFileAsync + buildTestReport + serializeCaseJson)⇒ 依赖这张表反推「命令 ↔ 数据源」的客户端读到不同的值。
谁会坏:把
nudo/selectCase/nudo/selectContract的失败当成功处理的 客户端(此前恒success:true,现在会拿到success:false+isError:true); 以及读AGENT_TOOL_SOURCES做能力判断的客户端。怎么迁移:客户端按
{ success: false, error, isError: true }分支处理失败 (packages/lsp/PUBLIC_API.md与两份 API 文档已同步);不要再按AGENT_TOOL_SOURCES的字面判能力,改按命令名判断。@nudojs/service侧新增公开导出pathEnvPreloadFingerprint⇒ 纯增量 (additive)⇒ minor。族 25 收口接线(6 项):把跨片耦合的缺口补上,并让文档与工具面说同一件事。
testTool改异步入口(Bug 993):A4 把whatIf/suggestCase/trace改成了analyzeFileAsync(path 型 env 只能异步预载),但testTool属另一片 的函数级边界 ⇒ 冷进程nudo/test首调仍是 env-less("unknown"+ 1 条误导 诊断)。⇒ 改async+analyzeFileAsync(签名变更:AgentToolResult→Promise<AgentToolResult>),同步调用点与既有测试。AGENT_TOOL_SOURCES值同步:工具面真换了数据源,表与文档要跟着走 ——check→checkSource + mergeCheckIssues + serializeCheckJson、test→analyzeFileAsync + buildTestReport + serializeCaseJson;同步packages/lsp/PUBLIC_API.md§5、packages/website/docs/api/agent.md与AGENT_TOOL_SOURCES的值钉。nudo/contract.emit转发from(Bug 994):三个 contract 工具已支持--from等价通道,但协议入口makeHandleContractEmit只构造{file, functionName, mode, dryRun?}⇒from到不了 emit 工具 ⇒ 补 入参类型 + 透传。- CJS 导出的 hover 面(Bug 998):
findFunctionNameAtPosition没有MemberExpressionproperty 分支 ⇒module.exports.alpha = function () {}的 hover 回退成无名(x) => ?(诊断面认得它、hover 面不认 ⇒ IDE 内部 自相矛盾)⇒ 补分支(祖父节点走path.parentPath.parent—— Babel 的node.parent不存在)。 - 失败面文档同步:
selectCase/selectContract/getActiveCases的失败 面统一为{ success: false, error, isError: true }⇒ 两份 API 文档的返回面 记载同步;nudo/contract.emit的from?: string[]参数也补进文档。 pathEnvPreloadFingerprint的瞬时 ReferenceError:族内 build 前dist落后于src造成的一次性混用 ⇒ 随本族 build 消失(已连跑 5 次 复现不出)。
- 失败面统一成
-
3432d8c: CaseJson 的断言面新增了第三种裁决
unchecked(外加可选字段uncheckedReason)⇒ 机器面新增可选字段属增量变更(additive)⇒ minor。nudo testcan now tell "the engine could not infer the value" apart from "the value does not match the expectation".- A failed inference used to be reported as a failed assertion. When the
engine cannot infer a witness' result (the observed value is
unknown, or its confidence isopaque), the assertion verdict was binary: the case was reported as[FAIL],nudo:case-expectedwas raised, and the run exited1. Writing the honest expectation (=> number()) could never fix it, because the real cause was the failed inference, not a type mismatch — while the very same source was only anINFO(nudo:opaque-result, exit0) on thenudo checkface, i.e. the two faces gave opposite severities for one fact. - The opposite expectation passed for the wrong reason.
=> any()(the top type) satisfied every expectation, including the ones the engine could not judge at all, so the assertion reported[ok]while nothing had been inferred — a hollow pass.
Both assertion report faces — the CLI one (
nudo test,nudo test --json,nudo test --abs) and the LSP agent tool one (testTool) — now use the same three-state verdict: a case whose observed value could not be inferred is recorded as unchecked (it is neither a failure nor a pass), it does not turn the run red, and the report says so explicitly ("cannot judge — the engine could not infer the actual value") and points at thenudo:opaque-resultremediation path instead of claiming a type mismatch. Theuncheckedcount in theassertionssummary and in the--jsonpayload now includes those cases, and a real mismatch is still reported as[FAIL]with exit1. - A failed inference used to be reported as a failed assertion. When the
engine cannot infer a witness' result (the observed value is
-
ebe909e:
@nudojs/core新增公开可选项TranspileOptions.disableAsyncGen(async 生成器路径的安全网开关)、@nudojs/service新增公开导出analyzeFileWithEvalFailures/analyzeFileAsyncWithEvalFailures/FileEvalFailure⇒ 均为纯增量 ⇒ minor。nudojs的闸门口径翻转(模块级求值失败 ⇒ 不再静默放绿)按 minor 发布:nudo check以 error 级nudo:internal报出并以非零码退出,nudo health的Result不再报OK。这是闸门口径的翻转(详见下方「BREAKING」)。bump 级别说明:本项目尚无外部用户,本批 1.x 包的破坏性变更统一以 minor 发布并保留
**BREAKING**:标注(谁会坏 + 怎么迁移照旧写全)⇒ 不占用 major 跳版, 也不触发发布侧gate-major的人工确认闸门。一旦有外部用户依赖这些包面, 即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」政策。fix: review 报告 34 条缺陷收口(闸门假红/假绿 · 契约面宽松 · 机器面谎报 · 文档与 changeset 漂移)
本轮把一份 34 条缺陷的 review 报告逐条落地:每条都先在当前代码上复现(或判定为 非缺陷),再修,并逐条用回滚法自证「修前红 / 修后绿」。新增 39 个回归测试文件。
BREAKING:
nudo check/nudo health现在对引擎内部回落(模块求值失败 ⇒ 该文件 的导出全部丢失)fail-closed。此前这类文件零诊断 + exit 0 ⇒ CI 闸门假绿 (合法代码与违约代码都判绿)。现在:命中内部回落 ⇒ 报 error 级nudo:internal(消息含文件路径与原因)⇒nudo check非零退出;nudo health报Result: FAIL (engine internal fallback found)并非零退出。谁会坏:依赖「坏文件也能过闸」的 CI 流水线(此前引擎自己挂了就当无事发生)。这些文件 本来就是引擎缺陷的暴露面 —— 现在会显式报出来。
怎么迁移:修掉被报出的文件(消息里给了路径与原因)。注意口径边界:
unsupported:*(能力边界)与nudo:opaque-result(推断精度)不触发该失败路径;只有引擎内部回落 (internal)才 fail-closed。
高危(闸门级 · 5 条)
-
await的位置表与转译侧脱节 ⇒yield落进嵌套箭头 ⇒ 整模块编译失败 ⇒ L2 闸门假绿 (core/algebra/exec/transpile/async-plan.ts·core/algebra/exec/run.ts):async 体的 真挂起靠宿主生成器(function*(){…}+await发射yield)实现 ⇒yield必须落在 生成器体内联位置;而转译侧把若干操作数包进宿主 thunk ——yield落在里面是 SyntaxError ⇒new Function编译失败 ⇒ 整个模块的导出全部丢失 ⇒ 闸门看不到任何 入口 ⇒ 零诊断 + exit 0 ⇒ CI 闸门假绿。位置表此前只把「分支臂 / 循环体 / 短路右臂 / 三元两臂」判为 thunk,漏了:成员调用的实参(o.m(await 1))、成员赋值的接收者/计算键/ 右值(o.x = await 1)、成员自增的计算键(o[await k]++)、逻辑赋值的右值 (x ||= await 1)、循环判别式与步进式、switch 的 case 测试、早退守卫之后的后续 语句(if (!c) return null; … await …)。实测:export async function load(id){ if(!id) return null; const res = await fetch("/x/"+id); return res.json(); }修前 ⇒nudo checkOK / exit 0 / 签名全 unknown;修后 ⇒ error 级nudo:entry-may-throw(与 main 同结论)。 修法(两处,缺一不可):① 位置表补齐(上列位置判 thunk ⇒ 该 async 体回落$async同步 路径,产物是合法 JS);② 安全网:生成器模式编译失败时关闭asyncGen重试一次 ⇒ 纵有未来新增的脱节位置,模块也编译得出来 ⇒ 导出可见 ⇒ 闸门照常判定 (宁可少精确,不可整模块消失)。 -
模块级求值失败 ⇒ 闸门假绿(
service/src/analyzer-orchestrate.ts·nudojs/src/commands/{check,check-report,health}.ts):见上方 BREAKING 段。 修法:按文件收集internal回落(进程级计数无法定位到文件)⇒ 命中即产出 error 级nudo:internal(复用已注册码DIAG.internal,未新增第二套码表)⇒ok:false⇒ 非零退出;分析失败的降级产物不回写磁盘缓存(回写 ⇒ 下次命中缓存跳过求值 ⇒ 静默转绿)。 -
早返回的关系补集默认「x 不是 NaN」⇒ 契约被证成 ⇒ 假绿 (
core/algebra/exec/transpile/stmt/{fn-body,statement}.ts):¬(x <= k)还含x为 NaN 的情形(NaN 与任何比较皆假)⇒ 后续路径只该断定x > k ∨ x is NaN;此前直接断言x > k(排除了 NaN)⇒if (x < 0) return 0; return x;+return nonNeg判成立 (零诊断),而原生x=NaN时返回 NaN ⇒ 真违规被放过。且与三元写法 (x < 0 ? 0 : x)结论不一致(三元判unproven-return)。修法:撤销后续路径的否定界 窄化 ⇒ 两条路径同口径。 -
Bug 370 把「确定违规」降为 warning(
core/algebra/postcondition.ts):证据面判据 从「ret.pred有事实」改成「含界原子」⇒typeof级证据(@nudo:contract x num的 声明域参数)被判成「无证据」⇒ 返回义务降级成nudo:unproven-return(warning,且 warning 不改变 exit code ⇒ 门禁空转)。if (x === -1 || x === -2) return x;+return positive是确定违规(x=0 即违约),此前只出 warning。修法:判据回到「ret.pred有 事实」⇒ 声明域参数 ⇒ error 级nudo:constraint-violated。 -
契约合取的结构型义务被静默丢掉 ⇒ 假绿(
core/algebra/interface.ts):合取遇任一侧 结构型就直接返回前侧 ⇒ 源码 shape{id}∧ 侧车 shape{id,name}的name义务整条蒸发 ⇒ 契约面比声明面宽松 ⇒ 违约代码被放过。修法:改为字段级合并(两侧都有的字段递归 合取、单侧字段保留、optional取交集);合不了的形态组合按既有口径不判 conflict (能力边界 ≠ 语义不可满足)但显式留痕(新增EffectiveInterface.undecidable⇒ check 面 发 warning 级nudo:interface-conflict,不静默宽松)。
闸门可信度(假红 / 假绿 · 14 条)
- 展开实参被计为 1 个 ⇒
nudo:arg-count假红(core/algebra/scan/literal-args.ts):impl(...args)被计成 1 个实参 ⇒ 报「expects 2 argument(s), got 1」;数组字面量展开的空洞 (three(...[1,,3]),原生是 3 个实参)被跳过;幻影槽位破坏 rest 聚合(few(1, ...more)对array(number()).max(1)报长度违规)。修法:个数不可判时让位元数检查;空洞按undefined计入;rest / length 边界在展开处停止。 - 裸名 callee 解析不看作用域 ⇒ 无契约也触发 arity 假红(
core/algebra/scan-call-graph.ts): 外层函数的形参 / 局部 const / 嵌套函数 / for-of 绑定 / 解构绑定同名时,把顶层声明当被调 方 ⇒ 报「log expects 2 argument(s), got 1」+ 假 may-throw。修法:callee 解析引入作用域链。 memberToFn按变量名做键 ⇒ 同名局部/参数互相串味(core/algebra/scan-call-graph.ts): 别名与成员绑定改为按作用域分桶,重新赋值时失效。- TS
x?: T与 JSDoc[x]被当成必需参数 ⇒ arity 假红(core/algebra/param-surface.ts):h()对/** @param {number} [x] */ function h(x)报「expects 1 argument(s), got 0」。 or契约的「不可判定」成员被当成失败(core/algebra/scan/literal-shapes.ts):union(number().gt(0), lit("a"))对非字面量 number 实参误报。修法:三值聚合 —— 全部成员确定假才报;不可判定且域容纳该形态 ⇒ 整条 union 保持未决。- 显式
undefined被当成值(core/algebra/scan/literal-args.ts):d1(undefined)对带默认值 的形参报约束错误。修法:显式undefined⇒ 走默认值。 - 默认值填充只在零参时发生 ⇒ 假绿(
core/algebra/scan-literal-calls.ts):e4(1)缺失的尾部位不补(运行时 x = -5)⇒ 静默。修法:补齐所有缺失的尾部位置。 - switch 分组 case 标签的
hit收窄不安全(core/algebra/exec/transpile/stmt-predicates.ts):const x = null; switch (x) { case null: case "ab": return x.length; }原生抛 TypeError, 引擎按源码推导读"ab".length⇒ L2 may-throw 消失。case 0:还会把-0重绑成+0(原生1 / -0=-Infinity,引擎算成Infinity= 自信的错值)。修法:只有同体全部 标签都是原始字面量才产命中事实;0按交集细化{0, -0}。 lit(NaN)契约被判自相矛盾 ⇒ 假红(core/algebra/interface.ts):字面量值比较用!==⇒NaN !== NaN⇒ 同一个lit(NaN)自比被判成「两个不同字面量」⇒nudo:interface-conflict。修法:改用既有 helpertermEquals(===+ NaN 特例)。- import 别名撞 ambient builder 声明 ⇒ 整个 sidecar 装载失败
(
core/algebra/refine.ts):import { number as string } from "@nudojs/core"与包装器的const { number, string, … } = __nudoInjects同处一个外层作用域 ⇒ SyntaxError ⇒ 侧车整体 装载失败 ⇒ 契约全丢。修法:显式 import 的本地名从 ambient builder 名单里排除。 autoBind:false下不可读的 ambient sidecar 仍被报成 error ⇒ 假红 (core/algebra/load-deps-fp.ts·core/algebra/check.ts):指纹计算的推测性读取 走的是分析读通道 ⇒ EACCES 被收口成 error;而那份侧车在autoBind:false下根本不会被 绑定。修法:推测性读走未经降级闸的通道(读失败只让指纹标readError)+ 按 ambient 绑定资格 gate。- 缓存的 sidecar 诊断丢失依赖归属(
core/algebra/refine.ts):root→dep 递归求值共享同一 diags 数组 ⇒ 依赖侧车的诊断一律记到 root 名下。修法:诊断带来源文件并纳入去重键。 lit(1n)的大字面量被提前过滤 ⇒ 假绿(core/algebra/contract-face.ts):bigint 过滤 发生在literalMeetsConstraint之前 ⇒lit(1n)契约下返回2n的被调函数被判满足 ⇒ 违约被放过。修法:bigint 参与比较(1n !== 1,与 number 不混同)。
机器面 / 契约面 / 工具链(8 条)
@nudo:skip签名分支输出旧机器面(core/algebra/check.ts):JSONdisplay带#exact而终端显示number⇒ 机器消费方拿到的是人类面之外的文本。修法:与其它路径 同款(formatSigCached)。- 内部临时名遮蔽用户标识符(
core/algebra/exec/transpile/{member-path,expr/assignment, expr/call,expr/optional-chain,expr/short-circuit}.ts·helpers.ts):引擎写死的__nudoMp*/__nudoDefR/__nudoReArgs/__v会遮蔽用户源码里的同名绑定 ⇒ 自信错值 或 TDZ ReferenceError(⇒ 闸门假红);模块级同名还会撞出重复声明 SyntaxError ⇒ 整模块 fail-closed ⇒ 闸门假绿。修法:改用既有internalTmpName/internalTmpNameSet(无碰撞时基名原样返回 ⇒ 产物逐字不变)。 - CJS 对象字面量导出的普查键必须是成员键(
core/algebra/export-slot.ts):module.exports = { greet: function inner(x){…} }的侧车契约整个不绑定(只剩unproven-return警告、签名退成unknown⇒ 假绿),且内层 id 与成员键碰撞时映射串。 修法:导出槽映射只用成员键。 leq的 fn arity 只比较必需参数个数(core/algebra/leq.ts):(a = 1, b) => b.toFixed()被接受为单参目标(原生g(1)抛 TypeError)⇒ 判定比原生松 ⇒ 假绿。修法:按最后一个必需 参数的位置比较。- 生成的守卫对
new Proxy(...)抛错(core/algebra/denote.ts):x instanceof Proxy在 原生抛 TypeError(Proxy 没有 prototype)⇒ 守卫产物一跑就炸。修法:对无可用 prototype 的构造器跳过身份子句。 - 超参 warning 忽略可选/默认槽位(
core/algebra/diagnostics.ts):f(a, b = 1)被f(1, 2)调用时误报「takes 1 argument(s) but 2 were passed」。修法:上界按非 rest 形参总数。 - 多行
@nudo:case … !! throws声明丢失(core/algebra/directive-scan.ts):case 参数跨行 时后缀正则匹配不到 ⇒ 申报的 throws 丢失 ⇒nudo:entry-may-throw假红。修法:先在完整 注释里找平衡的 case 参数终点再识别后缀。 export default C的类入口被漏(core/algebra/scan-top-functions.ts):Babel 的Identifier字段是name(代码读的是d.id?.name⇒undefined)⇒ 类入口不在入口表里 ⇒ 构造器入口闸门看不到它 ⇒ 假绿。
async 运行时(2 条)
- callee 有 2 个及以上 await 时 caller 提前恢复(
core/algebra/exec/runtime/async.ts): 队列为[callee-resume, caller-resume]⇒ callee 的第二次续体排在 caller 之后 ⇒ caller 读到占位符。实测async function g(){ log.push(1); await null; log.push(2); await null; log.push(3) }原生"1,2,3"/ 修前"1,2"/ 修后"1,2,3";return await h()原生7/ 修前unknown/ 修后7。修法:live promise 维护 pending 态 + waiter 列表,await 的 恢复排在 settle 之后。 Promise.all取调用期快照(core/algebra/builtins/promise.ts):元素尚未 settle 时取到 占位符 ⇒ 兑现值被永久冻住;元素拒绝通道丢失 ⇒ 拒绝臂成死代码(假绿)。修法:组合子 自身 pending,元素 settle 后重算聚合;任一元素确定拒绝 ⇒ 组合子短路拒绝。
约束构造器(1 条)
.int()暴露给非 number builder ⇒ 同一约束两个裁决(core/algebra/constraint.ts):literalMeetsConstraint("abc", string().int())(域面)接受"abc",而 Abs/投影面却带整数 谓词。修法:非 number builder 上.int()抛错(与shift()同口径)。同批收口:fn()缺字段表守卫、boolean().gt(1)/string().length(-3)等恒假契约(假红)、array(1,2)静默丢元素约束(假绿)。
文档 · changeset · 诊断注册表(4 条)
- 自称破坏性的 vite-plugin changeset 声明为 patch(
.changeset/fix-vite-plugin-s{1,3,4}.md等 32 个):按docs/versioning.md逐个复核并校正 bump 级别(pre-1.0 的破坏性 ⇒ minor; 1.x+ 的 JSON 形状变更 / 默认严重级变更本应 ⇒ major,但本项目尚无外部用户 ⇒ 本批 统一以 minor 发布,见上方「bump 级别说明」),并补**BREAKING**:与迁移说明。 - 设计文档引用了被 gitignore 的产物(
docs/design/generator-laziness.md·docs/design/architecture-debt.md):tmp/…路径(读者不可达)、bun命令、过时行号、$gen发射点数目(3 ⇒ 实为 4)。修法:删交接笔记、引用符号名、指向仓内回归钉。 - 中文 API 文档漂移(
packages/website/i18n/.../api/{agent,cli-reference,lsp,harvester, service}.md):手写页与 EN 现状不一致(--json的形态、force?: boolean、旧契约…)⇒ 逐页同步;同时收紧文档覆盖闸门(docs-coverage.test.ts)让手写 api 页也进闸门。 - 诊断码绕过注册表(
packages/core/src/algebra/diag-codes.ts·packages/nudojs/src/commands/migrate.ts):nudo:migrate-strip-failed此前直写字面量 ⇒ 进DIAG注册表并由 CLI 引用常量。
附带(不改变对外行为)
nudo init的祖先配置继承口径与加载器对齐(本包已有nudo键 ⇒ 祖先不可继承 ⇒ 不再用 祖先配置当拒绝理由,消除「拒绝 + 不可修复」的死锁)。contract --help的--json描述、contract --from-dts的拒绝提示(同时给出--force与NUDO_DRAFT_FORCE=1;人工改过的草稿永不被覆盖这条口径不变)。nudo:migrate-strip-failed进注册表;interface缓存面新增undecidable透传。- 6 条被放松/空转的既有测试恢复为强断言(
check-regex-capture-narrow-136·eval-loop-return-join·eval-bug-499·core-bug-1064·loop-pack-shadow-soundness·core-bug-1079)—— 此前它们在 main 上也通过,钉不住任何回归。
-
-
dde4b03: BREAKING: standard 面的导出集变了 —— 解构形参的字段级校验器 (
act_a/act_b)移除,改为整参校验器<fn>Input(与 zod 面同名同义)。谁会坏:
import { act_a } from "*.nudo.standard"的消费方 —— 这些导出不再 存在 ⇒ 消费方tsc --noEmit会红(此前它们拒收正确入参、收下错误入参,本就 不可用)。怎么迁移:改 import
<fn>Input(一个校验器校验整个入参对象)并重新生成 产物。nudo export --format standardnow produces a product that compiles in a strict TypeScript project, keeps literal values intact, and exposes one input validator with the same name as the zod face.- The generated module was plain JavaScript with a
.tsextension, so every helper parameter and local was an implicitany:tsc --noEmit --strictreported a dozenTS7006/TS7005/TS7034errors per file and the product was unusable in a strict project, while the zod face of the same export compiled cleanly. The helpers now carry their types (__nudoTypeOf(v: unknown): string,__nudoCheck(node: NudoSchemaNode, value: unknown, path: (string | number)[], issues: NudoIssue[]): void) and the module ships theNudoSchemaNode/NudoIssuetype aliases it needs. - Schema nodes were serialized with
JSON.stringify, which has no notation for non-finite numbers:Infinitywas silently written asnull, so the exported validator rejected the value the function always returns and accepted a value it never returns — the opposite of the zod, guard andnudo checkfaces. Nodes are now written as source text, soInfinity,-InfinityandNaNsurvive; abigintliteral no longer throwsDo not know how to serialize a BigInt, which used to abort the wholenudo exportrun and lose the other dialects' output as well. - The input face of a function with a destructured parameter exported the
contract's field-level entries as if they were whole parameters
(
act_a,act_b), soact_a.validate({ a: 1, b: 2 })rejected the correct argument andact_a.validate(1)accepted a wrong one. A function-level assembler (absToStandardSchemaFunction) now emits<fn>Input— one validator for the whole argument object, named like the zod face — keeps<fn>_<param>for real parameters, and never lifts a destructured field to a top-level parameter validator.
- The generated module was plain JavaScript with a
-
dde4b03: BREAKING: dts 面的投影形状变了 ——
.d.ts现在按模块面装配 (类作为类声明投影、成员在类体内;export default保持默认形态;export * from/export { x } from的再导出被复现);standard 面的输入面 导出名也统一成<fn>Input(解构形参不再导出字段级校验器act_a/act_b)。谁会坏:消费方
import生成.d.ts的类型并按旧形状引用的代码 ——- 类成员此前被摊成模块级声明(源码里并不存在这些顶层符号)⇒ 旧
.d.ts的形状与新.d.ts不同 ⇒ 消费方tsc --noEmit会红; - 再导出的符号此前整个缺失 ⇒ 现在出现(反向:依赖「它不在」的代码会冲突);
- standard 面解构形参的
act_a/act_b导出移除,改为<fn>Input。
怎么迁移:重新生成产物并按新形状引用(类成员走
Class.member,再导出符号现在 可用);standard 面改 import<fn>Input。Cross-shard wiring for the
service-emitbatch: the CLI now feeds the product faces the same information the analyzer holds, and a frozen witness no longer takes over a function's published type.nudo export --format standardbuilds its module with the service assembler (absToStandardSchemaFunction) instead of a hand-rolled projection, so the standard face has the same input validator as the zod face (<fn>Input, one validator for the whole argument object) and a destructured parameter no longer exports field-level validators (act_a,act_b) that reject the correct argument.- The dts face is now assembled from the module surface: a class is
projected once as a class declaration (members inside the class body)
instead of one flat declaration per member,
export defaultkeeps its default form, andexport * from/export { x } fromre-exports are reproduced. Before, the class members were emitted as module-level declarations that did not exist in the source and a re-exported symbol was missing from the.d.tsentirely. - A contract that declares an optional parameter now reaches the product
faces: the constraint's
isOptionalis carried explicitly (the entryAbsdoes not keep it), so the zod input object renders.optional()and the dts declaration usesx?: T. nudo contract --emitrenders each diagnostic exactly once. The emit summary already renders and consumes the issue list, so the CLI's trailing error-only loop printed the same diagnostic a second time on the dry-run path.nudo contract --emit --writenow exits non-zero when it refuses to overwrite a hand-edited draft. The file is left untouched (as before), but a silent exit0told CI that the draft had been regenerated.nudo check --fixstates explicitly when the fix did not turn the gate green but changed the diagnostic instead (for example the oldconstraint-violatedbecame a newentry-may-throw). The previous message ("N residual error(s) remain") read as if the fix had worked.nudo exportno longer collapses a function's published type to a single frozen call site. A@nudo:casewitness without an assertion observes one point; it is not a domain claim, so it must not own the return face.nudo test --freezewrites exactly such a witness, so freezing a call used to narrow the zod face toz.literal(3)and the guard face todata === 3— a guard that rejects every legal call — whilenudo checkstill reportednumber | stringfor the same function. A function whose only evidence is a point witness now keeps its inferred domain, and the zod, standard, guard and dts faces agree with the check face.nudo testclassifies a case as synthetic by its source instead of by its name. A witness written by--freezeis named after the call site (call@<file>:<line>) but is declared in the source, so it was reported as synthetic and the run claimed "no declared @nudo:case expectations" even though the source now declares one.nudo contract --emitremoves a generated section whose export no longer exists in the source. The stale section kept the name occupied in the sidecar, so a hand-written contract for a new function of the same name produced an invalid sidecar.- A rest parameter is now observed as a variable-length argument, and
the entry fallback observation of it is marked uncertain. Before,
xs.lengthwas observed as the literal1of the single placeholder argument, and the zod, standard and guard faces projected that one-off observation as the output domain (literal(1)) — a validator that rejects the value the exported function itself returns — while the dts face wrotenumber.
- 类成员此前被摊成模块级声明(源码里并不存在这些顶层符号)⇒ 旧
-
b37321b: env 装载失败现在报告出来(
nudo:env-unresolved的适用面扩大:未知 env 名、defineEnv()契约失败、相对路径 env 的按目录解析、package.json#nudo.env里的 非字符串元素)⇒ 诊断面增量(additive)⇒ minor。Runtime environments that cannot be applied now say so, instead of leaving the affected code to be judged as always throwing.
@nudo:env bogus— an env name that is neither a built-in (es,web,node) nor a path — was ignored silently: no diagnostic, and the env never applied. It is now reported asnudo:env-unresolved.- A path env file that does not export a
defineEnv()function, exports a non-function, throws while being evaluated, or returns something other than{ globals }also went unnoticed, with the same effect. These contract failures are reported now, too. A file with a syntax error was already reported — the two cases now use the same channel. - A relative path env was resolved against a process-wide registry, so the
first
./env.tsloaded won every later same-spelled path. Each directory now resolves its own. - A
package.json#nudo.envarray holding a non-string element crashed the loader withname.includes is not a function. The element is now rejected with a diagnostic.
-
b37321b: 新增两个诊断码
nudo:module-unreadable(模块存在但不可读)与nudo:json-invalid(JSON 语法非法)⇒ 新诊断码属增量(additive)⇒ minor。Modules are resolved the way Node resolves them, and a dependency that cannot be loaded is named for what it is.
require("./data")was reported as "module not found" even whendata.jsonsat right next to it, andimport "./data"was accepted even when onlydata.jsexisted. The CommonJS and the ESM resolution rules are applied separately now:requirefollows therequirecondition and resolves extensionless paths,importfollows theimportcondition and requires the extension.- A bare package with a conditional
exportsmap always resolved to the CommonJS build, because the conditions were ordered withrequirefirst. The condition is now chosen by the kind of import. node_moduleswas searched in one directory only. The search now walks up the tree the way Node does.- A package's own
#importsmapping was not supported at all and produced no diagnostic, so the imported value silently collapsed tounknown. It is resolved now, and an unresolvable#specifier is reported. - A dependency that exists but cannot be read (
EACCESand friends) was folded into "file not found" — a statement about the opposite of the fact — and, in the check path, escaped as an uncaught error that killed the whole run. "Unreadable" and "absent" are separate outcomes now, and an unreadable dependency is reported asnudo:module-unreadable. - A
.jsondependency was loaded as JavaScript, failed, and was dropped without a word. Its value is imported now; invalid JSON is reported asnudo:json-invalidinstead of being called a missing module.
Patch Changes
-
02aa122: fix(core,service):
-0保真渲染的同根因漏点一并补齐(族 20 · Bug 1065 收口)Bug 1065 的根因是「用
String(v)渲染数值」⇒String(-0) === "0"⇒ 负号被抹掉。 主修只覆盖了litToString/lengthBound两处;收口时按同一根因把其余 漏点一并补齐(诊断陈述的契约 ≠ 用户写的契约是同一个错):- core(
packages/core/src/algebra/interface.ts·predToChain):其余三处 常数界渲染 ——.min(n)/.max(n)(length上的ge/le界)与.<op>(n)(变量上的常数界)—— 改走保真口径litToString⇒.min(-0)/.max(-0)不再被抹成.min(0)/.max(0);.length(n)的常数界渲染同款。 - service(
packages/service/src/emit/standard-schema.ts·describeValue):typeof value === "number"的渲染改用Object.is(value, -0) ? "-0" : String(value)⇒ 该文件此前存在两套-0口径(另一处已保真、这一处没有)⇒ 同款收敛。
诊断文本、侧车 DSL 回写与 schema 产物现在全部走同一套保真口径 ⇒
-0在所有面上渲染一致,不再出现「一处保真、一处抹零」。 - core(
-
7fea13a: Accessors are now projected by what they actually return, repeated keys in an object literal follow the last definition, and an early return narrows the path that follows it.
- An accessor does not live in a shape slot: the transpiler writes a
placeholder
undefinedslot to keep the key present and keeps the real getter in a side table. The read path consults the side table, soo.abreads correctly, but the projection paths read the placeholder slot, so every object literal with a getter was projected as{ ab: undefined }— a confident wrong value, narrower than the truth and self-contradictory. The projection paths (shape formatting, guard derivation, constraint projection, contract proof) and the.d.tsgenerator now take the read domain of the getter: the getter is evaluated with the object as receiver, a getter that throws projects tounknown, and a data property keeps its slot value. - A key that appears twice in an object literal kept the first accessor
even when a data property came later, so
{ get x() {}, x: 2 }was read through the getter and writingo.x = 9was reported as a definiteTypeError. The last definition now wins, including its kind: a data property after an accessor replaces it, and an accessor after a data property replaces it too. - The facts of an early return did not reach the path that follows it, so
if (x <= 0) { return 1; } return x;violated a contract ofnumber().gt(0)while the equivalentif (x > 0) { return x; } else { return 1; }passed. The path after an early return now knows the negation of the guard. The fact reaches the code after the early return whatever block the early return is written in — a bare block, atryblock, acatchblock or afinallyblock.
- An accessor does not live in a shape slot: the transpiler writes a
placeholder
-
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
e424592:
@nudo:mock-modulenow fails closed when the mock file does not export a name you listed, instead of silently falling back to the original module.- The local (named) form of the directive lists the exports to replace. A name
the mock file does not provide was skipped without a word, so the original
module's export of the same name survived the overlay: the analysis ran on a
half-mocked program (one export from the mock, the other from the real
module), and the directive was still reported as applied. Signatures,
contracts,
.d.tsand schema products were then computed for a program that exists neither in the source nor in the mock. - Such a name is now reported through the existing module-loading error channel
as
nudo:module-missing(error) — one diagnostic per missing name — and the directive is not applied: the original module is left untouched rather than half-overlaid. Exports the mock does provide keep working, and names you did not list still fall through to the original module as documented.
- The local (named) form of the directive lists the exports to replace. A name
the mock file does not provide was skipped without a word, so the original
module's export of the same name survived the overlay: the analysis ran on a
half-mocked program (one export from the mock, the other from the real
module), and the directive was still reported as applied. Signatures,
contracts,
-
0366b6d: Family 04 (core execution / entry), shard E — fixes for bugs 990, 1031 and 286.
- Bug 1031 (core): an
export { … };specifier statement placed before a class declaration made every method of that class collapse tounknown.ctorParamCountOftreated the specifier statement as a declaration and dereferenceddeclaration.typeon anulldeclaration, raising aTypeErrorinside the class-method bridge. The bridge swallowed the error in an emptycatch {}, so the method signature silently degraded tounknownand picked up a misleadingnudo:opaque-resultdiagnostic. Worst of all, a violated return-type contract on such a method was downgraded from an error to a warning, sonudo checkexited0and let the violation through. The null declaration is now skipped explicitly, and the bridge distinguishes an internal failure from a failed evaluation run instead of swallowing it silently. The behaviour no longer depends on the order of theexport { … };statement. - Bug 990 (core):
collectAbsExportsdecided between the re-export branch and the local-export branch by testing whether a module table was supplied at all. With no module table,export { a } from "./m.js"was handled as a local export and invented a named export, andexport { default } from "./m.js"invented adefaultexport — the very existence of adefaultslot is protocol-level information, so consumers were told the module has a default export it does not have. The branch now only looks at whether the statement has a source: an unreachable source yields no export slots at all, matching the "module table present but module missing" case.bindImportsalso resolvesimport { default as d } from "./m.js"throughmod.default, so it now matchesimport d from "./m.js"instead of bindingunknown. - Bug 286 (service): call records for namespace member calls
(
ns.helper(…), both ESMimport * as nsand CJSrequire) only carried the member name, never the receiver. The attribution side splits the callee name on a dot, so the split never happened:targetModule/targetExportstayed empty, the record was dropped by the matching side, and the error-levelnudo:interface-domain-exceedsgate never fired for out-of-domain calls across a namespace import. Such records now carry the receiver's local binding name (ns.helper), the same shape class member calls already use (Brand.method), and a CJSrequirebinding is registered as a namespace import. Ordinary calls (local functions, named imports, host globals) keep their existing record names.
- Bug 1031 (core): an
-
0366b6d: Family 04 (core execution / entry), shard F — the service-side remainder of bug 274.
-
Bug 274 (service):
@nudo:mock Math/JSON/Date/Number… were silently ignored on the call-value channel (nudo testcase values,nudo exportdts, the LSP hover surface). The core side already separates the two injection tables — the "do not shadow host intrinsics" skip list (ENV_SHADOW_SKIP) applies to env globals only, because a mock value is anAbswith no host object identity to preserve (shadowing the host global is exactly what a mock is for). But two service call sites merged the mock table intoenvGlobalsbefore handing it to the engine, so the engine could no longer tell mocks from env globals and the skip list swallowed the mocks on that list — the user believed the mock was in effect while the host intrinsic answered. Both call sites now pass the two tables separately (mocksthrough its own parameter,envGlobalscarrying env globals only):eval-run.ts(tryRunEval) — the call-value / case-evaluation channel,abs-modules-graph.ts(collectAbsBindingsFromGraph) — the module-graph binding surface.
The precedence is unchanged: the engine reads the merged table as
{ ...envGlobals, ...mocks }, so a mock still overrides an env global of the same name, exactly as before when the mock was merged in last.
-
-
0366b6d: Importing an environment module by its default name now infers the same type as importing it as a namespace.
import fs from "node:fs"bound to nothing, because the environment module table only carried the named exports and had nodefaultslot. The import folded tounknown, every exported function of that file degraded tounknown, and the check reported a misleadingnudo:unknown-inferencewarning (the binding was never connected; nothing failed to infer) while still exiting 0. Importing the very same module asimport * as fs from "node:fs"was judged normally, so one import semantics produced two gate verdicts.- Environment modules are CommonJS interoperability modules: Node's default
export for
node:fsis the module object itself, with the named exports on it. The environment module table now carries thatdefaultslot (the namespace of the module) and marks the module as an interoperability module, and the default-import binding has a single source of truth: thedefaultslot when present, the namespace for an interoperability module that has nodefaultslot,unknownotherwise. - Ordinary user modules are untouched: a module table without a
defaultslot still binds a default import tounknownrather than falling back to the namespace.
-
e59c991: String unions are now concatenated member by member, and generated line comments no longer carry a block-comment escape.
-
A value that is one of several string literals was concatenated as if the literals were one piece of text.
("a" | "b") + "!"was reported as the single string"ab!"— a value no call can produce, because the real answers are"a!"and"b!". The same happened to`v=${x}`, which was reported as"v=ab". A union now keeps its members apart while it is converted to text, and the two sides are combined member by member, so the result is the union"a!" | "b!". -
The comment cleaner escaped the end of a block comment everywhere it was used, including inside
//line comments, where it has no meaning. The contract draft printed bynudo contract --draft— the text a user is asked to copy into the sidecar — showed/* no evidence — tighten *\/instead of/* no evidence — tighten */. Line comments now keep the text as it is; a line break inside a comment is still flattened, so a comment can never spill out of its line. Block comments (the JSDoc in the emitted.d.ts) still escape it, because there the escape is what keeps the comment from ending early. -
Member results are combined with the engine's existing "same primitive" rule (
joinValues), not as a raw union. Two literal members still form an enumeration ("a!" | "b!"), but a literal combined with a same-primitive arm that carries no narrowing evidence collapses to that primitive — the same rule the rest of the algebra uses. Without it, a union member whose rendering is alreadystringwould sit next to a literal and print as"NaN days" | "NaN day" | string | …: harder to read than the type it describes, and inconsistent with the signature the same function has everywhere else (formatAge(durationMs: number) => string).
-
-
da4fbfc: Sidecar sections are now recognised by nudo's own marker and nudo's own boundaries, and a class's static and instance methods no longer share one name.
- A sidecar comment that merely mentions
@generated(for example// handwritten contract: this mentions @generated) was treated as nudo's own section header. The whole handwritten contract then lost its obligations — a call site that violated the contract was not reported at all andnudo checkexited 0 — andnudo contract --emit --allreplaced the handwritten contract with the observed values. A header now counts only when the comment starts with@generatedand names nudo, and a section boundary stops at aconstthat the export does not reference. The legitimate generated shapes (the alias section, the composite downstream section with its preludeconst, a multi-step prelude, a header directly above the export) are still recognised. - A static method and an instance method with the same name were both listed
as
C.m, so the two records replaced each other in the tables indexed by name and the signature mixed parts of both methods. The instance method now takes the name on its own, and the generated TypeScript declaration no longer repeats the member. getandsetmembers of a CommonJS object literal were collected as exported functions, which invented an entry point and a spurious "may throw" error. They are not callable entries and are no longer collected.- A CommonJS member assignment whose value is a named function expression was named after the function's own inner id instead of the export slot, so the sidecar contract never bound and the exported symbol was missing from the signature table. The export slot name wins now.
- A sidecar comment that merely mentions
-
da4fbfc: Regression pins for three call-site contract enforcement reports whose symptoms are already gone. No behaviour changes: these bugs were fixed earlier (by the
lit(null)/lit(undefined)literal fix, by theexport defaultdts export-name fix, and by resolving a callee's@nudo:importsidecar against the callee's own directory). The pins exist so the fixed behaviour cannot silently regress.- A parameter whose contract is exactly
lit(null)orlit(undefined)now has a pin that spells out both directions: the one allowed value passes with no diagnostic, and every other value is reported as a violation.nullandundefinedare two distinct domains, solit(null)rejectsundefinedandlit(undefined)rejectsnull. The pin also records that a bare literal contract (oneeqatom) and aunion/nullablecontract (nullish as a member) are different shapes handled by different channels; only the bare literal shape is pinned here. - The dts projection now has a pin for all four
export defaultshapes — named function, class, anonymous function and arrow — and asserts that the emitted export name isdefaultin each case, so a default export can no longer be projected as a named export that does not exist at runtime. - A cross-file call now has a pin that the callee's sidecar is resolved
against the callee's directory, not the caller's: the sidecar next to
the callee loads without an
nudo:interface-loadornudo:contract-syntaxdiagnostic, and the call site still reports the real precondition violation.
- A parameter whose contract is exactly
-
2688251: fix(service): 指令未命中不再静默失效 ——
@nudo:replace目标不存在 /@nudo:mock-module重复声明各有显式诊断(Bug 1062 / Bug 1063)两条是同一根因:指令的语义前提被违反时,引擎静默失效、零诊断 ⇒ 唯一的信号是归因错误的
nudo:unknown-inference(把「你的指令没生效」 说成「推断精度不够」)⇒ 假红 / 假绿。@nudo:replace的目标文本在源码里不存在(Bug 1062):收集面此前把 「目标文本在承载语句的作用域内无对应节点」降级成一条无作用域登记项 ⇒ 转译面恒跳过 ⇒ 声明的类型覆盖静默蒸发;「目标写错一个字母」与 「根本没写这条指令」的输出逐字相同。现在收集面发一条点名目标文本 的nudo:directive-syntax(warning)⇒ 两种情况可区分;目标写对时 零该诊断。@nudo:mock-module对同一模块重复声明(Bug 1063):叠加面此前对同一 specifier 逐条整块覆写(后者胜出、无比较、无告警)⇒ 先声明者独有的 导出名静默消失 ⇒ 该导出名的调用点退化成unknown(wrong-exact)。 现在重复声明发一条点名两条来源的nudo:mock-invalid(warning),且 导出表取并集(同名后者胜出)⇒ 导出名不再静默消失。
诊断码复用既有注册码(
nudo:directive-syntax/nudo:mock-invalid)⇒ 不新增诊断码;两条诊断都不挡门禁 exit(warning 级)。 -
1caec28: fix(service):
@nudo:env多名合并取并集(顺序无关)——Bug 1045@nudo:env node, web与@nudo:env web, node此前得到两张不同的全局表 (packages/service/src/evaluator/env-loader.ts·applyEnvDefinition对同名 全局做整块替换,后一个 env 赢)⇒ 同一份源码只因 env 名书写顺序不同, 签名不同、门禁结论相反(OKvsFAILED:performance.toJSON在 web 有、 node 无 ⇒ 顺序换成 node 赢时pf()被判「必抛 TypeError」)——与文档承诺的 「env 名之间是 union」相悖。合并改为并集:
- obj ⊕ obj ⇒ 逐槽并集(同名槽的值域再并集,不折「后者赢」);
- brand ⊕ brand(同名同 tag)⇒ 内层并集,保留品牌名;
- 其余形态(fn ⊕ fn / obj ⊕ brand / prim ⊕ prim …)⇒ 值域并集(sum);
- 模块侧同名导出名同样取并集,不再 last-wins;
globalEnv.bind绑合并后的值(全局表与 globalEnv 不再分叉)。
并集满足三条纪律,缺一条就会退回「顺序敏感」:可交换(sum 成员按结构键 排序——core 的
makeSum按入参顺序排成员)、可结合(值域并集是「成员集合 的并」而非两两折叠)、不丢实现(fn 的 relation / apply 挂在 Abs 对象上, 并集成员保留原对象,不复制不重建)。单 env(只写
@nudo:env web/node)行为逐字不变:同名声明若结构同构 则直接取同一份对象 ⇒ 全局表与 env 自身声明逐字相同。 -
69e67d3: 族 29 修复 S5:Bug 861 · 864 · 865 —— es env 的 console 成员表补全(
timeStamp/dirxml/profile/profileEnd等缺槽读出 exact undefined ⇒console.timeStamp()假红「may throw TypeError」)、URI 族改走 core 的evalGlobalFn建模(decodeURI("%")的URIError不再被吞 ⇒ L2 假绿修复,抽象实参回落声明域 + may-throw URIError)、es env 补齐 ES 规范全局声明 + service 的「已被覆盖」判定改为按 core 真实建模能力推导(BigInt/ TypedArray 全家 /ArrayBuffer/DataView/AggregateError/Function/escape等不再被报「未被 Nudo 覆盖」,与同一份报告里的精确签名自洽)。 -
69e67d3: 族 29 主 agent 收口:跨分片组合出来的 4 个缺口。
- Bug 884(web 侧):
web.ts的structuredClone声明已删(node 侧同款 修法在node.ts)⇒ 回落宿主内建 ⇒ 不可克隆值的 throws 面(宿主DOMException/DataCloneError)不再被 env 声明整段吃掉 ⇒ L2 门禁恢复。 enforceArgs的并集实参过严(S3 越界发现,主 agent 修正):实参是并集 (如string | undefined)时,leqAbs(sum, pt)整体判 false ⇒ 旧实现把它 当「确定不符 ⇒ 必抛 TypeError」,而原生只在undefined分支抛 ⇒ 可能假红。 现在逐成员判定:只有全部分支都不兼容才判必抛,部分分支不兼容判 may-throw ⇒ 与原生同口径。- Bug 886 / 889 的组合缺口(S1 删声明 + S5 覆盖推导撞出来的):web env 的
TextDecoder声明已删(宿主才有精确的RangeError与「类不可裸调」语义), 但 core 的构造面evalBuiltinNew不认TextDecoder⇒ ①nudo test报「Built-in API "TextDecoder" is not covered by Nudo's type inference」(假阳);② Abs 面与$new宿主面口径分裂。现在evalBuiltinNew补case "TextDecoder"⇒ 两侧同 builder (makeTextDecoderAbs),假阳消失。 - 「已被覆盖」判定里的手写例外已删(族 29 Bug 865 的根因收口):core 其实
已精确建模
WeakRef(evalBuiltinNew的case "WeakRef"),但三条既有 service 契约把WeakRef当作「未被覆盖的全局」样例钉住,于是判定里留了 一张手写例外表——那正是 Bug 865 要消灭的「手写白名单」换了个地方继续写。 现在例外表删除,三条契约的样例全局换成真正未被建模的宿主全局Atomics(core 无Atomics建模面;它是globalThis里的数据属性 ⇒ 不触发访问器副作用),契约的意图(未建模全局要报builtin-unknown、 且不与unknown-global双报)完全保留。
- Bug 884(web 侧):
-
e6c4586: BREAKING: 既有
nudo/…请求的响应信封变了。nudo/trace/nudo/suggestCase的失败路径此前不带isError: true(失败被当成成功,客户端只能从正文分辨)⇒ 现在失败路径返回isError: true(MCP 风格)⇒ 按「有没有isError」分支的客户端行为变了;nudo/hover现在校验位置参数:非整数line/column此前被原样回显 且所有分析字段为null(与「此处无 hover」不可区分),现在答工具错误;column缺省为0⇒{ file, line, column, … }的载荷形状恒成立。
谁会坏:把失败响应当成功处理的客户端(
nudo/trace/nudo/suggestCase的失败 现在带isError: true);以及用非整数column调nudo/hover探测「此处有没有 东西」的客户端(现在拿到的是工具错误而不是一个全null的载荷)。怎么迁移:客户端按
isError分支处理失败;nudo/hover只传整数line/column(column缺省即 0)。Fix agent-tool (LSP) defects found by the族 25 audit:
- 767 —
nudo/trace/nudo/suggestCasefailure paths now returnisError: true(MCP-style), so a failed call is distinguishable from a successful one at the protocol level instead of only in the text. - 768 —
nudo/hovervalidates its position arguments: a non-integerline/columnis a tool error (previously the value was echoed back with every analysis fieldnull, so "no hover here" and "my argument was the wrong type" were indistinguishable), andcolumnnow defaults to0so the documented{ file, line, column, … }payload shape always holds. - 961 —
nudo/whatIfvalidates its arguments: a missingtargetis a tool error (previously a fake success reportingType of "undefined": unknown), a non-arraybindingsis a diagnosable tool error (previously a rawbindings.map is not a function), and a binding withoutnameis rejected instead of silently doing nothing.injectBindingsin@nudojs/servicegained the matching shape guard and names the offending entry (<missing name>). - 993 — the observing agent tools (
nudo/whatIf,nudo/suggestCase,nudo/trace) now analyse through the asynchronous entry point, which preloads path-based@nudo:envmodules. Their output no longer depends on whether the file happens to be open in the editor (previously the same file and tool could answernever/unknownor99depending on call order, together with a misleading "Built-in API is not covered" diagnostic). The analysis caches additionally key on the env preload state so a synchronous analysis taken before the preload can no longer feed a stale "no env" result to later calls. - 955 (shared entry) —
normalizeFilePathnow rejects a non-string / empty / missingfilewith a diagnosablefile is required …tool error instead of leaking a rawfile.startsWith is not a functionTypeError (or silently falling back to the server's working directory). Every agent tool goes through this shared entry point.
-
27a795e: 族 22 修复 D4:Bug 698 700 701 708 717 721 723 —— 补全面与语义 token 面对齐真实语义。
- 尾随点号时补全整面清零:用户刚敲下
obj.的那一刻 buffer 文本语法非法, 而解析不容错 ⇒ 分析直接抛 ⇒ 补全返回空并在 console 报错——恰在最需要补全的 时刻失效。分析输入与绑定解析输入现在共用同一个消毒器(把尾随x.改写成x._),尾随点号与已敲出部分成员名给出同样的成员列表。缓存键仍按真实源码 计算:消毒文本只喂给一次性分析,不写回分析缓存,缓存与真实源码不会串味。 - 指令补全在乘号之后也弹
@nudo:指令:判定是「前面出现过*或nudo」的 子串匹配(@?n?u?d?o?:?整段可选),于是x *之后、字符串字面量里的@nudo:都算命中。指令面现在先算光标的词法上下文(注释 / 字符串 / 代码), 只在光标确实落在注释里时才出;注释里(含跨行 JSDoc)照旧出。 @nudo:sample的补全项吹着「Control loop iteration sampling」,但该指令只被 解析、不被消费;而且插入文本缺 count,接受补全就产生诊断。说明改成如实描述 (reserved / no-op),插入文本带上 count 占位。- 模块级函数的补全项被标成「方法」:顶层
function/ 箭头函数绑定不是任何对象 的成员,IDE 会把它渲染成方法。补全项新增function档(成员函数仍是method,非函数绑定仍是variable)。 - 语义 token 面漏标:类名、类方法、类字段、方法形参、数组解构元素全部不上色, 对象解构的绑定被上成属性。类名 → class 档(图例末尾追加,老索引不变)、类 方法键 → method、类字段键 → property、方法形参 → parameter、解构绑定 → variable。
- 对象字面量里的简写
{ x }是对变量的引用,却被当成属性定义(property 档 且带 declaration 标记)。简写现在是 variable 档且不带 declaration 标记。 - 标识符 token 的长度按解码后的名字算:
const abc = 1里名字是abc(3), 但源码写法是转义序列(8)⇒ token 只盖住转义序列前半截,客户端高亮错位。长度 改用源码跨度(位置口径仍是 UTF-16 code unit)。
- 尾随点号时补全整面清零:用户刚敲下
-
169ed52: The disk cache, the LSP and the Vite plugin now agree with the CLI about environments, budgets and injected modules.
- The cache key did not contain the effective fork budget, so changing
NUDO_MAX_FORKSstill served the previous run's result. The effective value (environment variable, thenpackage.json, then the default) is now part of the key. - An invalid
nudo.check.entryThrowsvalue was reported once per checked file. The warning is now printed once per distinct invalid value. @nudo:asdid not apply to an exported binding, so the tool still reported "bindings applied" while the type stayed unchanged. The override now matches the exported declaration as well.--what-ifattached an assumption to the wrong variable when a line ended with a comment, and it reported a made-up reason when two declarations shared a line. Assumptions are now anchored by statement identity.- The LSP and the Vite plugin never applied
@nudo:mock, so a project that checked cleanly in the CLI reported a spurious "may throw" in the editor and in the build. Both now assemble the same injection channel the CLI uses.
- The cache key did not contain the effective fork budget, so changing
-
02aa122: fix(nudojs):
nudo contract --draft的 dry-run 面(打 unified diff)+--json/--write显式互斥 + 项目根判据按路径分量族 20 · 片 B(660 / 663 / 665)。
- Bug 660 ——
--draft --write --dry-run不打 unified diff(只打一行 「[dry-run] would write → …」),而 CLI Reference 承诺--dry-run= "Print a unified diff instead of writing"。同一个--dry-run旗标在--emit与--draft两条分支上语义不同。现在--draft分支复用--emit分支的同一个 diff 生成器(unifiedDiff,已在@nudojs/service/emit⇒ 零新增导出),对照面是既有草稿文件的磁盘内容 (与--draft --json审阅面同款口径),diff 头与--emit --dry-run同形 (--- a/<path>/+++ b/<path>);dry-run 仍然不写盘。 - Bug 663 ——
--draft --json --write静默丢弃--write(--json分支 早退 ⇒ 写盘分支不可达)⇒ 草稿根本没落盘、exit 0、零提示 ⇒ 假绿 + 静默 数据丢失。现在--json与--write显式互斥:error: --write cannot be combined with --json+ exit 1,机器面仍给出 一份合法 JSON 载荷({file, errors:[{code:"nudo:usage-error"}]},由命令层的 跨文件聚合层收进恒定数组外壳)。 - Bug 665 —— 项目根边界用
rel.startsWith("..")判逃逸 ⇒ 项目根下的 合法目录名(..data//...cfg/)与合法文件名(..data.js)被误判 成「越出项目根」⇒ 草稿拒写(exit 1),而同一项目里的普通文件正常写出。 判据改成按路径分量:「整段等于..」或「以..+ 路径分隔符开头」或 「跨盘(绝对路径)」——CLI 半(nudo contract --draft --write)与 service 半 (writeInterfaceDraft的写盘守卫)逐字同款;真正越出项目根的路径仍被 拒。
- Bug 660 ——
-
02aa122: fix(core,service): 侧车契约与 zod 产物不再把
-0渲染成0(族 20 · 片 D · Bug 1065)-0与0身份不同(Object.is/1/x可观察),而String(-0) === "0"⇒ 负号被抹掉 ⇒ 同一个值在三处被渲染成另一条契约。- core(
packages/core/src/algebra/interface.ts):litToString的 number 分支改用仓库既有的保真口径litKeyString(./term.ts:Object.is(v, -0) ⇒ "-0", 与format.ts的formatLitValue同款判据);lengthBound的常数界渲染 (.length(n))同款口径一并改。⇒ 侧车写的lit(-0)现在如实渲染成lit(-0):nudo contract回显、nudo check诊断的expected:/suggestion:、 以及侧车 DSL 回写(nudo contract --emit)都不再抹掉负号。 ⇒ 零新增公开导出(litKeyString是同包相对 import,core 冻结面未动)。 - service(
packages/service/src/emit/schema-generator.ts):case "lit"的 数字分支保真写z.literal(-0)(改前是z.literal(0))⇒ 产物不再 比门禁宽(门禁按lit(-0)判红、产物却放行0⇒ 假绿)。 ⚠ zod 的 literal 走===口径 ⇒-0与0在运行时不可区分 ⇒ 该处 已知有损 ⇒ 产物就地加注释标明(消费方看得见),不许静默放宽。 (zod 的运行时行为本次未独立复现——环境无 zod 依赖。)
诊断文本与 zod 产物是同一个渲染上游(
formatConstraint⇒litToString) ⇒ 一处修,两面同时保真。 - core(
-
3432d8c: Two
nudo testcase-reporting defects are fixed in the shared service analysis layer; the CLI report faces (nudo test,nudo test --json) inherit both fixes because they consume the same judgement function.- A throwing case could never fail its declared expectation. The observed
value of a case that throws is
never, andneveris the bottom element of the type lattice (never ⊑ anythingalways holds), so the structural check passed for every declared expectation.@nudo:case "t" (1) => 42on a function that throws used to be reported as✓ 1 passedwith zero diagnostics. The judgement now carries a precondition: an observednevercan never satisfy an expectation, so the case is reported as failed andnudo:case-expectedis raised. The expectation text shown to the user is unchanged — a predicate expectation still renders asnumber (> 0). - The case-level
nudo:may-throwwarning ignored a declared, intentional throw. A throw declared with@nudo:case "t" (1) !! throws TypeError,@nudo:throws TypeError, or a sidecarfn(…, { throws: "TypeError" })was accepted bynudo check(zero errors) but still reported bynudo test, so the two verbs returned opposite verdicts for the same file. The case-level warning now uses the same mouth as the check face: a declared throw is not reported. Undeclared throws are still reported, and the remediation text now points at the mechanisms the user is already using (@nudo:throws <Kind>/@nudo:case … !! throws <Kind>) instead of only listing try-catch and@nudo:contract.
- A throwing case could never fail its declared expectation. The observed
value of a case that throws is
-
27cc16a: The directive grammar now has a single enforcement face: the case-argument grammar of the check product, the case emitter, the function census and the diagnostic positions are aligned with the parser.
- The check product parses a case witness with its own literal grammar (a
decimal regular expression, and a string sliced off its first and last
character). A witness written as
1e3or"a\tb"therefore did not denote the value the user wrote, and the contract gate reportedwitness ⊭ contractfor a witness that was in fact correct — while the same file, read by the parser, held a different value. The check product now uses the same literal grammar as the parser: JavaScript number semantics (exponent, hex, binary, octal, separators) and JavaScript string semantics (escapes), and a text that is not a single literal is no longer folded into a confident wrong value. - The case emitter wrote a string value into the directive text verbatim, so a
value containing a backslash or the quote character produced a directive
that no longer re-parsed to the same value —
nudo test --freezewrote out a case that failed on the next run. The emitter now escapes what the grammar requires. Non-finite numbers (NaN,Infinity) and bigint literals were dropped from the emitted case entirely (the whole case was abandoned); they are now expressible. - A static class method was visible in the signature surface of
nudo checkbut invisible in the function census ofnudo test/nudo health/nudo contract, because the census only collected instance methods. The census now collects static methods as well, matching the check product. - A directive diagnostic carried no position, so every occurrence of the same problem was reported at the same place and the product surfaces could not point at the offending directive. Diagnostics now carry the position of the offending directive.
- The union splitter of the what-if surface did not treat a backslash as an
escape inside a string, so a type expression containing
\"was split in the wrong place.
- The check product parses a case witness with its own literal grammar (a
decimal regular expression, and a string sliced off its first and last
character). A witness written as
-
aa23265: fix(service): 产物面(dts / schema / standard)2 条——internal 槽不再外泄,用户类 brand 不再产出未声明的类型名(族 55 · W5)
产物面有两面:dts(类型声明)与 schema / standard(运行时校验器)。本次两条 都落在同一个语义缺口上——产物把 Abs 内部实现细节当用户可见的公开面 直出。
1) Bug 240:产物面仍发布 internal 槽
internal 槽(
Slot.internal)不是自有可枚举属性——私有字段(#x)与生成器协议 槽(next/return/throw/constructor/@@iterator)都属此类。core 侧 早已统一判据(format.ts投影面 /projection.ts约束面 /denote.tsguard 面 同款isHiddenInternalSlot:internal且键不是规范数组下标 ⇒ 该槽对属性 introspection 不可见 ⇒ 不进产物),但 service 的产物面没跟上:- dts 形参位:
widenParamAbs造新槽时丢了internal/symbolKey标记 ⇒ 内部槽被"提权"成用户可见字段——改前export declare function f(x: { a: number; "#priv": number; "@@iterator": number }): number;(私有字段与 symbol 键协议槽按字符串键直出)。 - dts 类体:私有字段进
declare class的字段列表。 - schema 形状兜底路径(约束不可表达时,如 open 对象):内部槽进 zod / standard 产物。
现在 service 产物面复用 core 的同一判据(
packages/service/src/emit/internal-slot.ts的isHiddenInternalSlot,判据逐字同款,不另造):内部槽不进 dts / schema / standard 产物。规范数组下标槽是例外(族 01 口径:生成器的数字下标槽承载 元素域,不是内部实现细节)——该例外与 core 三面、约束面、schema 面前后一致。2) Bug 233:dts 面把用户类 brand 渲染成从未声明的类型名
absToTSType(brand("Counter"))=Counter⇒ 产物里那个类名从未声明 ⇒ 消费方 tsc 报 TS2304("Cannot find name 'Counter'")。修法按模块面口径(产物是 一个模块,类名必须在模块里可解析):- 本地声明的类 ⇒ 保留类名 +
declare class(Bug 517 既有口径逐字不变); - import 进来的类 ⇒ 保留类名 + 补
import type { C } from "…";——族 15 S11 的 zod 白名单口径「补 import 的类名不能被误杀」:不能把未声明的类型名一律降级, 已 import 的类名要保留(模块面新增导入面扫描:DtsModuleSurface.imports); - 两边都没有的类名 ⇒ 降级为
unknown(不再产出未声明的类型名 ⇒ 不再 TS2304),并在产物头部留降级台账(// nudo:unresolved-class …)⇒ 降级 可诊断(台账点名被降级的类名)。 - TS 全局类型名(Date / RegExp / Error / URL …)与 zod 白名单同名单
(
RUNTIME_GLOBAL_CTOR_NAMES,族 15 S11 同源)⇒ 原样保留,无需声明。
纯投影面(
absToTSType单值投影,无模块面 ⇒ 无声明面可判)保持既有口径逐字 不变(absToTSType(brand("User"))仍是"User",见既有钉emit-bug-521)。四面口径:dts / schema / standard / guard 对 internal 槽现已同款(guard / 约束面此前已由 core 修好,本次补齐 service 侧);对 brand 类名,schema / standard 仍按族 15 S11 的 zod 白名单口径(用户类降级
z.unknown()+ dropped 台账——zod 产物只 import zod,不能引用用户类),dts 面则因类型面可以补import type而保留已 import 的类名——这是产物形态的固有差异,不是口径分叉。 - dts 形参位:
-
e3b8791: The generated products and the named imports of a module now agree with each other.
- The schema product rendered the brand of a generator as
z.instanceof(GeneratorFunction), which made the generated module fail to load with aReferenceError. The brands that are not globals are downgraded toz.unknown()and the loss is recorded, so the product can always be loaded. - A named import of a function from an environment module wrapped the
declared function in a JavaScript arrow function, which dropped the
declared parameter and return types: the signature showed an invalid
placeholder and the generated declaration file disagreed with it. The
named import now yields the declared function itself, so both import
forms report the same type. The function is still callable: a call and a
newboth dispatch to it.
- The schema product rendered the brand of a generator as
-
b37321b: The analysis service finds the functions, the call sites and the evidence the way the source describes them.
- A function declared as
export const f = () => {}was invisible tonudo test,nudo exportandnudo contract, althoughnudo checksaw it. Every product now sees the same set of functions. module.exports = { f: fn }was invisible for the same reason.export default function f() {}was looked up under its local name, while an ESM default export lives underdefault— the lookup missed, the signature degraded tounknown, and a misleadingnudo:opaque-resultwas reported.- A call site inside an exported function body produced no
call@case at all, so the call-site domain of that function was lost and the export was reported as entry-only. Call sites are now collected while the function body is evaluated. - A case name taken from the line number in the calling file collided between two call sites, pointed at an unrelated line, and made a second freeze drop the new witnesses. The name now carries the file it refers to when the call site is elsewhere, and the emitter compares witnesses by identity.
- An expectation written as a predicate —
number().gt(0)— was compared structurally and therefore always failed. The value is now checked against the predicate, and the report says so when a predicate is not satisfied. - A
@nudo:caseon a class method was never evaluated, so the witness was alwaysunknownand every expectation failed. Class methods are evaluated now. - The value reported for a synthesized call-site witness was re-evaluated in the target's context and could disagree with the actual call. The observed value is reported now.
- A sidecar that failed to load was reported as "no contract root", which
sends the reader to write a contract that already exists. The load failure
is reported as
nudo:interface-loadnow. - A line-level directive (
@nudo:as,@nudo:replace) inside a loop body, atryblock, aswitchcase, a labeled statement, an arrow function body or a class method body was dropped without a word. Those positions are collected now, and a directive that cannot be applied anywhere is reported asnudo:directive-syntax. - A dependency module's own
@nudo:as/@nudo:replacedirectives were ignored, so the same file analyzed as a root and as a dependency got different types. - A live import binding was frozen into a snapshot when the module graph was merged, so a change inside the dependency was invisible to the importer.
- The synthetic
entry@cases shared one module instance, so module-level state leaked from one case into the next. - A project-level path env file's content was not part of the analysis cache key, so a changed env file reused the previous result within the same process.
- Two functions declaring a
@nudo:mockof the same name: the one declared last won the whole file, and the first function was given the wrong type. The mock is now chosen by scope. - An inline
@nudo:mocklost the fact that it can or cannot be constructed, sonewon it did not throw where it should have. - A
@nudo:mockin itsrejectsform was modelled as returningnever, which made any return contract vacuously true and wrotef(): neverinto the generated declaration file. It is modelled as a promise that never fulfills now. - A
@nudo:puredirective never reached the function it marked, so the directive did nothing. nudo:builtin-unknownreported an imported or exported alias as an uncovered built-in, adding a warning next to a type that had already been inferred exactly.- A
--what-ifbinding naming a type Nudo cannot express was silently widened toany, while the report said the binding had been applied as written. It degrades tounknownnow, and the report says what was actually injected.
- A function declared as
-
b37321b: Project configuration is normalized once, and every product reads the same normalized value.
- A
nudokey whose value is not an object —"nudo": true— was ignored without a word, and it also suppressed the "this project has no Nudo configuration yet" hint. The key now stops the search for an ancestor configuration (the documented rule is "the nearestpackage.jsonthat contains anudokey"), the package is treated as having no Nudo configuration, and a note on stderr says so. - A
nudokey holding a falsy value (false/null/0/"") did not stop the search either, so a sub-package silently inherited the root package'scheck.ignoreThrowsandnudo.env. Presence now stops the search, whatever the value is. nudo.contract.autoBindwas passed through verbatim. A non-boolean value madecheckandcontract/exportdisagree — one side treated it as "off", the other as "on" — and the disk cache could not tell the values apart, so a wrong conclusion was cached. The value is normalized to a boolean once, and a non-boolean falls back totruewith a note.nudo.check.entryThrowswith an invalid value printed "using error" while the gate actually used the value theprofilepreset selects. The note now names the value in effect.nudo.cache: ""did not overrideNUDO_CACHE_DIR; an explicit empty string now means "off", likefalsedoes.NUDO_MAX_FORKSwith an invalid value fell through tonudo.analysis.maxForks, so the run quietly used a budget the user had not asked for. An invalid value now falls back to the default and says so.nudo.analysis.maxForksand the session cache limit are per-project settings, but they were written into process-wide slots only when the project configuration was looked up for the first time. Two projects analyzed in a different order got different results. They are now applied on every lookup, so the same project and configuration always give the same answer.- A
package.json#nudo.enventry that is not an array, or an array with a non-string element, is reported instead of crashing the loader.
- A
-
dde4b03: The
.d.tsproduct now projects the module's export surface: export names, classes and re-exports.export default function (…),export default (…) => …,exports.compute = …andconst f = …; export { f }were dropped from the.d.tsproduct even though the export face advertised them. They are now declared.- A declaration is named after the export name, not after the local
binding:
export { internal as publicName }is declared aspublicName, andexport default function addOneis declared asexport default function addOne. The local binding name is never mistaken for the export name. - A class is projected as a class:
export class C { … }becomesexport declare class C { … }with the constructor and the static methods inside it. The instance methods are no longer flattened into a module-levelC_mexport, which never existed in the source and merged with a real export of the same name into a fake overload. - A class instance type (
User) referenced by a declaration is declared as well, so the.d.tsno longer fails to compile withTS2304: Cannot find name 'User'. export * from "…"andexport { x } from "…"are re-emitted, so the product's export surface matches the source module's.
-
dde4b03:
nudo test --freezenow writes into the source file without disturbing the file's byte shape, and the diff it prints can be applied bygit apply.- A UTF-8 BOM used to move into the middle of the file. The freeze writes
the new
@nudo:caseblock above the declaration, so the first line moved down one line — and the BOM, which lived on that first line, moved with it: the file stopped being "UTF-8 with BOM" and became a UTF-8 text with a zero-widthU+FEFFsitting in front of theexport. The BOM is now kept aside while the body is edited and put back at the very front of the file. The same holds when already-generated directives are stripped (the first line may be dropped there, and the BOM used to go with it). - A CRLF file stayed CRLF. The newly inserted lines now follow the file's
dominant line ending, so
file(1)keeps reporting "with CRLF line terminators" instead of switching to "with CRLF, LF line terminators", and the lines that were already in the file keep the endings they had. - The printed diff of a file without a final newline could not be
applied.
git apply --checkrejected it, because the diff did not say that the last line has no newline. The diff now follows the same line model asdiff -u/git diff: the last line without a terminator is marked with\ No newline at end of file, and whether the file ends with a newline is treated as part of the content (as native tools do). Diffs for files with a final newline are unchanged. - The diff no longer hides byte changes. The BOM stays in the first line
of the diff (the same shape native
git diffproduces), so a patch against a BOM file still applies, and a real byte change — a BOM being dropped by a writer, say — is shown instead of being reported as "no change".
- A UTF-8 BOM used to move into the middle of the file. The freeze writes
the new
-
dde4b03:
nudo contractno longer loses recursive contracts, crashes on bigint literals, or prints the contract's parameter names as the function's formal parameter list.- The contract surface cached constraints with
JSON.parse(JSON.stringify(c)). Alazy()slot is a thunk (a function), andJSON.stringifysilently drops function-valued properties, so a recursive constraint collapsed into an empty optional slot: the first run printed the expanded recursive shape, every later run printedany().optional(), and the cached surface was weaker than thenudo checkgate for the same file. Constraints are now encoded with a dedicated codec: literals keep their type (bigint,±Infinity,NaN,-0,undefined), and alazy()slot is stored as an index into a node table that is rebuilt into a thunk on read-back, so a cold run and a cache-hit run print the same thing. JSON.stringifycannot represent abigint, so a contract with a bigint literal made the wholenudo contractcommand fail with a bareDo not know how to serialize a BigInt(exit 1, no file, no diagnostic code) whilenudo check,nudo healthandnudo teststayed green on the same file. Bigint literals are now encoded losslessly and the command prints the contract normally.- The printed effective contract used the parameter names declared by the
contract, so a contract binding
zzzprinted(zzz: …)for a function whose parameter isx, whilenudo checkprintedscale(x: any)for the same file. The printed parameter list now comes from the declared formal parameter list (the same source as thenudo checksignature), and a contract parameter that binds to no formal parameter is listed separately and marked(not a formal parameter)instead of taking over a parameter name.
- The contract surface cached constraints with
-
dde4b03: Quickfix edits: the
@nudo:throwsannotation now lands on the declaration it belongs to, TS sidecars carry their builder import, and the nullish quickfix no longer swallows a contract'sthrowsobligation.- The
@nudo:throwsannotation was written into the wrong place, or into a file that no longer parsed. The quickfix located the declaration by name (first line that matched) and then scanned downwards for the first line containing a JSDoc terminator. A plain block comment (/* note *\/) inside the function body carries the same terminator, so the bare tag was emitted outside of any comment and the file stopped being valid JavaScript. The declaration is now resolved through the AST (top-level declaration of that name — a same-named local binding inside another function no longer matches) and the tag is written inside the JSDoc block actually attached to the declaration; when there is none, a complete JSDoc block is inserted above the declaration. - Sidecars written for TypeScript sources did not compile.
nudo check --fix --writeemitted the contract DSL (fn({ x: shape({ toFixed: any() }) })) into a*.nudo.tssidecar without any import:fn/shapewere undeclared (TS2304) andany()collided with the TypeScript type keyword (TS2693), so the product failedtsc --noEmit --strict. TS sidecars now import the builders they use from@nudojs/core, renaming the ones that clash with a TypeScript type keyword, and the DSL is rewritten accordingly. JavaScript sidecars keep the existing "engine injects the builders" contract. - The nullish quickfix deleted the user's
throwsobligation. Thenullable(...)wrapper was applied to everything between the first top-level comma and the closing parenthesis offn(...), which swallowed the third argument ({ throws: "Error" }). The gate then reported a different error (entry-may-throwinstead ofconstraint-violated) — a "fix" that traded one red for another. Only the return slot is wrapped now; the remaining arguments are preserved verbatim, and the edit is downgraded to a review when the engine cannot prove that the gate turns green.
- The
-
dde4b03:
nudo contract --emitno longer writes a derived contract twice for the same downstream export, no longer lets one root overwrite another root's contract, and no longer keeps the generated section of an export the source no longer has.- Two handwritten contracts in the same root file that call the same
downstream export produced two derived rows for one export name, so the
target sidecar got two
@generatedsections exporting the same name. That file is not valid ESM (SyntaxError: Duplicate export of 'add2'), so the sidecar never loaded and the derived contract silently degraded to a no-op (add2(x: any)). The roots are now aggregated per downstream export into a single derived row whose parameter domain is the union of the roots' domains (the widest one), and the sidecar is checked for duplicate export names before it is written — Babel does not report them, so the check is explicit now. - When different root files derive the same downstream export, the last writer simply replaced the previous section, so the snapshot covered only the call sites of one root and the result depended on the order in which the commands were run. The write now merges the new derivation with the existing section (again the widest domain) and records every contributing root in the section header, so the same source tree produces the same snapshot whatever the order is.
- A generated section whose export no longer exists in the target source was never removed: it stayed in the sidecar as an export that does not exist at runtime and permanently held on the name, so a hand-written contract for a new function of the same name made the whole sidecar fail to load. The derived path now drops those stale sections and no longer derives a contract for an export the target does not have.
The update path of the derived emitter also stopped appending the sections it did not rewrite a second time — they are already in place, so the sidecar used to end up with the same section twice (and an invalid export name).
- Two handwritten contracts in the same root file that call the same
downstream export produced two derived rows for one export name, so the
target sidecar got two
-
dde4b03: Derived contracts now name the parameter the implementation actually returns, and the same function derives the same contract no matter how many call sites the root has.
- The return slot of a derived contract was anchored to a parameter by the
derivation root node id alone. Every parameter derived from the same
upstream variable shares that id, so
helper(a, b) { return b; }called ashelper(x + 5, x + 1)anchored the return to the first parameter and wrotefn({ a, b }, a)— a return constraint ofnumber().gt(5)for an implementation that only guaranteesnumber().gt(1). The contract was stronger than the code, andnudo contractdisplayed it as authoritative. The anchor is now resolved against the parameter it actually describes: when several parameters share a root, they are told apart by the constraint value, and when that is still ambiguous the relative anchor is refused instead of guessed, so the return slot falls back to the direct chain projection. - A derived contract for one function could change shape when the root
called it once or twice. The derivation tags were read after the call-site
values had been joined, and joining two equal values returns one of them,
so the join tag replaced the shift chain of the first call site and the
compositional projection was never reached. The tags are now read before
the join, and the return slot of a multi-call-site root is projected call
site by call site.
add2(x) => x + 2called once or twice now derives the samefn({ x }, x.shift(2)), instead of the second form degrading to a literal bound one ULP away (number().gt(0.9999999999999999)), which accepted a boundary value the exact form rejects. - When the call sites of one root do not derive the same chain, the derived
section falls back to the expanded form; it no longer emits two
constdeclarations of the same name with different values, which is not valid JavaScript.
- The return slot of a derived contract was anchored to a parameter by the
derivation root node id alone. Every parameter derived from the same
upstream variable shares that id, so
-
dde4b03:
nudo export --format dtsnow derives its parameter table from the declared formals instead of from the observed call arity, and renders optionality the way TypeScript means it.- The parameter table used to be cut to the number of arguments seen at call
sites, so a rest parameter produced
export declare function sum(...xs: number): number;— not valid TypeScript (TS2370) — and a second call shape appendedarg1/arg2after the rest parameter (TS1014). The table now follows the declared formals: a rest parameter absorbs the trailing arguments and is always last, and its type is promoted to an array. - A parameter declared by a contract but never exercised by a case used to
disappear from the
.d.ts(addAll(a: number)for a two-parameter contract), whilenudo check, the zod face and the standard face all kept it. The declaration is now authoritative for the table's length; cases only contribute types. - A parameter with a default value was rendered as required, so consumers
calling
def()oroptNoEvidence(1)— both legal in the implementation — hitTS2554. Optionality now comes from the contract, then from the declared default, then from the shortest observed call. - A contract that marks a top-level parameter optional
(
number().optional()) lost that marker in the.d.tsand rejected calls the contract allows (TS2345). The contract face now carries the optionality flag and the declaration rendersx?: number. - A destructured parameter lost the whole handwritten contract and was
declared
act(_p0: unknown), leaving TypeScript consumers with no type checking at all. The contract's field-level entries are now projected into the parameter's shape and the declaration uses the binding-pattern name (act({ a, b }: { a: number; b: number })). - Optional object slots were rendered as
k: T | undefined, which in TypeScript still requires the key — the projection was stricter than the contract, the zod face, the standard face andnudo check, and rejected values those four accept (TS2345/TS2741). They are now rendered as the optional propertyk?: T, matching the?already used for top-level parameters.
- The parameter table used to be cut to the number of arguments seen at call
sites, so a rest parameter produced
-
dde4b03: dts 投影面:Abs → TS 类型渲染与导出绑定名清洗的 6 处修正
- 520:手写契约的返回域保形——
lit(42)渲染成42(与 zod / standard /nudo check三面同口径);旧口径把契约返回 widen 成number(字面量住在 Abs 的 pred 里、不在 term 里,widen 路径看不到它)。 - 521:内建泛型 brand 补类型实参——
Map<unknown, unknown>/Set<unknown>/WeakMap<object, unknown>/WeakSet<object>;旧口径直出 裸名 ⇒ 产出的.d.ts吃 TS2314、编译不过。 - 544:Abs 的
any(未受约束)与unknown(推断失败)分面——前者渲染 成 TSany、后者才是unknown(abs.md:100明文规则);旧口径两者合并成unknown⇒ 消费方吃 TS2571 假红,而 zod / standard / guard 三面都宽松。 - 552:导出绑定名过保留字清洗(core 的
toJsBindingIdent口径,default/class等加_前缀);旧口径直出 ⇒ 整份.d.ts吃 TS1359 + TS1005。 - 554:生成器 / 迭代器形态识别——带
next槽的对象渲染成Generator<T>/AsyncGenerator<T>/IterableIterator<T>(元素类型取数字下标元素槽), 内部槽不进结构字段;旧口径把内部协议槽当普通字段直出 ⇒ 返回类型里没有[Symbol.iterator]()⇒ 消费方for…of吃 TS2488。 - 565:零成员对象渲染成
Record<string, never>(不是 TS 的{}=任意非 nullish 值)——属性读不再吃 TS2339 假红,且在联合类型里不再吸收{ a: number }(契约义务不再被静默作废)。
- 520:手写契约的返回域保形——
-
dde4b03: The Standard Schema face now enforces what its own type says, and its
validatenever throws.- A fixed-length tuple was only checked element by element, so
pairOutput.validate([1, "two", 3])passed even though the exported type is the 2-tuple[1, "two"]— the engine (leqAbs) and the zod face (z.tuple) both reject it. The tuple arm now requires the array length to match the element count, unless the tuple has arestslot. - The two copies of the validator disagreed: the library version walked
arrays with
forEach(which skips holes) while the generated module used an index loop (which reads a hole asundefined), so the same schema and the same sparse array got opposite verdicts. Both copies now use the index loop, matching the zod face and the engine, which both read a hole asundefined. - A
brandnode was accepted unconditionally, somkDateOutput.validate({})passed while the zod face of the same export (z.instanceof(Date)) rejected it. A brand whose name is a runtime global constructor is now checked withinstanceof(no import needed, the product stays importable); brands with no runtime criterion (user classes) are still passed through, and the projection already records them as dropped. - A
fnnode was accepted unconditionally, so a function-typed output validator passed42/null/"str"/{}while the zod face (z.function()) rejected all of them. Afnnode now requires the value to be a function (the signature is not checked). - A required slot was only considered present when it was an own
property, so a value carrying the key on its prototype
(
Object.create({ c: 1 })) was reported as missing — stricter than the zod face and than the TypeScript structural type, which both accept it. Key presence now followsHasPropertysemantics, minus theObject.prototypepollution keys (toString,constructor, …). ~standard.validatethrew aTypeErroron abigintor a circular object, because the issue message was built withJSON.stringifyon the runtime input. Standard Schema v1 requiresvalidateto return a result, so the message is now built with a safe description (1n,<unserializable>) and any error is reported as an issue instead of escaping.- The issue message no longer loses non-finite numbers:
Infinityis reported asexpected Infinity, got 0instead ofexpected null, got null, matching the zod, guard andnudo checkfaces.
- A fixed-length tuple was only checked element by element, so
-
dde4b03: Emit products: the zod
numberschema now covers the whole JavaScript number domain, the type guards are valid TypeScript, and a literal that only came from an uncertain observation is no longer projected as the exit domain.- The zod schema rejected the very value the exported function returned.
An Abs
numberprimitive covers every JavaScript number, NaN and ±Infinity included, but zod'sz.number()only accepts finite numbers (its parse requires!Number.isNaN(input) && Number.isFinite(input)). The projection was therefore narrower than the type it claims to describe: a function returning0 / 0was described by a schema that rejected its own return value, so consumers validating the result got a false red. The zod dialect now widens an unrefinednumberto the full domain (z.number().or(z.nan()).or(z.literal(Infinity)).or(z.literal(-Infinity))). Anumberthat carries a refinement keeps the narrow form, because the refinement itself already excludes the non-finite values (x > 5,Number.isInteger(x)). The shared schema node is unchanged, so the standard dialect keeps its current (NaN-accepting) number check. - The generated type guards did not compile.
<file>.nudo.guard.tsis a TypeScript file, but the guard signature carried no type annotation (export function isUserOutput(data) { … }), so undertsc --noEmit --strictthe parameter was an implicitany(TS7006) and the product could not be used in a strict project. The guards now takevalue: unknownand returnboolean; inside the body the checked value is narrowed to the narrowest type that lets the predicate compile — the primitive type for a primitive or literal, a dynamic object shape for a structural form, and the union of the member types for a union. Only built-in TypeScript type names are used, so a product never references a user class name (TS2304). - A literal observed once was projected as if it were the exit domain.
When the only evidence about a return value is an uncertain observation (a
join of several call sites, a mock, or a fallback evaluation), its literal
is not the function's exit domain: a rest parameter observed through the
fallback evaluation was projected as
literal(1)by the zod, standard and guard dialects, and those products then rejected the exported function's own return value. Literals from uncertain observations are now widened to their base type in all three dialects, and the widening is recorded in thedroppedledger. Literals that are certain (exactconfidence) and literals coming from a hand-written contract keep their exact form.
- The zod schema rejected the very value the exported function returned.
An Abs
-
dde4b03:
nudo contract --emitnow writes sidecars that are valid, compilable and byte-faithful, and it no longer contradicts the LSP lens or the check face.- A value-level template in the sidecar (
export const classify = number()) was treated as a handwritten function contract, so the emitter refused to persist anything for that name ("handwritten wins — skipping") while the code lens showed the function as having no contract. The clash set now follows the same rule as the tier face (onlyfn(…)bindings are contracts); a non-contract binding that occupies the export name is replaced in place by the generated section, so the sidecar becomes valid and the contract takes effect. - A generated section could collide with an import local binding of the
same name, which made the whole sidecar unloadable
(
Identifier 'x' has already been declared) and silently dropped every contract of that file — while the tool reported success. Import locals are now part of the binding allocation, so the section falls back to an alias binding (const _nudo_1 = …; export { _nudo_1 as x };). --emit --fn <name>no longer reorders the existing@generatedsections: the sections are replaced in place, so a refresh produces a content-only diff instead of a pure reordering (which made--exit-on-difffail in CI on the first run).- The sidecar keeps its own byte shape: the generated sections now use the sidecar's dominant line ending (a CRLF sidecar no longer becomes a mixed CRLF/LF file), and a UTF-8 BOM is preserved instead of being silently dropped (a no-op emit no longer reports a change).
- A sidecar for a TypeScript source (
*.nudo.ts) now declares the builders its generated section uses, so the product compiles (tsc --noEmit --strictreportedCannot find name 'lit'/'fn'before). The declaration is type-only and keeps the runtime behaviour of the JavaScript sidecar (builders are injected by the sidecar loader). - The
nudo:interface-emit-deniedmessage now names the source file that was rejected and states that the allowlist patterns match the source file path, so an allowlist copied from the documentation is not refused forever. - The emit summary is the single place where diagnostics are rendered: a diagnostic is printed once, and the CLI and the LSP agent face agree.
- A value-level template in the sidecar (
-
dde4b03:
nudo contract --draftnow writes a draft that can be copied into a sidecar as-is: the sidecar key is the module's export identity, the file is always valid JavaScript, the return obligation never contradicts the function's own inferred return domain, and a draft the user has edited is never silently overwritten.- The draft's sidecar key came from the analysis name, sanitized into a
legal identifier. An anonymous
export defaulttherefore got the synthesized key_default, while the key that actually binds isdefault— copying the draft into*.nudo.jsleft the contract in place but inert, andnudo checkstayed green on a call that violated it. The key is now the export identity (the same source asnudo contract --emit), and an unsafe binding name is emitted in the alias formconst _nudo_N = …; export { _nudo_N as <identity> };. - The builder
importand the generatedexport const <name>shared one module scope, so a function whose name is a builder name (number,lit,union, …) producedimport { number } from "@nudojs/core"next toexport const number = …— a parse-timeSyntaxError: Identifier 'number' has already been declared. The generated file was not valid JavaScript, so the "copy the accepted exports into the sidecar" step could only produce a broken sidecar. The same collision is fixed in the--from-dtsdraft. - A rest parameter (
...rest) was rendered into the constraint DSL verbatim ({ first: number(), ...rest: number() }), which is neither a legal object literal nor legal DSL: copying the draft broke the whole sidecar (nudo:interface-load), losing every contract in the file. Rest-parameter functions are now reported asnot-projectableand skipped, and every draft is assembled once (execNudoModule) before it is written — a draft that does not load is never handed to the user. - The return obligation was derived only from the observed call sites,
which are a subset of the function's real return domain:
opt(flag)returning1 | nullwas drafted asfn({ flag: boolean() }, number()), so accepting the draft made the function violate its own draft. The obligation is now checked against the inferred return domain (the same source as thenudo checksignature) and is not written when it does not cover it. --draft --writeoverwrote a hand-edited*.nudo.draft.jswithout a word, while the file's own header claims "Handwritten contracts are never overwritten". Drafts now carry a content fingerprint; a draft whose content no longer matches its fingerprint is kept as-is and the command reports that it was not overwritten.
- The draft's sidecar key came from the analysis name, sanitized into a
legal identifier. An anonymous
-
dde4b03:
nudo test --freezenow writes call-site witnesses without disturbing the source file it writes into: the new@nudo:caseblock lands at the declaration's own column, it keeps the file's line-ending convention, and a witness that cannot be expressed faithfully is dropped instead of being written as a different (wrong) value.- The frozen JSDoc block was indented by the
functionkeyword's column instead of the declaration's. Forexport function greet(u) { … }the function node starts at column 7 (export default functionat column 15), so the whole block was shifted right and no longer lined up with the declaration it documents. The block is now indented like the declaration line it is inserted above, which keeps nested functions at their own indentation. - Writing into a CRLF file produced mixed line endings. The existing
lines kept their
\r\n, but the newly inserted block was written with bare\n, sofile(1)started reporting "with CRLF, LF line terminators" and the file's line-ending convention was silently rewritten. Newly inserted lines now follow the file's dominant line ending, and the existing lines keep the endings they already had. - A sparse tuple's holes were frozen as explicit
undefinedelements. The hole of[1, , 3]carries the same abstract value as an explicitundefinedelement, so the witness could not tell them apart and was written as[1, undefined, 3]. Reading that back says the array is dense: the very same call site flipped fromfalsetotrue, i.e. the freeze rewrote an observed fact into its opposite. The case-argument grammar has no spelling for a hole, so such a witness is now skipped (like a witness with a rest slot) instead of being approximated.
- The frozen JSDoc block was indented by the
-
106ad1d: 族 54 · service 协议面收口(3 条中的 2 条;第 3 条在 nudojs 包,见下)。
Bug 697(env 模板族扩展名表) —
isEnvTemplatePath的 mock 两支 (mock-<name>.<ext>/<name>.mock.<ext>)只认js|mjs|ts,而.env.<ext>分支认js|mjs|ts|cjs|cts|mts⇒ 族内两支各写各的扩展名表 ⇒mock-foo.cjs/fs.mock.cts/x.mock.mts这类 env 模板不进 watch 门禁 ⇒ 模板改动 不触发依赖源文件复分析。改为三支同表(js / mjs / ts / cjs / cts / mts); mock 前缀支同时锚到 basename 起点(相对路径形态mock-foo.js同样成立)。 非模板路径判定逐字不变。Bug(族 54 / item 2:hover 的 throws 段在两种状态下仍缺) — hover 只读 case 台账的 throws 证据(
AnalysisResult.functions[].cases[].throwsAbs), 而函数级 throws 域(check 签名行口径 = 入口求值的 hard throw ∪ soft may-throw)的唯一载体是entry@见证 ⇒ 两种状态下证据随见证一起消失 ⇒ IDE 的 throws 段与nudo check的签名尾缀分叉:- 有调用点见证:
settleEntryOnlyCandidates把entry@见证连同 throws 证据一起撤掉、改由call@见证承担调用点域 ⇒ 证据无处安放; - 模块级调用点路径:该路径从不产
entry@见证(调用点域直接接管) ⇒ 同样无处安放; - 选中 case(LSP selectCase):被选函数不生成
entry@见证(域由 选中的那条 case 声明)⇒ 同样无处安放。
改为:入口域的 throws 证据并进该函数已有的见证(并集;见证数不变、 推断域不变 ⇒ 产物面 / 固化面 / 报告台账的形状都不动)。补证据时只跑只取 证据的入口求值(不产见证 / 不改域 / 不报诊断 / 不并入调用点台账),且只对 导出函数补(入口面口径 = 导出函数,与 hover / check 同源)。
nudo test的 "all" 模式不在补证据范围内 ⇒ 报告面不变。未收口(第 3 条,跨包) — 台账里的「
migrate verify库面整批 abort」 实测已不成立:migrateVerify(packages/nudojs/src/migrate.ts)早已逐 文件隔离(同目标内部分文件语法错 ⇒ 失败文件记analysis-error、成功文件照常 返回)。仍整批 abort 的是同族的migrateStrip(696 的库面半边:planStrip→makeStripPlan遇解析错即 throw ⇒ 同目标内其它文件的成功结果 全丢)—— 该文件在 nudojs 包(另一分片的范围),本片未改。 - 有调用点见证:
-
8542f44: fix(service): 契约申报的 bigint 字面量在 zod 面不再被静默放宽(族 37 · Bug 1046)
病灶:契约里申报 bigint 字面量(如侧车
fn({}, lit(10n)))时,zod 面的产物 写的是z.unknown()—— 比门禁宽(门禁按lit(10n)判红、zod 放行10/42/"x"/null)⇒ 假绿;而且零台账(产物里没有任何痕迹)。零台账的根因是两层都失声:契约路径的 Abs 把字面量放在 pred 里 (
eq(self, lit(10n)))⇒ 节点层(absToSchemaNode)认为「投影成功」(节点 ={k:"lit", value:10n})⇒ 不进dropped;而 zod 渲染臂case "lit"没有 bigint 分支 ⇒ 落到兜底z.unknown()⇒ 与 standard 面({"k":"lit","value":10n}保真) 的接受集自相矛盾。修法(
packages/service/src/emit/schema-generator.ts):- zod 方言的
lit臂补 bigint 分支 ⇒z.literal(10n)。zod 的z.literal原生支持 bigint(zod v3/v4 皆可;真 zod v4.6.7 实测safeParse(10n)=true、safeParse(10|42|"x"|null|undefined)=false)⇒ zod 面的接受集现在等于 standard 面 ⇒ 跨面自相矛盾消失。 - 方言保真升为渲染层的局部不变量:zod 渲染器改为同时返回源码 + 自己
的降级台账,凡是把可表达的形态降级成
z.unknown()(类型外的字面量值、没有 运行期构造器的 brand)必须留痕 ⇒ 台账并进既有dropped通道 ⇒ 出现在 产物的// dropped preds (not projected into zod):块里(用户可见)。 「静默放宽」从此在渲染层不再可能发生(改前 bigint 契约字面量就是靠这条路漏出去的)。
已知偏差(core 层,族外,未修):guard 面渲染
(typeof data === "number") && (data === 10n)⇒guard(10n) === false(假红:拒收契约申报的唯一合法值)。根因在 core:litC(bigint)不给 prim (PrimName有"bigint"但litC不用)⇒constraintOnTermAbs落到 「有界但无 prim ⇒ 按 number 处理」的兜底 ⇒ Abs 的 shape 说 number、pred 说 bigint。 core 不在本族范围 ⇒ 以it.fails旗标钉住(core 修好后旗标会翻红,提醒摘掉)。 - zod 方言的
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [7fea13a]
-
Updated dependencies [a1c093f]
-
Updated dependencies [9f26414]
-
Updated dependencies [67abd92]
-
Updated dependencies [3d66f5a]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [1b08a18]
-
Updated dependencies [b4768ca]
-
Updated dependencies [5fd3cbb]
-
Updated dependencies [5fb8a51]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [dde4b03]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
- @nudojs/core@1.16.0
- @nudojs/env@0.5.3
- @nudojs/parser@1.5.3
- @nudojs/harvester@0.4.3
1.9.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
- @nudojs/env@0.5.2
- @nudojs/harvester@0.4.2
- @nudojs/parser@1.5.2
1.9.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
- @nudojs/env@0.5.1
- @nudojs/harvester@0.4.1
- @nudojs/parser@1.5.1
1.9.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- aae0f96: Fix stale-cache windows in cache keys and session eviction.
nodeHarvestCacheKeyflooredmtimeMsto whole seconds (same-second, same-size rewrites of@types/nodereused a stale harvest — now uses the raw float mtime, matching the repo-widemtimeMs+sizestrict-equality contract). The path-env cache key/validation only comparedmtimeMs(coarse-mtime filesystems could keep serving a staledefineEnvfactory and re-register it, self-perpetuating — nowmtimeMs+size, and the direct-import URL query carriessizeso the ESM module cache can't replay old content). The path-env fallback copy filename hashed onlypath:mtime— rewritten content now hashes into the filename so a changed file gets a new URL and the ESM cache invalidates naturally. Harvest caches (harvestCache, node not-found cache) had no production eviction —clearAnalysisSessionCaches()now clears both, sopnpm install/ watcher rounds see upgraded or newly installed@typeswithout a process restart.checkMemoKeynow normalizesfilePathviastablePathKey(same file no longer occupies two entries under different path shapes). - 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every
existsSync(p) && statSync(p)double call (TOCTOU race + errno swallowing) with a singlestatSync(p, { throwIfNoEntry: false })per the repo's load-module convention: ENOENT stays a silent miss, EACCES/EIO surface via the site's error channel (top-level catch,reports.push({error}), exit-1 message, or a logged warning) instead of masquerading as "file absent". Read-failure catches now branch one.code: sidecar contracts unreadable for reasons other than ENOENT print awarning: cannot read sidecar contract …incheck/check --fix(no more silent contract-blind green runs);@nudo:mockseed evaluation failures warn inexportbefore degrading;pnpm-workspace.yamlread failures other than ENOENT abortmigrate(a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read reportread-failedwith the errno instead of the misleading "Mock file not found"; npm entry probes and LSP module-candidate stats log persistent failures instead of degrading a package's export face to unknown or silently breaking go-to-definition;contract --from-dtspath-like arguments that don't exist now error aspath not foundinstead of being treated as npm package names ending in a misleadingno .d.ts files found. - Updated dependencies [aae0f96]
- Updated dependencies [52de5ca]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
- @nudojs/harvester@0.4.0
- @nudojs/parser@1.5.0
- @nudojs/env@0.5.0
1.8.0
Minor Changes
-
c19bd48: Misplaced file-level directives now warn instead of being silently ignored, and
nudo.analysis.excludesupports real globs (fix-12 batch).- parser: file-level directives (
@nudo:env/@nudo:mock-module) written inside JSDoc blocks emitnudo:directive-syntaxwith the correct///form instead of being dropped silently. - service:
nudo.analysis.excludeaccepts glob patterns (sharedcompilePattern, extracted from vite-plugin as the single source; plain substrings still work, defaults always stack). - vite-plugin: pattern matching cut over to the shared
compilePattern— behavior unchanged, one implementation.
- parser: file-level directives (
Patch Changes
- Updated dependencies [c19bd48]
- Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
- @nudojs/parser@1.4.24
- @nudojs/env@0.4.42
- @nudojs/harvester@0.3.28
1.7.0
Minor Changes
-
0d9e7de:
@nudo:skipno longer kills@nudo:caseevaluation (#176) — the declared face and runtime ground truth are no longer a trade-off.- A skipped function keeps
combinedAbsfrom its declared return face (dts/sidecar/draft consumers unchanged), while declared@nudo:casedirectives are evaluated and asserted as usual;nudo testprints the skip note and the case assertions in the same block (previously the cases vanished entirely: "no declared @nudo:case expectations") nudo checkbehavior is byte-identical (caseMode none — no case evaluation, no synthesized entry@ for skipped functions)
- A skipped function keeps
Patch Changes
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
- @nudojs/env@0.4.41
- @nudojs/harvester@0.3.27
- @nudojs/parser@1.4.23
1.6.25
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
- @nudojs/env@0.4.40
- @nudojs/harvester@0.3.26
- @nudojs/parser@1.4.22
1.6.24
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
- @nudojs/env@0.4.39
- @nudojs/harvester@0.3.25
- @nudojs/parser@1.4.21
1.6.23
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
- @nudojs/env@0.4.38
- @nudojs/harvester@0.3.24
- @nudojs/parser@1.4.20
1.6.22
Patch Changes
-
82eaae8: Fix
nudo:recursion-truncatedmisattributing call-cycle truncation to "depth/size budget", and makenudo check --jsonbudget stats see the B-path ($callNamed) truncation (issue #158):enterCall/evalEnterCallnow attribute a truncation reason —cycle(same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers orgrow-style recursion) vsdepth/calls(real budget exhaustion). The check diagnostic message, suggestion, structured action, and a newreasonfield on the issue (cycle|depth|calls|budget) split accordingly: cycle says "budget cannot lift this" and never points at@nudo:budget; depth/calls name the exact raisable dimension (@nudo:budget depth=…/calls=…).- The
check --json/ health budget block no longer reportstruncated:falsealongside anudo:recursion-truncatedinfo: B-path counters are latched across execution sessions within one host entry and surfaced asevalCalls/maxEvalCalls/evalCallTruncated, pluscycleTruncatedand a sortedreasons[]set (single-file and multi-file envelopes, and the disk-cache round trip). Fork counters/truncation flags are latched per host entry too (the last-session snapshot could previously erase an already-reportednudo:fork-truncated). - The
@nudo:budgetquickfix (nudo check --fix/ LSP code action) is no longer offered when the truncation reason iscycle; thereasonis plumbed throughcheck --json, the disk cache, LSP diagnostic data, andmaterializeAction. - Raising
@nudo:budgeton a same-args recursion could never lift the truncation — the old message misled real budget investigations into "directive ignored" hypotheses. - Loop-iteration truncation (
#loop-iterations) no longer masquerades as recursion: it now emits its ownnudo:loop-truncatedinfo with an honest message and suggestion (the call-budget knobs cannot lift a loop budget —@nudo:budget calls=/depth=does not apply), gets aloopTruncatedflag in thecheck --json/ health budget block (single-file and multi-file envelopes), and no longer offers the misleading@nudo:budgetquickfix it used to inherit from the recursion branch.
-
Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
- @nudojs/env@0.4.37
- @nudojs/harvester@0.3.23
- @nudojs/parser@1.4.19
1.6.21
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
- @nudojs/env@0.4.36
- @nudojs/harvester@0.3.22
- @nudojs/parser@1.4.18
1.6.20
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
- @nudojs/env@0.4.35
- @nudojs/harvester@0.3.21
- @nudojs/parser@1.4.17
1.6.19
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
- @nudojs/env@0.4.34
- @nudojs/harvester@0.3.20
- @nudojs/parser@1.4.16
1.6.18
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
- @nudojs/env@0.4.33
- @nudojs/harvester@0.3.19
- @nudojs/parser@1.4.15
1.6.17
Patch Changes
-
fa52735: 参数契约 inlay hints(形参后
where …)默认关闭:显式契约(递归 AST 节点联合等)行内展开可达数万字符。新增nudo.inlayHints.parameters(boolean,默认false)三级配置——项目package.json#nudo.inlayHints.parameters显式值赢,宿主设置(VS Codenudo.inlayHints.parameters/ Zedlanguage-servers.nudo.initialization_options.inlayHints.parameters)只在项目未设置时作默认;workspace/didChangeConfiguration实时生效并触发inlayHint/refresh。返回类型 inlay(: …)、case hints 与 interface 档 inlay 不受影响;hover 仍展示完整契约。 -
35ce944: Fix recursive-fn local hover poisoning and arity-only fn hover display
$nodoPosposition records and call/assign records now carry the caller-frame depth; hover replay surfaces (absNodeAtPosition,collectEnclosingFnLocals) only read outermost-frame records. Recursive functions on self-referential contracts (lazy(() => astNode)) no longer bind cycle-truncatedopaque unknowninto local-variable hovers (objnow shows the computednull | string | undefined).const x = <non-call init>declarations record the bound Abs at the declarator-id position during hover replay (recordPositionsonly) — ternary/optional-chain/literal-initialized locals are hoverable (prop,q).callTranspiledExportFullInnerrefines the called fn AbsreturnTypeslot after a successful call (same policy as class method slots, display-only).- LSP hover: an arity-only fn Abs (empty
returnTypeslot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature(node: nullable(astNode)) => null | string | undefinedinstead of(arg0) => ?.
-
5e275df: fix: review hardening — Map.groupBy empty-reduce crash, Bug 1 early-exit relational narrowing, fs-error graph-edge degradation, agent tool module graph, brand presence for URLSearchParams/TextDecoder/Intl, generator side-table $copy migration
Map.groupBy/Object.groupBy: shadow-domain join no longer bare-reduces an empty unkeyed list (raw hostTypeError: Reduce of empty array with no initial valueescaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades tounknown.- Early-exit lift path (if-return followed by non-tail statements) now applies the same relational-arm narrowing as the regular IfStatement path (
narrowRelArmThunk), fixing false positives likeif (x >= 0) return x; console.log(x); return 1;under@nudo:contract return nonNeg. extractImportEdgesskips import edges whose target resolution throwsModuleReadError(EACCES/ESTALE, #135) instead of crashing module-graph construction (CLI watch start, incremental rebuild false-green rounds, LSP validation).new Function(...)/new Function("a", "b", ...)validate every argument for the L2 may-throw gate, not just the first.- Brand presence tables: URLSearchParams (methods +
size), TextDecoder (decode+ accessors), Intl.NumberFormat/DateTimeFormat (format/formatRange/parts/resolvedOptions); URLSearchParams joins ITERABLE_BRANDS (@@iterator → function). $copysnapshots migrate generator/match side tables (genDeferred throws, genIter/matchAll elements), so fork/switch-arm rebinding no longer silently drops deferred generator throws.- LSP agent tools (check/hover) build the module graph like the CLI and LSP validation do, fixing cross-module unknown collapse (E5 parity).
-
Updated dependencies [334b914]
-
Updated dependencies [94197eb]
-
Updated dependencies [b8db17b]
-
Updated dependencies [5e275df]
- @nudojs/core@1.10.0
- @nudojs/env@0.4.32
- @nudojs/harvester@0.3.18
- @nudojs/parser@1.4.14
1.6.16
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
- @nudojs/env@0.4.31
- @nudojs/harvester@0.3.17
- @nudojs/parser@1.4.13
1.6.15
Patch Changes
-
b6495c6: fix(service): check 结果对瞬时/持久 fs 故障确定性化(#135 少集模式)
resolveModuleFile改单次 statSync(消灭 existsSync+statSync TOCTOU 双调用):ENOENT/ENOTDIR/EISDIR 按候选 miss;其余 errno(EACCES/EIO/ESTALE/EMFILE…)抛 ModuleReadError,不再被 existsSync 吞成「无此文件」。- 持久 fs 故障:侧车 ambient 绑定显式报 error 级
nudo:interface-load(带路径+errno)且 check exit 1——修复前同一故障静默丢整族契约诊断(constraint-violated/unproven-return 整体消失、无任何诊断、exit 0 假绿,且跨版本逐字节相同)。 - 瞬态故障自愈:checkSource per-call loadModule 缓存对「抛错」不缓存、下一探测重试——单次 stat 抖动不再钉死整场 miss。
LoadDepsFingerprint.readError(readerr:前缀,trunc:优先):读错误轮指纹键不可信,check 整文件 memo / generalize L0 / evaluator memo / analysisFileCacheKey / LSP 校验指纹一律 fail-closed 不读不写,杜绝错误轮与 miss 轮互为跨次陈旧命中。findProjectConfigstat 错误分类:非 ENOENT 的 package.json stat 故障 stderr 告警 + 子树 fail-closed(不静默继承/丢失 profile、env 名单),修复 severity 漂移(adoption 丢失导致 entry-may-throw error↔warning 摆动)。
-
Updated dependencies [b6495c6]
-
Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
- @nudojs/env@0.4.30
- @nudojs/harvester@0.3.16
- @nudojs/parser@1.4.12
1.6.14
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
- @nudojs/env@0.4.29
- @nudojs/harvester@0.3.15
- @nudojs/parser@1.4.11
1.6.13
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
- @nudojs/env@0.4.28
- @nudojs/harvester@0.3.14
- @nudojs/parser@1.4.10
1.6.12
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
- @nudojs/env@0.4.27
- @nudojs/harvester@0.3.13
- @nudojs/parser@1.4.9
1.6.11
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
- @nudojs/env@0.4.26
- @nudojs/harvester@0.3.12
- @nudojs/parser@1.4.8
1.6.10
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
- @nudojs/env@0.4.25
- @nudojs/harvester@0.3.11
- @nudojs/parser@1.4.7
1.6.9
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
- @nudojs/env@0.4.24
- @nudojs/harvester@0.3.10
- @nudojs/parser@1.4.6
1.6.8
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
- @nudojs/env@0.4.23
- @nudojs/harvester@0.3.9
- @nudojs/parser@1.4.5
1.6.7
Patch Changes
- Updated dependencies [d6fa067]
- Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
- @nudojs/env@0.4.22
- @nudojs/harvester@0.3.8
- @nudojs/parser@1.4.4
1.6.6
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
- @nudojs/env@0.4.21
- @nudojs/harvester@0.3.7
- @nudojs/parser@1.4.3
1.6.5
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
- @nudojs/env@0.4.20
- @nudojs/harvester@0.3.6
- @nudojs/parser@1.4.2
1.6.4
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
- @nudojs/env@0.4.19
- @nudojs/harvester@0.3.5
- @nudojs/parser@1.4.1
1.6.3
Patch Changes
- 50e50f1: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) - 50e50f1: fix(service): evaluator run 缓存键补齐维度与宿主 loader 透传。
tryRunEval缓存条目加入lenientGlobals/maxLoopIters命中维度,并按「入口文件 × mode」分槽——同 source 不同 lenient/迭代预算不再互命中陈旧结果,collectCallRecords的 exec 采集不再踢掉同文件的 analyze 条目(evictEvalCacheForFiles一并清两种 mode 槽)。宿主loadModule(LSP 虚拟 FS / 侧车)现透传到模块图组装与 depKey:analyzer 一次分析内求值不再回落defaultLoadModule,tryEvalCall/tryEvalCallFull同口径接受 loader 与宿主预计算depKey(复用 analyzer 一次 BFS,避免 per-fn 线性放大)。模块图组装序列(evalAbsModuleGraph → collectEnvModules → mergeHarvestUnderEnv → applyMockModule*)收敛为composeEvalModules单一入口(analyzer 与 evaluator 共用,消除一次分析内的重复 parse/eval 与两处漂移)。删除恒真死代码isEvalCapable(公共导出一并移除;能力判定由转译点 fail-closed 承担)与 analyzer 中永不填充的unreachableRanges/不可达 else 分支;setEvalCallCollector恢复改为显式undefined判定;defaultAbsLoadModule/resolveRel候选遍历收敛为单一readFirstRel。 - Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
- @nudojs/parser@1.4.0
- @nudojs/env@0.4.18
- @nudojs/harvester@0.3.4
1.6.2
Patch Changes
- a00bccc: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) - 446914f: fix(service): evaluator run 缓存键补齐维度与宿主 loader 透传。
tryRunEval缓存条目加入lenientGlobals/maxLoopIters命中维度,并按「入口文件 × mode」分槽——同 source 不同 lenient/迭代预算不再互命中陈旧结果,collectCallRecords的 exec 采集不再踢掉同文件的 analyze 条目(evictEvalCacheForFiles一并清两种 mode 槽)。宿主loadModule(LSP 虚拟 FS / 侧车)现透传到模块图组装与 depKey:analyzer 一次分析内求值不再回落defaultLoadModule,tryEvalCall/tryEvalCallFull同口径接受 loader 与宿主预计算depKey(复用 analyzer 一次 BFS,避免 per-fn 线性放大)。模块图组装序列(evalAbsModuleGraph → collectEnvModules → mergeHarvestUnderEnv → applyMockModule*)收敛为composeEvalModules单一入口(analyzer 与 evaluator 共用,消除一次分析内的重复 parse/eval 与两处漂移)。删除恒真死代码isEvalCapable(公共导出一并移除;能力判定由转译点 fail-closed 承担)与 analyzer 中永不填充的unreachableRanges/不可达 else 分支;setEvalCallCollector恢复改为显式undefined判定;defaultAbsLoadModule/resolveRel候选遍历收敛为单一readFirstRel。 - 89358f2: fix(service):
absModuleCache命中校验不再对宿主 custom loader 磁盘盲。loader 接管的依赖模块(磁盘存在 + loader 覆写内容,LSP 未保存 buffer 的典型形态)自身命中条件从「stat mtime+size 严格相等」改为「loader 当前内容 hash == 插入时实际求值源码 hash」——buffer 内容 A→B 而磁盘未动时不再陈旧返回 A 的旧导出;loader 不接手该路径(undefined)回落 stat,loader 抛错按 miss 重装载(宁冷勿陈旧);默认 loader(未传opts.loadModule)行为零变更,stat 快路径保留。命中校验取过的 loader 内容在 miss 重装载时复用(同参不二次调用)。当时记录的传递依赖残余(子树指纹仍按磁盘复核)由紧随的 loader 感知子树指纹修复 changeset 补齐。 - 89358f2: fix(service):
absModuleCache子树内容指纹不再对宿主 custom loader 磁盘盲——补齐 loader-aware 命中修复(上一条 changeset)记录的传递依赖残余。依赖指纹条目从只存path扩展为携带装载询问证据via = { spec, fromFile }(无条件记录:该对恒已知,条目不存 loader 引用):带 loader 复核时按原询问对重问当前 loader 比对内容 hash——loader 覆写传递依赖(LSP 未保存 buffer)的两个方向都不再陈旧:编辑方向(buffer A→B 磁盘未动)与接管方向(首轮磁盘装载、loader 新近接手);loader 不接手(undefined)回落磁盘内容比对(该依赖此刻本就从磁盘装载),loader 抛错 / 依赖被删按 miss 重装载(宁冷勿陈旧);loader 虚拟内容与磁盘不一致但稳定时,子树从「永久 miss」转为正常命中(复核按 loader 当前内容)。默认 loader(未传opts.loadModule)行为与性能零变更:无 loader 时子树复核纯磁盘读取,stat 快路径保留(既有计数护栏钉住)。公共类型AbsModuleDepFingerprint新增可选字段via(向后兼容,不构成 minor)。 - 89358f2: fix(service):
absModuleCache自身命中的 loader 弃管方向不再陈旧——custom loader 曾覆写某路径(LSP 未保存 buffer)、随后不再接管该路径(buffer 未保存即关闭回退磁盘)时,回落分支此前只比磁盘mtimeMs+size,条目里的 buffer 版导出会在磁盘 stat 未动时被陈旧命中。现在opts.loadModule在场且 loader 不接手的路径在 stat 相等后再补「磁盘内容 hash == 插入时求值源码 hash」复核(读出的磁盘内容进 preloaded,miss 重装载复用不二次读盘);默认 loader(未传opts.loadModule)保持纯 stat 快路径零退化。回归:buffer 覆写 v=2 → loader 弃管 → 必回磁盘真值 v=1(修复前红:陈旧返回 2)。 - 446914f: fix(service):
findProjectConfig增加目录链 memo——条目记录向上查找访问过的每个 package.json 的 mtimeMs+size(无文件记 absent),命中只做链上 stat 比对,不再每次 existsSync + readFileSync + JSON.parse(LSP 每次 getCachedOrAnalyze / validateText 都会调它)。链上任何 package.json 新建/改写/删除(含 absent↔存在翻转)自动 miss 重算;clearAnalysisSessionCaches显式清空(evictProjectConfigMemo,项目配置 watch 通道),覆盖「同 size + 同 mtime」极端写入。新增诊断导出projectConfigMemoStats(条目数 / 实际读盘次数)。 - Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [a00bccc]
- Updated dependencies [39332ca]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- @nudojs/core@1.7.2
- @nudojs/parser@2.0.0
- @nudojs/env@0.4.17
- @nudojs/harvester@0.3.3
1.6.1
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
- @nudojs/env@0.4.16
- @nudojs/harvester@0.3.2
- @nudojs/parser@1.3.2
1.6.0
Minor Changes
-
f6ec0e8: fix #76 (quickfix self-defeating
any()+ false-positive call-site errors):- service/body-read-types: collect full member-read paths (
node.loc.start.line), not just first-level keys. Dereferenced intermediate fields materialize as nested shapes (loc: shape({ start: shape({ line: any() }) })) instead ofany()— anany()slot value keeps its member reads counted as may-throw, so the generated contract could not clear the L2 it targeted (issue: 1/7 warnings cleared; now the nested-read cases clear too). Method accesses (.toLowerCase()) still type the field directly and stop the chain.BodyReadFieldgains optionalfields?: BodyReadField[];shapeDslFromFieldsrecurses. - core/scan:
anyactuals against a shape precondition are no longernudo:constraint-violatederrors — no info, don't guess, matching the scalar-pred channel ("any ≤ 任意目标") and the same function'sunknownhandling. Determined non-object and missing-field actuals still violate (controls pinned).
- service/body-read-types: collect full member-read paths (
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
- @nudojs/env@0.4.15
- @nudojs/harvester@0.3.1
- @nudojs/parser@1.3.1
1.5.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
- @nudojs/parser@1.3.0
- @nudojs/harvester@0.3.0
- @nudojs/env@0.4.14
1.4.0
Minor Changes
-
64ca356: feat: clamp bounds + scalar-over-sum + action-map quickfixes (#68 #69)
#68 inference
Math.min/Math.max/Math.round(and floor/ceil/trunc) propagate operand numeric bounds:max(0, min(100, n))derives[0, 100].- NaN is explicit (option 1): a possibly-NaN operand yields
NaN | number@bounds, so clamp contracts stay honest;if (Number.isNaN(n)) return …narrows the false arm (ne(n, NaN)) and the guarded clamp is provable. - Scalar return contracts now distribute over sum arms like shape/array
(
nullable(c)+ multi-returnnull | numberis provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings tounproven-returnwarnings instead of errors.
#69 DX
actionsForIssuekinds are materialized as LSP quickfixes with[fix]/[silence]/[review]/[adjust]/[scaffold]titles.nudo check --fix [--only <code>] [--write]reuses the same edit layer (default dry-run prints unified diffs).- Body-read fields auto-fill types from usage (
node.type === "x"→string(), arith →number(), no evidence →any()); never emit emptyshape({}). - L2
entry-may-throwsuggestions include a copyable sidecar clause.
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
- @nudojs/env@0.4.13
- @nudojs/harvester@0.2.19
- @nudojs/parser@1.2.1
1.3.0
Minor Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
Patch Changes
- Updated dependencies [f10066d]
- @nudojs/core@1.4.0
- @nudojs/parser@1.2.0
- @nudojs/env@0.4.12
- @nudojs/harvester@0.2.18
1.2.4
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
- @nudojs/env@0.4.11
- @nudojs/harvester@0.2.17
- @nudojs/parser@1.1.9
1.2.3
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
- @nudojs/env@0.4.10
- @nudojs/harvester@0.2.16
- @nudojs/parser@1.1.8
1.2.2
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
- @nudojs/env@0.4.9
- @nudojs/harvester@0.2.15
- @nudojs/parser@1.1.7
1.2.1
Patch Changes
- Updated dependencies [5494f67]
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/env@0.4.8
- @nudojs/core@1.2.1
- @nudojs/harvester@0.2.14
- @nudojs/parser@1.1.6
1.2.0
Minor Changes
-
5ff4202: refactor!: rename B-path / BPath engine identifiers to eval / evaluator
The AST-walk interpreter is long gone, so the dual-engine campaign name "B-path" no longer means anything and forced a glossary entry just to explain itself. The single production evaluation engine is now simply the evaluator (mechanism: transpile →
new Functionon Abs).Renamed B-path engine to evaluator/eval — see the @nudojs/core table above.
Patch Changes
-
5ff4202: fix(core): more JS semantics soundness — Array.of / .at() / postfix ++-- / ToPrimitive
Array.ofpacks arguments into a tuple, not an array of the first element.at()honors ToIntegerOrInfinity (string.at + array.at index)- postfix
++/--writes back inside the expression +honors ToPrimitive/ToString for arrays, objects, undefined- drop dead duplicate
case "promise"in checkNode
-
Updated dependencies [5ff4202]
-
Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
- @nudojs/env@0.4.7
- @nudojs/harvester@0.2.13
- @nudojs/parser@1.1.5
1.1.4
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
- @nudojs/env@0.4.6
- @nudojs/harvester@0.2.12
- @nudojs/parser@1.1.4
1.1.3
Patch Changes
-
43fb345: fix(service): honor
package.json#nudo.check.profileincheckConfig(LSP parity)The CLI resolves
nudo.check.profile(adoption→ L2warning,strict→error) but the servicecheckConfig— which the LSP uses fornudo-checkdiagnostics — only readnudo.check.entryThrows. In a project with"nudo": { "check": { "profile": "adoption" } },nudo checkprintednudo:entry-may-throwas a warning while the IDE showed it as an error.checkConfignow applies the same preset, with the same precedence as the CLI (entryThrows→profile→ defaulterror), andNudoConfig["check"]gains theprofilefield. -
Updated dependencies [3bf9997]
- @nudojs/core@1.1.3
- @nudojs/parser@1.1.3
- @nudojs/env@0.4.5
- @nudojs/harvester@0.2.11
1.1.2
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
- @nudojs/env@0.4.4
- @nudojs/harvester@0.2.10
- @nudojs/parser@1.1.2
1.1.1
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
- @nudojs/env@0.4.3
- @nudojs/harvester@0.2.9
- @nudojs/parser@1.1.1
5.0.0-beta.1
Major Changes
-
4305674: Split the
@nudojs/servicegod package: harvest →@nudojs/harvester, IDE surface →@nudojs/lsp, emit products consolidated under@nudojs/service/emit.BREAKING for
@nudojs/servicesubpath consumers:Removed subpath Migrate to @nudojs/service/interface@nudojs/service/emit@nudojs/service/dts@nudojs/service/emit@nudojs/service/case@nudojs/service/emit@nudojs/service/lsp@nudojs/lsp(library entry — no server side effects)@nudojs/service/harvest@nudojs/harvester@nudojs/servicekeeps.,./analysis,./evaluator,./emit. The language server moves to@nudojs/lsp/server(binnudo-lspunchanged);@nudojs/lspis now a side-effect-free library entry re-exporting the IDE surface.No dependency cycles:
lsp → service,harvesterstays independent ofservice. Emit is a service subpath (same package). Public function signatures and diagnostic codes are unchanged.
Patch Changes
- Updated dependencies [4305674]
- @nudojs/harvester@1.0.0-beta.1
5.0.0-beta.0
Major Changes
-
22baf33: feat!: product CLI face only — remove deprecated verbs/aliases; L2 entry may-throw
- BREAKING — deleted with no compatibility layer: verbs
infer/types/interface/refine/generate/emit/guard/doctor/ top-levelwatch/harvest; flags--callsites,--output,--format zod,--dts,--emit-cases; APIabsToZodSchema;InferJson/serializeInferJson→CaseJson/serializeCaseJson; LSP agent toolsnudo.infer/nudo.interface*and aliases →nudo.test/nudo.contract*; config keypackage.json#nudo.interface.*→package.json#nudo.contract.*. Root scriptsinfer/types/interfaceremoved. - Primary verbs:
check/test/contract/export/health/env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell@nudojs/nudojsfollows@nudojs/climajors. - L2: undigested may-throw on entry/export functions is
nudo:entry-may-throw(default error). Configure with--ignore-throws/--entry-throwsorpackage.json#nudo.check.{ignoreThrows,entryThrows}. - Nested try: soft may-throw from an inner try re-homes to the enclosing try frame. Catch rethrow does not digest soft effects.
checkalways prints signatures on success; unconstrained entry params display asany(trueunknown= inference failure +nudo:unknown-inference).testprints every case including syntheticcall@/entry@; only declared@nudo:caseexpectations affect exit.--freeze[=update]solidifies witnesses.- Flags:
--from,export --format dts|guard|schema|standard|all(--dialect zodfor schema),export --out.--jsoncannot combine with--abs. - Design docs consolidated: truth sources
design-kernel-merge.md+design-cli-semantics.md; domain designs compressed to status summaries. - Breaking for CI scripts that still call old verbs or read old config keys.
- BREAKING — deleted with no compatibility layer: verbs
-
0e1432a: feat!: source contract directive is
@nudo:contractonly@nudo:refineand@nudo:interfaceare deleted with no alias layer. The product word is contract end to end (sidecar*.nudo.js,@nudo:contract,nudo contract,package.json#nudo.contract.*).- BREAKING: replace every
@nudo:refine/@nudo:interfacewith@nudo:contract(including@nudo:contract return <constraint>). Grammar is unchanged:@nudo:contract <param> <constraint>. - Constraints still enter Abs as Preds and participate in algebra (
x>0⇒x+1>1) — this is not a call-site validation gate. - Diagnostic codes
nudo:interface-*are unchanged in this release. - Chinese product copy uses 契约, not 精化.
- BREAKING: replace every
Minor Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
-
279d73a: fix review gaps on the B-path migration (PR #34 follow-up):
- inject pipeline:
CheckOptions.injectis now threaded into generalize, L2 throws, the record channel, and drift recompute (previously CLI computed mocks/env/replacements but onlymodulesreached core;@nudo:mock/env/replacesources were fail-closedunknown#opaqueundercheckSource). Memo keys use inject content fingerprint (stable across CLI's per-call object allocation).mode: "analyze"always wins;modulesprefersopts.modulestheninject.modules. - L2 class / CJS methods: explicit
throwon class static methods and CJS object methods is no longer hard-coded asthrows: never— NudoThrow/ReferenceError map to throws Abs (same ascallTranspiledExportFull).$callrecords throw exits before returningnever. L2 evaluation now seedsphifromcheckSource. freeIdentifiers: lexical scopes (nested params no longer pollute outer free set); non-computedObjectMethod/ClassMethodkeys are not free refs.callBudgetKey: single defensive implementation for non-Abs args (B-run JS function args).$callcompiled-body path now usesenterCall/exitCall(same budget as apply). Budget keys use fn object identity (stableCallId) instead ofanon#N(false cycles across same-arity functions).MAX_TOTAL_CALLSunified at 20k.- method early-return (correctness):
ObjectMethod/ClassMethod/ propertyFunctionExpressionbodies now go throughtranspileFnBodyStmts(early-return lift) + implicit return — previouslyif (c) return X; return Ysilently always returnedY(false precision vs native). - collectors:
setBCallCollector/setBAssignCollector/setMemberDiagCollector/setAbsTruncationCollectorreturn the previous collector; nested call sites save/restore instead of nulling.
User-visible notes:
- Sources with
@nudo:mock/@nudo:env/@nudo:replaceget real B evaluation undernudo check(CLI already built the inject pack). - Class static / CJS object methods with explicit throws now report
entry-may-throw(L2 no longer misses them). - Object/class methods with early-return branches now fold the same values as native JS (differential batch19).
interface-derivationclass-method roots stay fail-closed (no call-chain derivation) — intentional after ast-eval removal.
- inject pipeline:
-
5a5e167: feat(export)+review P0–P2: dialect-aware schema export, Standard Schema path, CLI/LSP honesty fixes.
Service / schema:
absToSchemaSource/projectAbsToSchema/absToSchemaNode— SchemaNode carries refinements anddroppednotes.- Projection prefers core
absToConstraint(parity foreq(self,lit)→z.literal, or-literal unions, int/bounds/string length). - Schema projection API:
absToSchemaSource/projectAbsToSchema(zod via{ dialect: "zod" }). - New
absToStandardSchemaModule/validateSchemaNode— Standard Schema v1 modules (~standard, vendornudo).
CLI:
nudo export --format schema [--dialect zod]→*.nudo.schema.<dialect>.tsnudo export --format standard→<fn>.nudo.standard.ts(contract-first domains; joinAbs when no contract)test --jsonstdout is one JSON document (cases only);check --jsonstays a separate command--ignore-throwsnow merges withpackage.json#nudo.check.ignoreThrows(additive)
LSP:
- Gate codes (
nudo:entry-may-throwetc.) keep Error and Warning underanalysis.diagnostics=off|errorsso IDE matches CLI whenentryThrows=warning
Docs/product copy:
- Day1 sidecar example uses
fn({ params }, returns?)(not barenumber().gt(0)on a function export) - Help / generated markers use
schema/standardandnudo contract --emit
Patch Changes
- Updated dependencies [22baf33]
- Updated dependencies [0e1432a]
- Updated dependencies [3c3f9d2]
- Updated dependencies
- Updated dependencies [279d73a]
- @nudojs/core@3.0.0-beta.0
- @nudojs/parser@1.1.0-beta.0
- @nudojs/env@0.4.2-beta.0
- @nudojs/harvester@0.2.8-beta.0
4.0.0
Major Changes
-
69ebbf6: Align product surface with interface-first design:
@nudo:caseis debug /nudo testonly, and theT.*directive grammar is removed.- Directive type expressions accept constraint builders (
number(),lit(),shape(),union(),array(),any(), …) and concrete literals only. BareT.*parses as unknown;parseTypeValueExpris no longer exported — useparseCaseArgExpr. serializeCaseArg/--emit-casesemit builders (number(),union(…)) instead ofT.*.- LSP
typeExprToDirectiveemits builders (number(),union(…),any()). - CLI
inferreports call-site facts (call@L…) anddebug "name"witnesses withObserved:joins — notCase "…"/Combined:as the type product. Contracts stay on*.nudo.js/@nudo:refine. - Constraint builders accept concrete nested literals so directive grammar round-trips.
- Directive type expressions accept constraint builders (
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/parser@1.0.0
- @nudojs/core@2.1.0
- @nudojs/env@0.4.1
- @nudojs/harvester@0.2.7
3.0.0
Major Changes
-
9731238: BREAKING (behavior)
@nudojs/service: handwritten@nudojs/envnow wins over harvest / module-graph modules on overlapping module keys and export names (mergeHarvestUnderEnv). This is the documented B8 priority — harvest only fills missing slots — but analysis results on projects that relied on harvest overwriting a handwritten env export will change.Migration: remove or update the conflicting handwritten
@nudojs/envslot if you needed harvest's version; otherwise no code change. Conflicts emit anudo:env-harvest-conflictwarning listing overwritten module/export names.Also in this service major (additive public surface, riding the required major for the priority change):
- Public harvest helpers:
mergeHarvestUnderEnv(optional per-callonConflict),setEnvHarvestConflictCollector(returns previous; save/restore for nested analysis),getEnvHarvestConflictCollector,clearNodeHarvestCache,getNodeHarvestCacheSize,isHarvestNodeDisabled,HARVEST_NODE_DEFAULT_*. Negative harvest outcomes (not-found/no-dts/failed) are cached in-process;NUDO_HARVEST_NODE=offstays explicit and uncached.clearNodeHarvestCache()also dropsnot-foundmisses so a later@types/nodeinstall is visible in-process.nudo:env-harvest-conflictwarnings point at the conflicting import specifier when found (file-levelline 0otherwise). @nudojs/env(minor):events/stream/querystring; high-frequencyutilslots; Promise APIs only underfs.promises/node:fs/promises(callback-stylefs.readFileetc. no longer pretend to return Promise). Optional Node params (path.basenameext,url.URLbase) keep typed labels (ext?: string) but are not required slots —requiredFnArityskips?/....@nudojs/core(patch):formatShaperenders fn rest labels (...paths) and optional labels (options?) as...name: T/name?: T.leqAbsfn arity uses required slots only (requiredFnArityskips...rest/name?): src is assignable to tgt iffsrc.required ≤ tgt.required(TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). PairwiseparamTypescontravariance is unchanged.@nudojs/lsp(patch): freeze inventory inpublic-api.ts(also exported as@nudojs/lsp/public-api); agent slash requests register fromNUDO_AGENT_TOOL_NAMES;selectCase/getActiveCasesare editor executeCommand + slash-only (not dot-form custom requests).
Migration for env consumers who need bit-stable hover/format strings: pin
@nudojs/env~0.3.0after the next release, and prefer leaf-clean coverage counts (empty{ }shapes are not leaf-clean) over raw resolved ratios. - Public harvest helpers:
Patch Changes
- Updated dependencies [9731238]
- @nudojs/core@2.0.1
- @nudojs/env@0.4.0
- @nudojs/harvester@0.2.6
- @nudojs/parser@0.5.1
2.0.0
Major Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
- @nudojs/parser@0.5.0
- @nudojs/env@0.3.0
- @nudojs/harvester@0.2.5
1.0.1
Patch Changes
- Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
- @nudojs/env@0.2.5
- @nudojs/harvester@0.2.4
- @nudojs/parser@0.4.2
1.0.0
Major Changes
-
0fd253f: BREAKING:
@nudojs/cli/evaluator子路径已移除。求值器 API 迁至@nudojs/service/evaluator(消除 cli↔service 工作区环)。迁移:import { … } from "@nudojs/cli/evaluator"→import { … } from "@nudojs/service/evaluator"。架构与正确性批次:
正确性修复(core)
slots[key]原型链泄漏:__proto__/toString/valueOf等键命中 Object.prototype 导致引擎崩溃或误报——新增getSlot守卫并接入 projectBrand / 静态与计算成员访问 / leq / check 五处读取点(eventemitter3 真实包上曾崩溃)Array.from语义修正:与Array.of混用导致Array.from(new Set(arr))误报Set[];现按元素分布(tuple→ 元素 join、string→string[]),未建模可迭代物诚实返回 unknown- 模板
endsWith不健全判定修正:误报 false 的分支改为共享的健全decideEndsWith nudo:assign-mismatch精度:分支/循环体内的可变绑定重赋值(特性检测模式)不再误报;无条件标量改型仍报(金标行为保持)nudo:arg-structure精度:x && x.__esModule && x.default守卫后的成员访问不再计为必填 slot
结构拆分(无行为变化)
- check.ts 2024→748 行:源码级调用图侦察拆至 algebra/scan.ts;AstEnv 类型下沉 ast-env.ts(消 5 处巨石 type-import 环)
- evaluator.ts 5164→4058 行:内置方法语义迁至 builtins/builtin-methods.ts;analyzer.ts LSP 表面拆至 service/lsp-surface.ts
- 模板字符串语义归一:refinements/template.ts 七处重复实现改为委托 algebra/template.ts(单一真理源)
- 容器策略单源:ast-eval 与 B 路径 runtime 共享 containers.ts(>8 元素字面量降级策略一致,B 路径 $concat 修正嵌套近似)
- 求值器域从 @nudojs/cli 迁至 @nudojs/service/evaluator(消除 cli↔service 工作区环;
@nudojs/cli/evaluator子路径移除,改用@nudojs/service/evaluator) - 真实包门禁加固:扫描失败/0 文件即红,不再静默 skip;fixture 包显式声明为 core devDependencies
Minor Changes
-
0f0b7d5: Feature: Interface 分层推导 Phase 1(design-refine-derivation.md)
- 侧车同名自动绑定:
foo.nudo.js导出绑定foo.js本地 named export;手写 >@generated> 隐式合并序 - 约束代数:
lit/union/fn/shift/and/partial/pick/omit - Abs→ 契约投影与字面量域隶属(domain-membership)
- 新诊断:
nudo:interface-drift/interface-domain-exceeds/interface-conflict/interface-cycle/interface-load/interface-name-clash - CLI:
nudo interface(别名refine)分层打印;--emit/--fn/--all/--dry-run/--exit-on-diff/--callsites;nudo check --callsites - 配置:
package.json#nudo.interface.autoBind(默认 true;node_modules 永不 ambient 加载) - LSP:CodeLens interface 默认层 + persist/update;agent 工具
nudo.interface/nudo.interface.emit(emit 路径限制在项目根内) - 新薄壳包
nudo(bin委托@nudojs/cli)
- 侧车同名自动绑定:
Patch Changes
-
a2aac9e: Final review pass on feat/interface Phase 1:
- LSP emit bound live:
handleInterfaceEmitnow passesagentToolDepssoworkspaceRootsreachassertEmitTargetAllowed(was dead in production). - Emit fail-closed: empty
workspaceRootsrejects; no ancestor-package.jsonauthorization fallback;realpathblocks symlink escape; refuse writes undernode_modules. - autoBind kill-switch complete: threaded through scan
generalizeFromAst/ same-fileeiOpts; emptyfromFileno longer ambient-binds.nudo.js. - Conflict skip: conflicted params no longer also emit call-site
constraint-violated; detect eq/eq and eq/bound unsat. - Return contracts: string length bounds (
string().min/max) enforced via domain membership. - Perf/stability: file-local
effectiveInterfacememo in check;take*Sinceon memo hit/miss (no LSP diag theft);shiftrejects non-finite offsets;@generatedmarker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
- LSP emit bound live:
-
de47d84: Review fixes on feat/interface Phase 1:
- autoBind kill-switch: analyzer's cross-file
nudo:interface-domain-exceedspath now readspackage.json#nudo.interface.autoBind(was silently ambient-loading sidecars whenautoBind: false). nudo check --callsites: inject usage-site call records so CI gate can surfacenudo:interface-domain-exceeds(previously only reachable via analyze/interface paths).- Sidecar auto-bind coverage:
localNamedExportsaccepts localexport { x }/export { local as exported }list form (was declaration-only; silent miss for common style). - Directory targets:
isNudoTargetPathexcludes*.nudo.js/*.nudo.tsso check/infer/doctor no longer treat contract modules as source. - VS Code client: documentSelector includes TypeScript; file watcher covers
**/*.{js,mjs,ts}(includes.nudo.tssidecars). - LSP emit: failed
interfaceEmitno longer claims "sidecar written" and skips the invalidation path. - UX: first
--emitwith empty default targets prints a--fn/--alltip;--fn/--allwithout--emitwarn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
- autoBind kill-switch: analyzer's cross-file
-
78f6752: Fix hover, case switching, and NaN folding in Zed-style clients.
const n = double(21)reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.- Relational compare folds mixed concrete lits (
"a" > 3→ false), soif (x > 3)does not join both branches for NaN inputs. joinValuesusesObject.issojoin(NaN, NaN)staysNaN(NaN === NaNis false).workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]).- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes. - Param inlay no longer invents
where x > 3fromif (x > 3) return x— only explicit@nudo:refinecontracts show as preconditions. - Return inlay is a path summary with source param names:
x + 1,x | x * 2(not the refinednumber where x>3 | string | …dump). - Number range narrowing uses exclusive bounds (
> 3, not integer-style>= 4). - Concrete
iftests no longer narrow the tested value into a range (44 > 3keepsxas44). - True branch of
x > kon unknown refines tonumber>… | string(JS ToNumber space). flattenSumkeys prim members by term/pred sonumber=A1>3andnumber=A1*2stay distinct paths.
-
Updated dependencies [0fd253f]
-
Updated dependencies [a2aac9e]
-
Updated dependencies [0f0b7d5]
-
Updated dependencies [de47d84]
-
Updated dependencies [78f6752]
- @nudojs/core@1.0.0
- @nudojs/env@0.2.4
- @nudojs/harvester@0.2.3
- @nudojs/parser@0.4.1
0.3.2
Patch Changes
-
1d233a7: Fix hover and CodeLens case switching in Zed-style clients, and fold JS ToNumber for
- * / %.const n = double(21)now reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]), not only the agent object form.- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes, so selecting a case actually changes the shown types.
-
Updated dependencies [1d6bb01]
-
Updated dependencies [1d6bb01]
-
Updated dependencies [1d6bb01]
-
Updated dependencies [1d233a7]
- @nudojs/cli@0.4.0
- @nudojs/core@0.4.0
- @nudojs/parser@0.4.0
- @nudojs/harvester@0.2.2
0.3.1
Patch Changes
- df1726c: Make
@nudo:envactually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path$invokeimplements string methods and filters union members, andcollectAbsCallRecordsmerges env modules so call@ cases no longer overwrite correct B-path results. - bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
- @nudojs/cli@0.3.1
- @nudojs/parser@0.3.1
- @nudojs/harvester@0.2.1
0.3.0
Minor Changes
-
5786fa5: Promote the B-path (transpile + in-process Abs runtime) to the primary evaluation path for capable sources.
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
export *, require, cycle/depth/missing guards, and env modules (path/node:pathetc.). - Diagnostics,
@nudo:env/ mock injection,call@/entry@provenance, method-missing, unknown-recv, generators, classes, async/await, optional chaining, and destructuring run through B. - When B hosts a file,
evaluateProgramis skipped so TypeValue no longer double-reports. - CLI
check/types/testaccept directories; check uses an Abs-only gate. - LSP hover /
getTypeAtPositionon capable files read the Abs node table;*.nudo.jsedits evict L0 and recheck open parents. - Public core surface now re-exports the algebra API (
Abs, check, generalize, exec, bridge,parseSource,stripTypes).
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
-
5786fa5: Speed up repeated analysis with layered memos and tighter cache contracts.
- Shared parse/AST LRU,
generalizeFromAstL0–L3 (instantiate, α-equivalence, dep fingerprint + LRU), Abs module cache, and session-wide memos with an incremental after-edit path. - Host cache-eviction contract, AST/function-fingerprint memory caps, conservative call-scan depth cap, and fail-open truncated dependency fingerprints.
- Fix session-memo staleness and identity holes so after-edit results stay correct.
- Shared parse/AST LRU,
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
- @nudojs/cli@0.3.0
- @nudojs/harvester@0.2.0
- @nudojs/parser@0.3.0
0.2.1
Patch Changes
- Updated dependencies [0fd0718]
- @nudojs/cli@0.2.1
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version
Patch Changes
- Updated dependencies [6c38283]
- Updated dependencies [9f7f819]
- Updated dependencies [c175f71]
- @nudojs/cli@0.2.0
- @nudojs/core@0.2.0
- @nudojs/parser@0.2.0
0.1.0
Minor Changes
- Conceptual design and basic implementation.
Patch Changes
- Updated dependencies
- nudo@0.1.0
- @nudojs/core@0.1.0
- @nudojs/parser@0.1.0
nudojs (CLI) 1.9.3
1.9.3
Patch Changes
-
795e322: Close the 34 bugs from the ABS-15 audit, grouped by root cause rather than patched one at a time.
check— one judgment per decision, so the faces cannot disagree:- a
.tsconstructor annotation (including parameter properties) is now the instance field's domain, soconstructor(private size: number)+area() { return this.size * this.size }reportsnumberinstead of anany-arithmeticnudo:entry-may-throwerror while the dts face already saidnumber; - definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero,
inon a primitive right-hand side, and calling a member an object literal does not have; - the call-site local binding table records every declaration shape (parameters,
catch,for-of/in,let/var, destructuring) as an explicit "no information" entry, so shadowing no longer reads the module-levelconst(false red) and destructured declarations reach the obligation check (false green); - a classic
for (const i = 0; …; i++)head is aconstagain, so the always-throwing step is reported instead of staying green; nudo:capability-deniedjoins the check-face diagnostic whitelist, sonudo checkcan report the cause ofunknownlikenudo test— gated on the report actually showing an inference failure (nudo:unknown-inference), so a plainmodule.exports = …file does not grow a warning about themoduleglobal while the same exports written asexports.xreport nothing.- cross-file evidence from
--fromnow resolves the default export name on both sides, so a renamed default import,import { default as g }andns.default(...)are no longer silently dropped.
nudo export— the publish gate is a semantic judgment (degraded evidence on the published surface AND a declared contract) instead of a three-code whitelist, with declaration truth taken fromeffectiveContract's own resolution. Contract-face diagnostics always block; general degradation (nudo:internal/nudo:unknown-inference) blocks only when it is attributed to an entry that declared a contract (or carries no function, i.e. is module-level). Compatibility: a module whose contract fails to parse (nudo:contract-syntax) now blocks the export (exit 1, no artifacts, diagnostics surfaced) instead of publishing an "accepts everything" validator with exit 0; unannotated modules — and unannotated sibling entries — keep publishing and only see the degradation surfaced.dts projection — one resolvability predicate for type names (TS tokens, runtime globals, local classes, mirrored
interface/type, imported names) plus the missing branches it exposed:export =for single-value CJS modules, member-wise types forexport default {…}and arrays, real re-export statements for imported bindings,extends/type-parameter clauses on namespace members, and destructured parameters that render as a pattern the source can actually write. Compatibility:<fn>Inputkeys a destructured parameter by its field names rather than the internal_p0placeholder, which is not a public name and made the published validator reject the only legal call shape. Two boundaries are pinned: a module that exports a type (export interface/export type) alongsidemodule.exports = valuekeeps the named-export projection (TS forbidsexport =next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than onereturnprojectsunknowninstead of the first return's type (a single-return pick would be narrower than the runtime value).LSP — completion decides the lexical context with a per-character scanner (line and block comments, quotes, templates with
${}nesting, regex bodies and character classes), so a continuation line inside a multi-line template or comment no longer offers rewrites of the literal; member completion merges the instance/static class member table from core's single class-body scan.The
checkentry census behind these runs on the semantic binding index (ADR 0001 stage 1), and stage 1 slice 4.3 replaces the publish gate's shadow comparison with the semantic verdict it was measuring. The public.export surface is unchanged. - a
-
Updated dependencies [795e322]
-
Updated dependencies [161d156]
- @nudojs/core@1.20.1
- @nudojs/service@1.12.3
- @nudojs/env@0.5.11
- @nudojs/harvester@0.6.3
- @nudojs/parser@1.5.11
Version history (61)
1.9.2
Patch Changes
- Updated dependencies [c93a32d]
- Updated dependencies [190761e]
- Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
- @nudojs/parser@1.5.10
- @nudojs/service@1.12.2
- @nudojs/env@0.5.10
- @nudojs/harvester@0.6.2
1.9.1
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
- @nudojs/env@0.5.9
- @nudojs/harvester@0.6.1
- @nudojs/parser@1.5.9
- @nudojs/service@1.12.1
1.9.0
Minor Changes
-
e1e6892: ABS-01: constraint / lemma grammar — arithmetic relations, dependent return contracts, and contract-internal binders.
@nudo:assumeand@nudo:invariantaccept simple arithmetic expressions (name,number,name ± number):@nudo:assume i + 1 <= n,@nudo:invariant i < n. Multiplication / division / parentheses stay malformed with the existing fail-closed diagnostics.@nudo:contract return <rel> <expr>builds a dependent return obligation on the return term (return > x). IEEE-sound proof rule added for non-strict offset comparisons (round(b + c) >= b,c >= 0); strict>/<on unbounded operands report an honest unprovable warning (2^53 + 1 = 2^53 is a real counterexample), never a false red.- Contract-internal binders:
bind(name, constraint),ref(name),ref(name).at(path)with scope = one constraint tree.EffectiveContractcarries a cross-slot binder table sofn({...}, array(ref("b")))can reference a binder declared in a callback slot. Unbound refs fail closed (nudo:contract-load) and never degrade toany(). - Refs are resolved before proofs / instantiation / entry-Abs projection, so a ref slot cannot pass as an obligation-free
any(). - Public surface additive:
bind/ref/relbuilders plusBinderTableand resolver helpers (public API snapshot updated).
-
ca8005b: ABS-02: explain where
unknown/anycame from (observation-only side channel).- New
buildUnknownExplanations/formatUnknownExplanations(core) derive a stable, deduped reason list from existing observation faces (signatures, issues, budget, eval fallbacks) — no Abs field, no cache-key orleqAbschange; cold/warm results are untouched by construction. - Reasons:
budget/missing-env/unsupported/eval-failure/no-contract/explicit-any/inference-failure, each with an actionable suggestion. Cycle truncation says explicitly that@nudo:budgetcannot help. nudo check --explain-unknownprints the list after the human report; default output is byte-identical and--json/--gitlabmachine contracts are unaffected.
- New
-
1a4cabd: ABS-03: dts projection completion — contract generics, readable contract notes, overload arms.
- Contract-side type parameters are now derived from binder vars (
bind:<name>) and emitted only when referenced by a parameter or the return type: the entry-only HOF contract projects asexport declare function processItems<a, b>(items: a[], transform: (x: a) => b): b[];(element domain and callback parameter share the same variable; unreferenced vars are dropped). .d.tsJSDoc gains readableContract:rows (sidecar expression text / constraint rendering). They are notes only — the type face still comes from Abs, andCase:rows keep their debug-witness role.- Function Abs with a declared overload set now projects as a TS object type with per-arm call signatures (declaration order = TS resolution order) instead of collapsing to the union face.
- Schema projection already emits numeric
gt/ge/lt/lebounds; new tests pin bounded output and the honest omission of non-expressible relations (x > y).
- Contract-side type parameters are now derived from binder vars (
-
b57d1d2: ABS-04: test observation face — outermost witnesses survive the budget, and the two paths are discoverable.
- Call-site witness selection now prefers the outermost records (concrete arguments) over internal records whose arguments carry free term variables (α names / derived expressions from recursive or higher-order evaluation). A
sumTo(3)-style top-level witness is no longer pushed out ofcallSiteBudgetby internal records. - When a function has both
@nudo:caseand call-site records, the default run keeps the mutual-exclusion report and prints aboth-pathshint naming those functions, pointing at--both-paths(sources stay labeled: directive vs callsite).--jsonis unaffected; truncation reasons and their next actions keep flowing through the existingnudo:*-truncateddiagnostics. Under--freezethe hint is suppressed:--both-pathscombined with--freezeis a usage error, so the suggestion is not actionable in that run.
- Call-site witness selection now prefers the outermost records (concrete arguments) over internal records whose arguments carry free term variables (α names / derived expressions from recursive or higher-order evaluation). A
-
09f5ff8: ABS-08: automatic loop-invariant candidates (phase 1 — observation only).
- The loop widener records numeric bounds of scalar loop-carried bindings across observed iteration snapshots. When widening actually happens, these become candidates surfaced as
nudo:invariant-inferredinfo diagnostics with the observed bound and sample count. - Candidates never participate in proofs: an observed extreme over a bounded number of iterations is one-sided evidence, not a proved invariant. Only an explicit
@nudo:invariantdeclaration enters the proof (audited vianudo:invariant-relied) — so inference cannot introduce false greens. - User declarations override candidates for the same binding (no duplicate hints).
- Bounded loops that never widen produce no candidates (no noise).
- Diagnostics docs updated (EN + zh).
- The loop widener records numeric bounds of scalar loop-carried bindings across observed iteration snapshots. When widening actually happens, these become candidates surfaced as
-
4361e2e: DX:
nudo test --both-paths(directive + synthesized witnesses in one round) and opt-in HMAC-signed disk cache entries.nudo test <path> --both-paths [--only <names>]: functions with@nudo:casedirectives now can also synthesizecall@/entry@witnesses in the same round (teaching comparison face; default exclusivity unchanged).--jsonseparates the paths viasource: "directive" | "callsite"; exit semantics unchanged (synthetic cases never fail the run).--onlywithout--both-paths, and--both-paths --freeze, are usage errors.- Signed disk cache:
package.json#nudo.cache.sign: true+NUDO_CACHE_KEYsigns every entry (HMAC-SHA256, domain-separated key derivation). Verification failure = miss (recompute, never trust) — a forged CheckJson can no longer pass the gate; signed/unsigned key spaces are separate, so key rotation is a clean full miss. Fail-closed config: sign without a key, or a non-boolean sign, refuses to run (check/contract/health, machine-readable on--json) instead of silently running unsigned.nudo.cachealso accepts an object form{ dir?, sign? }; typo'd keys surface asconfig-shapereport entries. - truncation suggestions: fork/recursion-budget fix values in the analyzer now consume the single-sourced
suggested{Fork,Depth,Calls}Ceilinghelpers from@nudojs/core/internal(same wording as the check face, concrete numbers instead of@nudo:budget depth=…placeholders). - benchmark:
bench-monorepo.mts --corpus <path>runs the S1 benchmark against a real monorepo directory (dynamic hub/mid/leaf targets from the module graph, in-memory edits only — user files are never written; report lands ins1-perf-baseline-real.{md,json}with an honest corpus header).
-
4fc7e19: Rename the remaining Nudo
interfaceterminology tocontractend to end.- Core:
effectiveInterface→effectiveContract,InterfaceSource→ContractSource,InterfaceTierInfo→ContractTierInfo,interfaceTierOf→contractTierOf,takeInterfaceDiags*→takeContractDiags*, and thealgebra/interface/directory →algebra/contract/. - Service:
emitInterface/draftInterface/interfaceSurface→emitContract/draftContract/contractSurface;interface-*.tsfiles →contract-*.ts;ifaceCacheKey→contractCacheKeyand the disk-cache namespaceiface→contract. - Diagnostics:
nudo:interface-*→nudo:contract-*(no alias layer). - CLI/LSP: CodeLens titles
⚡ persist contract/↻ update contract/⚡ draft contract; agent messagesno contract found/no contract changes;CheckIssueactions and hover/inlay fields usecontractSource/contractDisplay/contractActive. - Docs, examples (
contract-derivation/,contract-draft/), API snapshots, and website references updated.
TypeScript's
interfacekeyword, Babel ASTTSInterface*, and historical release notes are intentionally unchanged. - Core:
-
09d88d6: Feat:
nudo initcoexistence pointer + copy-paste default client configs (LSP-G4 DX).- init: after writing the adoption baseline, when the target package has
tsconfig.json/jsconfig.json, init appends a coexistence hint block — the VS Code commandnudo.coexistence.apply("Nudo: Apply coexistence settings") and the coexistence-guide recipe URL (include/exclude/mode: "directives"). Print-only: no tsconfig / editor settings are rewritten; the minimal-write discipline (Bug 681) and the existing init boundaries (B676/677/678/680, Bug 1144, Bug 229) are unchanged, and the idempotent no-write path prints no hint. - website (EN + zh-Hans mirrors): lsp-clients Setup notes upgraded to copy-paste default config blocks — the Zed
settings.jsonblock now shipssemantic_tokens: "combined"inline (previously prose-only); Neovim lspconfig and Helixlanguages.tomlblocks are labeled as complete copy-whole defaults. zed.md Settings gets the same semantic_tokens fold. Known-gaps G4 rows (both locales) note the init pointer;docs/design/lsp-client-gaps.mdG4 status records it.
- init: after writing the adoption baseline, when the target package has
-
a9638c2: Feat: precision-cliff UX —
nudo testcall@symbolic hint +nudo healthprecision counts.nudo test: when a report containscall@symbolic(the symbolic aggregate witness folded from call sites beyondcallSiteBudget), the report tail now appends one actionable note (SYMBOLIC_BUDGET_NOTE, same "fact — action A or action B" shape as thenudo:recursion-truncatedadvice): raisepackage.json#nudo.analysis.callSiteBudget(1–64, default 3) or pin exact witnesses with@nudo:case(limitations §3.2.2 wording — for recursion pin@nudo:case, don't rely on call@). Display-face only: no assertion counting, no exit-code change. Reports withoutcall@symbolicstay byte-identical.nudo health: the Summary line and the--jsonsummary (same source) now carry precision counts —unknownSignatures(functions whose return the engine could not infer; rendersunknown, counted via the sharedinferenceFailedpredicate;@nudo:skipfunctions are declared faces and not counted) andwidenedWitnesses(occurrences of#widened, i.e. witnesses withconf === "widened"— budget-folded symbolic aggregates / loop widening). Informational only, likeuncovered: never gates the exit code. Text Summary reads… · N unknown signature(s) · M #widened witness(es);--jsonsummary gains additive keysunknownSignatures/widenedWitnesses.@nudojs/serviceexportsSYMBOLIC_BUDGET_NOTE(single source for the note text; CLI and tests consume the same constant). Regressions pinned inpackages/nudojs/src/__tests__/precision-hints.test.ts; family-63 health baselines and the e2e health golden updated for the Summary extension (their fixtures now pin src tsconfig per thewriteSrcTsconfigconvention, so they no longer silently test a staledist/).
Patch Changes
-
67ece35: Add
--capabilities strict|trustedtocheck,testandhealth(ABS-12 R12-D).strict(default, same asNUDO_CAPABILITIES=strict) hides side-effectful host globals andnode:modules: values stayunknown, denied names reportnudo:capability-denied, and the canary suite proves no socket/file/process side effects.trustedrestores the legacybuiltin-unknownsurface while the hand-written high-risk host-function blocklist stays active. Invalid values fail with a usage error. Docs updated (EN + zh-Hans). -
46719cb: Speed up
check --watchincremental rounds by reusing the evaluator injection object per file across rounds and by memoizing dependency fingerprints within a round.checkMemoKeykeys onmoduleMapId(modules)(identity), so rebuilding the injection for every file on every round made the check memo miss; the injection is now cached under the exact analysis-input identity (stable source × dependency fingerprints × env names/contents × preload state × autoBind × analysis config), and dependency fingerprints computed by the injection key,analyzeFileand the printer are shared inside a round. On the 48-file semver corpus an inert edit round drops from 2600ms to 718ms for a hub file (total929ms, under the 1s target) and to 345ms / 555ms for a leaf; semantic edits still recompute the dependency chain. Diagnostics collected during injection assembly are replayed on a cache hit, and truncated / read-error fingerprints opt out of the cache (fail-closed). -
b6cdf66: Stop invalidating the whole dependency chain for inert edits. Dependency contents now enter every cache key through the same
stableAnalyzeKeySourceprojection the entry file already used: trailing comments/whitespace that carry no@nudodirective no longer flip the dependency fingerprint (check disk keys, evaluator memo, generalize L0, per-fn memo), while real code, line shifts and@nudodirectives still do.check --watchnow evicts only the files that actually changed; dependents rely on the content fingerprints to miss (semantic edit) or hit (inert edit).Measured on the 48-file semver corpus (dist, clean
NODE_OPTIONS): hub editanalyze3313ms → 2597ms, leaf 1009ms → 875ms. A single dependent'sanalyzeFileAsyncdrops from ~663–734ms to 9.9ms after an inert dependency edit, while a semantic edit still misses (172ms). The residual watch cost is thecheckverb's owncheckSource(~500ms/file, memo keyed by module-map identity), tracked as the next ABS-18 item. Pinned byload-deps-fp-stable.test.tsandabs18-watch-inert-eviction.test.ts. -
38eedd0: Fix the macOS
/var→/private/varpath-space mismatch behind the 9 long-standing LSP/CLI baseline failures, and remove watch FSEvents noise.On macOS
os.tmpdir()returns/var/folders/..., a symlink to/private/var/folders/.... The kernel givesprocess.cwd()/realpathSync()the realpath form, while user arguments and test fixtures keep the/var/...literal. Two product faces mixed those spaces:- LSP emit boundary (
agent-tools.ts):assertEmitTargetAllowed/resolvedWorkspaceRoots/derivedSidecarAllowedrealpathed only existing paths. A not-yet-written source file or downstream sidecar fell back to the/var/...literal and was compared against a/private/...root, so legitimate writes were rejected as "outside allowed roots" (Bug 762 derived emit, Bug 765 unsaved-buffer guard). All three now use the sharednormalizeRealPathfrom@nudojs/service, which falls back torealpath(dirname) + basenamefor missing targets. Real symlink-escape protection is unchanged (Bug 766's escape case still fails closed). - CLI relative display:
relative(process.cwd(), resolve(userArg))produced../../../../../../../var/.../syn.js, polluting the JSONfilefield and human-facing text (Bug 661 / 663 / 664 / 63b). NewrelFromCwd()normalizes the target into the cwd's realpath space before subtracting; the contract command family (print / draft / emit / from-dts) and watch error lines now use it.displayPathOfis deliberately untouched, so the check/test/health baselines stay byte-identical. On non-symlink hosts and in-repo paths output is byte-identical.
The same watch loop also stops swallowing edits: fingerprint baselines are recorded when a round's changed paths are accepted, before analysis (and dropped for deleted files), not after the incremental round resolves. The old ordering re-baselined any write that landed while the round was running, so
filterUnchangedWatchPathssaw it as unchanged and the edit was silently skipped until the next save.startWatchnow filters FSEvents noise: macOS directory watchers report untouched files from the same batch, so changinga.jscould also re-runsub/b.jsand made the Bug 684/685 "re-run exactly the changed file" assertions flaky (~1/3 of runs). The debounce window keeps only paths whose(size, mtimeMs)fingerprint actually changed; deletions, new files and non-tracked paths (config / sidecar / env templates) always pass through. Extracted as testablewatchPathVersion/filterUnchangedWatchPaths, covered bycli-watch-noise-filter.test.ts(7 cases). Reverting the filter reproduces the flake; with it, 8/8 repeated runs and all 12 watch test files / 33 cases pass. The lose-an-edit race has no deterministic e2e fixture yet (it needs a controllably slow analysis); the pure filter plus the existing watch suites are the regression surface. - LSP emit boundary (
-
83c1ed2: Chore: expand the OSS real-package benchmark corpus from 3 to 10 packages (
commander/yargs/semver+eventemitter3/kleur/ms/is-plain-obj/escape-string-regexp/p-limit/yocto-queue) and regeneratebenchmark/oss/baseline.json+docs/reports/oss-perf-baseline.{md,json}. Every package is L1 zero-FP on the new corpus. Candidate packages that could not join honestly are documented inbenchmark/oss/packages.mts:debugand@changesets/clicrash on the analyze path (evaluating them clobbers hostprocess.env/globalThis.Error— engine debt, not gate-threshold material),lodashblows the wall-clock budget,@babel/typescrashescheckSource, and@babel/parser/@babel/traversesingle-file bundles dominate a bench round. Benchmark-only change — no engine code touched. -
05b7b82: Chore: re-admit
debugand@changesets/clito the OSS real-package benchmark corpus (10 → 12 packages, 120 files) after the host-global-purity fix (B1/B2: fork/member-write rebinds gated on$rebindable— analysis no longer clobbers hostprocess/globalThis.Error). Both are L1 zero-FP across 4 trusted runs;benchmark/oss/baseline.json+docs/reports/oss-perf-baseline.{md,json}regenerated (envelope = observed max of 4 quiet runs ×1.10, same convention as the previous expansion).@babel/typesstays excluded for wall-clock only (single ~3 MB bundle, onecheckSourcepass ≈ 4 min past the per-round budget) — its earlier crash is fixed (B3). -
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [1a4cabd]
-
Updated dependencies [b57d1d2]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [4361e2e]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [1aab8ff]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [a9638c2]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [b060986]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
- @nudojs/harvester@0.6.0
- @nudojs/service@1.12.0
- @nudojs/env@0.5.8
- @nudojs/parser@1.5.8
1.8.0
Minor Changes
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
-
5cd4106: Dedup batch 2 (jscpd + hand-sync-comment audit): single-source the remaining cross-file / cross-package copies that were pinned together by comments or mirror tests instead of code.
- String-aware scanners (
splitTopLevelArgs/findTopLevelColon/stripJsdocContinuation→ newcore/algebra/text-scan.ts, exported via@nudojs/core/internal): the check face (case-arg split) and the parser directive face each kept verbatim copies — Bug 1009 was exactly this pair drifting (check face treated\as an escape ⇒ one arg fewer ⇒ L2 witness silently skipped).scanWithStringswas dead after the move and is gone. - bigint operand predicates (
isNullishLitOperand/isKnownNonBigintNumeric/isMaybeBigintOperand):surface.tscarried a forked copy ofarithmetic/coerce.ts— itsisMaybeBigintOperandlacked the Bug 946arr/tuplearms and only stayed sound by accident of the catch-all throw. Single source in coerce;foldNumericBinOpnow mirrors foldBigintBinOp's explicit arr/tuple hard-throw so1n & []still throws deterministically. - Bug 946 member-level fix (behavior):
isMaybeCoercionThrowOperandnow recurses intosummembers and skipsarr/tuplemembers —x & 1/1 - xwithx: number | []no longer records a false TypeError may-throw (native never throws; the old member scan dragged arr members into the may-throw channel ⇒ potential L2 false red). Regression-pinned in the Bug 946 suite, including the sound positive control (1n + xon the same union still records may-throw: the number member genuinely throws). collectNestedBodyRangeswiring completed: core exported it via@nudojs/core/internaland its comment claimed parser reuse, but parser still ran a full local copy.file-directives.tsnow consumes the single source.parseIgnoreThrows/configIgnoreThrows: service is the declared single implementation (CLI / LSP / vite-plugin); the CLI kept its own verbatim copy and the LSP test suite used that copy as a mirror oracle. nudojs now re-exports from@nudojs/service; the tautological mirror assertion is replaced by direct-value assertions.absShapeForTsTypeTextvia@nudojs/core/internal: service'stsAnnotationShapewas a hand-synced table replica ("勿单边扩表") with a drift-gate test holding the two copies together; both the replica body and the drift-gate file are gone.- emit section extraction:
interface-derivation-emit.tsandinterface-emitter.tsduplicated the export-statement →{names, bindings}extraction (31 lines) andstripSections(14 lines); both now shareservice/emit/export-section-scan.ts. ScanLiteralCallsOptions: the thin shell's inline opts literal type was a documented structural mirror of the named interface; the shell now consumes the interface directly.
- String-aware scanners (
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
5769211: Dedup batch 5 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the four remaining comment-pinned manual-sync obligations and the seven whole-function twins. Pure refactor — outputs byte-identical (vitest --changed 16815 passed, verify:examples 251 checks, lint + lint:tests clean).Comment-confessed sync pairs now single-sourced:
- transpile
stmt/statement.tsyield try-context bits (raw1|4|8/& 2/~(16|32|64)literals pinned by a "钉死同步" comment to runtimecontrol.tsYIELD_* constants) → new zero-dependency leafexec/yield-bits.ts; runtime (control.tsre-export removed,async.ts) and transpile (statement.ts) both import the named constants. - parser
case-arg.tsTYPE_EXPR_CHAIN_METHODShand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exportsCONSTRAINT_CHAIN_METHOD_NAMES(public barrel, next toCONSTRAINT_BUILDER_NAMES); parity pinned byconstraint-chain-methods.test.ts(method-face drift ⇒ CI red). - service
builtin-prototype.tsBUILTIN_ERROR_CLASSESverbatim 8-name copy of coreERROR_CTOR_NAMES→ imported via@nudojs/core/internal(the dead module-level re-export is removed; no public face change). - core
promise.tsaggregateErrorAbslocal error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated ineval-bug-293-promise-combinator-settle.test.ts(slot-key set / non-enumerable flags / inherited name vserrorBrandAbs).
Whole-function twins single-sourced:
- core
builtins/error/binary.tsmakeArrayBufferAbs/makeSharedArrayBufferAbs→ parameterizedmakeBufferAbs(brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved). - core
transpile/member-path.tsmemberWriteIfe/memberWriteRootIfe→ sharedmemberWriteIfeImpl(only real difference: return written value vs new root). - nudojs
version.tsthree walk-up-to-package.json loops →findPkgDirUpwards+readVersionAt. - nudojs
migrate.tsplanWorkflowRewrites→ delegates toplanWorkflowRewritesIn(findWorkflowDir(from));readPackageJsonDetailed/readMarkerFile→ sharedreadJsonObjectDetailed(path, label)(missing / invalid / unreadable / ok grading unchanged). - service
emit/quickfix-edits.tssidecarClearsEntryThrow/sidecarClearsConstraintViolation→ sharedsidecarClearsDiags(input, codes)(Bug 556 dual-code gate preserved). - core
generalize.tsctorParamCountOf/ctorFormalsOftwin class-ctor walkers → singlectorParamNodesOfwalker (Bug 1031 null-declaration skip lives once; count still raw param length, formals stillformalParamsFromNodes— thethis-param skip semantics unchanged). - lsp
server-commands.tshandleSelectCase/handleSelectContract~20-line resolve→read→caseTargets→knownFunctionNames preamble →resolveCaseTarget(error strings byte-identical).
- transpile
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
- @nudojs/parser@1.5.7
- @nudojs/service@1.11.0
- @nudojs/harvester@0.5.0
- @nudojs/env@0.5.7
1.7.3
Patch Changes
-
0650ef0: fix(service): 分析器 / 模块图 / 缓存面(BUG-011/012/070/089/101/127/129/139/152/170/171/205/206/207/238/239/240/241/267/268/269/270/273)
模块解析与缓存:
- BUG-238/240 — 裸包
import的 spec 现在携带mode并解析到真实文件(而非包名占位),模块图边与调用点记录据此建立。 - BUG-239 —
exports条件键按 package.json 声明顺序求值;browser仅作兜底,不再无条件优先。 - BUG-267 — pattern 键按 Node
PATTERN_KEY_COMPARE取最具体匹配(./x/*vs./x/*.js)。 - BUG-268 — 裸包解析在最近的已存在
node_modules停止;未命中的exports不再被上层包无声清空为exportsUnresolved=false。 - BUG-269 — 歧义
export *名称不再导出;导入方得到nudo:missing-export,与 Node 的「模糊即不存在」一致。 - BUG-270 —
exports数组回退只发生在 target 非法时;合法但文件缺失是终止态(ERR_MODULE_NOT_FOUND)。 - BUG-273 —
esm目录导入不再猜测index.*;legacy main保留该行为。 - BUG-241 — 磁盘缓存键的入口维度带项目根指纹,依赖维度仍可移植(跨项目不再互相污染)。
- BUG-012 — 函数缓存
envKeyFn补上@nudo:env内容指纹,与另外两层缓存口径一致。
调用点与报告:
- BUG-070/170/171 — 同名调用点仅在冲突时加列号(
call@L6C9);--from目录与重复调用点在合成前去重(先解析再按站点点位去重)。 - BUG-089 — 仅当本文件在该行列确实存在调用表达式时才附加
callSiteFile。 - BUG-127 —
dedupeCallRecords的键纳入调用点身份,不同站点的同名调用不再互相吞并。 - BUG-205 — 期望值判定统一走共享
inferenceFailed,并检查term:lit(null)/lit(undefined)是 exact,不是第三种「推断失败」态。 - BUG-206 —
never期望不再走「满足」短路。 - BUG-207 — 嵌套槽位谓词(
shape({ n: number().gt(0) }))参与判定并按递归formatExpected渲染;CLI 报告面改用 service 的formatExpected。 - BUG-011 — 空调用记录不再解引用
deduped[0]。 - BUG-101 —
isNudoTargetPath接受.cjs/.mts/.cts(排除.d.mts/.d.cts),migrate retire的nudo check .与VERIFY_TARGET_EXTS对齐。 - BUG-129 — 空
--from目录报nudo:path-empty-dir。 - BUG-139 — 静态成员扫描白名单化节点类型,
ClassProperty不再被当作方法。 - BUG-152 — 匿名
export default class注册到default槽位。
已更新的既有测试(原断言钉住声明的错误行为):
service/src/__tests__/resolve-npm-exports.test.ts— 数组回退改为「首个合法 target 即终止(即使文件缺失)」。service/src/__tests__/disk-cache.test.ts— 入口缓存键带项目身份,依赖键保持可移植。service/src/__tests__/target-path.test.ts—.cjs由拒绝改为接受,新增.mts/.cts。
已知未修(根因在本类文件之外,另行跟踪):BUG-019(行号重映射在
emit/case-emitter.ts)、BUG-022(entry 结算重入语义未定)、BUG-045(CJSmodule.exports成员导出面)、BUG-069(生成比较在emit/case-emitter.ts)、BUG-085(withAssumePremises未从 core 导出)。追加:本轮分析器面修复
- BUG-022:
settleEntryOnlyCandidates不再删除注册表条目;记录增长时先摘掉上次合成的 case 再按全量记录重合成 ⇒ 调用点先出现f(3)与后出现f(3)得到同一组见证 (3 witnesses,call@L5/8/11)与逐字节相同的--emit --dry-run契约。 测试:service-bug-022-callsite-domain-order.test.ts。 - BUG-045:
tryEvalCallFull走 core 的 cjs-member 语义(对exports["default"]做$invoke),并在合成调用记录里过滤无位置记录 ⇒obj.js(module.exports = {…})与dot.js(逐成员导出)在 dts/schema/guard 三面逐字节一致(dts 由unknown→number | string)。测试:service-bug-045-cjs-object-export-member、cli-bug-045-cjs-object-export-face。 - BUG-099(递归 / fork 两臂):分析器为整轮装截断收集器(串到
eval-run的嵌套 collector,否则单槽会被静默覆盖),标签映射到nudo:recursion-truncated/nudo:fork-truncated,文案与check同口径 ⇒nudo test与--json(summary.diagnostics)都可见。测试:service-bug-099-*、cli-bug-099-*。 循环臂(nudo:loop-truncated)此前缺 core 导出,现已补LOOP_TRUNCATION_LABEL(@nudojs/core/internal),接线待做。 - BUG-069 的发射侧(见证等价按「文件 + 实参载荷」)已由 emit 类修复并回归;
本条未修的是 CLI
--freeze新增模式的坐标(见 BUG-019)。 - BUG-085 已修:
runAbsView现把extractAssumeSegs的ok段折进前提槽 (withAssumePremises,不是phi),详见 cat-09 changeset。 - BUG-099 循环臂已修:
truncationDiagnostics增加label === LOOP_TRUNCATION_LABEL分支,且必须排在label.startsWith("#")兜底之前(兜底会把#loop-iterations静默吞掉)。nudo test/--json现报nudo:loop-truncated,文案与check面逐字一致 (「A loop did not terminate within its iteration budget …」),anchor 为文件起点 1:0 (事件不带函数归属,check 面同样无位置)。回归:service/src/__tests__/service-bug-099-loop-truncated.test.ts。 注:loop 迭代预算不在@nudo:budget覆盖范围内,故建议文案不提该指令。
追加:可见性判据(
gateFatal)与./internal快照analyzer-orchestrate.ts的 per-file 失败信号判据改为f.reason === "internal" || f.gateFatal === true(标签 ≠ 可见性):BUG-073 把装载期 逃逸改标module-throw后,原判据(只收internal)会让evalFailures变空 ⇒ 闸门丢掉 「模块装载失败 ⇒ 不得判绿」(BUG-072)。三条假红防线(unsupported:*/ 建模内NudoThrow/ 干净文件)不变。service/eval-run.ts的「引擎产出非 Abs 值」回落改传origin: "engine"(引擎自身违约 ⇒internal,与该 guard 的既有语义一致)。packages/core/public-api.snapshot.json追加 4 个./internal导出(引擎机件面,语义上 允许 minor 变动):LOOP_TRUNCATION_LABEL、extractAssumeSegs、isPointConstraint、widenObservationAbs,以及类型AssumeSeg;public-api-freeze测试随之复绿。
- BUG-238/240 — 裸包
-
fe03e18: fix(service): emit / 接口派生面(BUG-003/021/032/040/041/043/079/107/192/203/214/232/233/266/271/272)
- BUG-214 — 仅当全部用例都是
callsite时,主签名对观测返回值做widenObservedReturnAbs;entry@/ 指令用例保留嵌套精度(既有 Bug-565 引脚不变)。 - BUG-232 —
export --out下相对 specifier 按 outDir 重写(新增可选ExportArtifacts.sourcePath);moduleKey仍与路径无关,BUG-016 语义不变。 - BUG-233 — 导出「阻断」判定对齐
EXPORT_BLOCKING_CODES,不再只看severity === "error"。 - BUG-266 — 派生
.nudo.ts侧车写入前补 builder 声明(TS 侧车),复用coreExportNameOf。 - BUG-271 — 侧车 builder 可用性按 core 导出名 比较(
import { lit }不再豁免),必要时生成别名_nudo_lit与declare const … litC。 - BUG-272 — draft 的 builder import 扫描改为调用位匹配
(?<![\w$])b\s*\(,字段名不再误命中。 - BUG-192 — 类型注解先前丢弃任何含
/或换行的注解;现折叠换行,仅拒绝真正的注释标记(//、/*)。 - BUG-203 — Zod
.min()/.max()为码点计数,改为refine(s => s.length >= n)对齐 UTF-16(guard / standard / contract 一致)。 - BUG-003(部分)— 类构造器 / 静态参数未受约束时输出
any(而非unknown),与nudo check及 CLAUDE.md 口径一致。 - BUG-021 — 点观测不再直接成为契约:
widenObservationAbs后再joinThenProject;不可表达的联合保留原始投影兜底。 - BUG-032 —
absToSchemaNodeB增加 bigint 分支(z.bigint()),并去掉「已丢弃」账目。 - BUG-040 — draft 选择与
contract-draft.ts守卫均按 导出名 比较;--fn totallyMissing仍为用法错误(exit 1,不落盘)。 - BUG-041 — 派生段 label 改为包根相对(回退 basename),并以
labelKey()统一身份,旧拼写去重而非并集。 - BUG-043 — 侧车解析错误重新抛出时带侧车路径(原带路径分支为死代码)。
- BUG-079 —
combinedAbs == null的跳过分支改为输出(...args: unknown[]): any,不再整条导出消失。 - BUG-107 —
declaredParams的pattern分支读取FormalParam.optional;pattern + 默认值渲染为_p0?: T,绑定模式名仍必填。
已更新的既有测试(原断言钉住声明的错误行为):
emit/interface-emitter.test.ts(BUG-021,2 处)emit/emit-bug-514-…-dts-export-surface.test.ts(BUG-003:constructor(v: unknown)→any)emit/schema-bug-1046-bigint-literal.test.ts(BUG-032:观测 bigint 由unknown→prim bigint)emit/schema-bound-anchor.test.ts(2 处)、emit/schema-generator.test.ts(1 处)(BUG-203)
未修:
- BUG-196 —— 本夹具不再复现,但当时不是真修:
bar因 BUG-041 的 label 身份变化被报为not_projected,双写者未消除。已由后续轮次收口:CLI / LSP agent 面的根侧车单写者(finalContent+baseContent+skipWrite+directSections)见 cat-11 changeset;LSP add 面新建段并溯源行常用的directCreatedSections见 cat-14 changeset(本文件同属@nudojs/service的发射面)。 - BUG-035 —— 排除无断言
@nudo:case见证会改变契约产物;5 个既有 emit 测试钉住「指令用例 → 字面量契约」,属产品决策。 - BUG-168/189/190 —— 需把
DtsModuleSurface贯穿computeMainSignature/tsParamAnnotation,并改造dtsExportNameOf的返回形状(跨切面)。 - BUG-055/068/074/076/081/093/094/109/119/135/151/197 —— 未开始;其中 BUG-074 的扁平
export default function形态被core-bug-435、emit-bug-514、export-dts-evidence钉住。
追加:观测拓宽改为「点域」判据(BUG-021 的收口)
初版
projectFunctionDsl()对每个 callsite case 无条件拓宽再 join ⇒ 多值 观测域也被塌成number()(area(1); area(-2)写不出union(lit(1), lit(-2))), 与 drift 对账面(core/src/algebra/check-interface-drift.ts)的域判据分叉 ⇒--emit之后 health 恒报漂移(BUG-199)。现改为先 join 后判点:
isPointConstraint(core,与 drift 共用)为真才拓宽, 多值观测域保留字面量并集;带断言的@nudo:case仍一律不拓宽。widenObservationAbs随之移入 core(@nudojs/core/internal),service 内不再保留副本。追加:本轮发射面修复(13 条)
- BUG-168:dts 不再抄不可解析的类型名(
id(x: any)/pair(a: any, b: any));可解析的 本地类补declare class、导入名补import type、class Box<T>保留形参槽。 - BUG-189:一个绑定挂多个导出名全部落地(
export declare function foo+export { foo as default },类同理)。 - BUG-190:
export declare const/let/enum(含成员与字面量初始化器);无绑定值留nudo:unresolved-value台账,TS2305 归零。 - BUG-151:
class B extends A、未导出基类补declare class、实例字段(this.x=…/ 类属性)落地、继承字段不重复。 - BUG-108 / BUG-109:入参面可选性 = 契约级 ∪ 声明级默认值;rest 槽恒可选且只有
一层数组(zod
.optional()、dts...rest: any[])。 - BUG-069:见证等价改按「文件 + 实参载荷」复合键 ⇒ 二次
--freeze输出freeze: no changes.、文件字节不变。 - BUG-081:冲突面带
conflict/undecidable、行尾[unsatisfiable: n]、stderr 同码 error、--json同名字段、exit 1;nudo:interface-undecidable保持 warning(能力边界)。 - BUG-068:nullish 回填在同一次改写里补齐 TS 侧车 builder import(含
nullable as nb别名;JS 侧车不加)。注:缺陷正文里「interface-draft.tsBUILDERS 缺nullable」是过期信息。 - BUG-198:已申报的
@nudo:throws/eff.throws原样进草稿 DSL;仅门禁算出的「可能抛」 写成草稿头可照抄提示(不把「可能抛」变成草稿义务)。
追加:BUG-055 / BUG-119 已修,BUG-197 阻塞点已定位到行
- BUG-055(
--freeze把违约见证搬进被调方):insertGeneratedCaseDirectives()原先只筛 「可序列化 + 非手写」,从不与被写方自己的有效契约比对 ⇒ 调用方的违约被搬进被调方,随后由check-case-scan对着被调方报 error 级nudo:case-inconsistency。修:新增contractGuardOf()/witnessViolation()(emit/case-emitter.ts),读effectiveInterface(...)且只执法source === "handwritten"(与 §3.3 同档);契约位→实参位 映射与调用点面同规则(paramNames.indexOf→locateContractParam);判据与check-case-scan.ts的标量通道同口径(eq/union 走literalMeetsConstraint;纯 bounds 先isIntFlag再按实例化后 pred 逐原子判;optional 的or包裹不执法);不可判 ⇒ 放行 (非字面量、结构/数组/函数域)。违约见证不写入,skip 记新原因contract-violation,归因留在 调用现场nudo:interface-domain-exceeds。宿主接线(filePath/loadModule/autoBind/projectDir)由shared.ts的emitWiringOf()供给,与contractOf/checkSource同源。 回归:service-bug-055-freeze-contract-guard.test.ts、cli-bug-055-freeze-contract-guard.test.ts。 - BUG-119(
--freeze=update静默删除活着的见证):update 链「剥离 → 重算 → 回写」的两层 缺陷:①stripGeneratedCaseDirectives无条件剥离call@;② 回写沿用 add 模式的函数级 「有手写 case ⇒ 整函数跳过」⇒ 跨文件见证无法从当前证据重算时(无契约时分析器不合成跨文件 case)就是净删除且不可恢复,汇总只数「新写出」⇒ 谎报「0 directive(s)」。修:块级守门 (含手写 case 的 JSDoc 块不剥离生成态见证,往返闭合)+InsertCaseOptions.rebuildGenerated(重建阶段按见证身份逐条重建,手写 case 只挡同名,载荷等价只判生成态之间)+reemitUpdate返回removedWitnesses(netRemovedWitnesses按身份配对,行号漂移不算删除), CLI 汇总印(N directive(s) …, K removed)与逐条- call@…。 回归:service-bug-119-freeze-update-rebuild.test.ts、cli-bug-119-freeze-update-keeps-live-witness.test.ts。 - BUG-135 已修:实际改动在 LSP 侧(
a6-relax.ts/server-code-actions.ts),见 cat-14 changeset(relax 改「真写推断面」+ 落盘后验证门;CLI 文案在行为修好后为真,未改口径)。
仍未修 / 阻塞(根因在禁改文件或需产品裁决):
- BUG-035:
projectFunctionDsl()把@nudo:case调试见证投影成契约;emit 测试目录里 5 处 pin 了当前行为,改口径必须重钉 ⇒ 需产品裁决。 - BUG-197 已修:见 cat-02 changeset ——
arityFace接受契约可选位,本地与跨文件共用contractOptionalIndexes映射(位次与interfaceToIndexed同一套,只对handwritten生效),nudo:arg-count不再对契约.optional()的省略实参报红,且不会出现「同文件绿 / 跨文件红」。 - BUG-076:
any是既定口径(docs/concepts/abs.md、CLAUDE.md),真问题是文档表述 (docs/**本轮未改)。
追加:6 处 schema 期望按 BUG-093 重钉(不是放宽)
BUG-093 的声明正确行为 = 数值谓词面必须接受
±Infinity(schema-generator.ts:704-705「satisfies(Infinity)⇒.or(z.literal(Infinity))」,-Infinity同理),否则导出的 zod schema 会拒绝 Abs 域里合法的值。schema-generator.test.ts(5 处)与schema-bound-anchor.test.ts(1 处)钉的是加臂之前的字符串:gt(0)/gte(0)→….or(z.literal(Infinity))(含对象槽内与默认 dialect / module 面)lte(100)/lt(5)→….or(z.literal(-Infinity))
行为断言(
WIDE_NUMBER的 NaN/±Infinity 三臂、int().gte(0)等)原样保留。BUG-035:
@nudo:case的调试见证不再被写成契约(nudo contract --emit)根因:
packages/service/src/emit/interface-emitter.ts的projectFunctionDsl()把source === "directive"的指令 case 与source === "callsite"的调用点证据平权 当域来源 / 返回义务来源 ⇒ 纯点观测见证被投影成契约(fn({ x: lit(5) }, lit(6))), 与nudo check的f(x: any) => number | string自相矛盾:用户为调试加一条@nudo:case就把函数固化成「只接受那个点、只返回那个值」。修法:指令来源内部再分档(新增
emit/domain-cases.ts的isDomainDeclarationCase()/isPointObservationArgs(),判据与 analyzer 侧isPointObservationArgs同源)——- 域声明:实参是约束构建器(
number()/shape()/union()… 的域形状)或 带断言(=> expected)⇒ 可作域来源与返回义务来源; - 纯点观测见证(实参全是字面量且无断言)⇒ 不生成域、不生成返回义务。
口径变化:
directive纯见证不再产出契约(改前:fn({ x: lit(5) }, lit(6)); 改后:无证据 ⇒skipped … (not-projectable),不写侧车)。callsite优先、 BUG-021 观测拓宽、域形状number()的not-projectable口径均不变;domainEvidenceCases()(dts / zod / standard / guard 面)语义不变。重钉清单(原断言钉住「指令用例 → 字面量契约」的错误行为;夹具改为带断言的域声明, 断言文本未动):
emit-bug-523-section-order.test.ts(2 处)、emit-bug-532-value-template-clash.test.ts(1 处)、emit-bug-540-crlf-byte-fidelity.test.ts(1 处)、emit-bug-548-import-name-clash.test.ts(1 处)。 新增回归:emit/__tests__/emit-bug-035-case-witness-not-contract.test.ts(三种 case 形态 + 「有调用点证据时见证不得污染返回义务」+ 分档判据)。残留边界:既有侧车里由见证生成的旧生成段,在 update 模式下按「证据消失 ⇒ 删除该生成段」 处理(见下文「BUG-035 残留收口」);宽域 /
derived-from:段 /@nudo:skip段仍按原策略保留。contract --draft面本就不投影见证的返回义务(projected: false),无需改动。BUG-076:
nudo export --format dts的「无证据参数」口径统一为any(文档侧修正 + 回归锁定)判定:
BUG-076的 section 结论 —— 代码侧「未取证参数渲染any」是有意为之的产品口径 (docs/concepts/abs.md:入口无约束 =any,不因缺证据改用unknown),真正错的是仍在承诺 「unknown+ stderr 点名提示」的两处文档。故本条按文档侧收口,零行为变更。改动:
docs/design/cli-semantics.md§2「已记录例外(export 投影面)」改为any口径,并说明只有 真正推导失败才出现unknown(由nudo:unknown-inference之类引擎债诊断标注)。packages/website/docs/guides/export-ecosystem.md:114/185与 zh-Hans 镜像同步改为any, 删除「export --format dts会打 stderr 提示」的承诺。- 新增
cli-bug-076-unevidenced-any.test.ts(3 例):主路径无证据形参 ⇒any且 stderr 无提示; 契约只覆盖部分形参 ⇒ 未覆盖位仍any;窄路径(@nudo:skip+ 手写契约未覆盖位)⇒unknown+note: <fn>.<param> rendered as unknown …(两条路径都实测可达 ⇒reportUnevidencedParams不是死代码,只是只在窄路径出现)。 helpers/run-cli.ts新增writeSrcTsconfig():CLI 子进程按 cwd 找 tsconfig,否则会落到共享dist/旧构建(测试钉源码语义的前提)。
重钉:BUG-021(调用点点观测拓宽)
调用点点观测不再直接成为字面量契约 —— 先
widenObservationAbs再joinThenProject⇒ 一次alpha({ x: 5 })折出shape({ x: number() })、返回5折出number()。据此重钉:packages/nudojs/src/__tests__/cli-bug-657-emit-fn-unmatched.test.ts「对照组:名字正确 ⇒ 只改那一个」的断言由toContain("+export const alpha = fn({ p: shape({ x: lit(5) }) }, lit(5));")改为toContain("+export const alpha = fn({ p: shape({ x: number() }) }, number());")。 「只改 alpha、beta 不出现-/+」与同文件「全部未命中 ⇒ 用法错误 + 侧车逐字不变」 「连 dry-run 预览都不给」「部分命中 ⇒skipped nope (not-an-export)」三组断言未改动。
BUG-035 残留收口:证据消失 ⇒ 旧生成段被删(不再「保留原段」)
根因:
emitInterface的 update 分支把「不可投影」一律当成「今天没有证据 ⇒ 把落盘的段原样保留」。 BUG-035 之后@nudo:case见证不再进契约 ⇒ 由见证写出的旧段(fn({ x: lit(5) }, lit(6)))却因此 永久留在侧车里,与nudo check的结论(f(x: any) => number | string)长期矛盾。修法(
packages/service/src/emit/section-provenance.ts新增,interface-emitter.ts接线): 落盘的@generated段在两个条件同时成立时被删除 —— ① 当前投影确实无证据(无调用点、无域声明 case、无 entry 推断、且非@nudo:skip; 「有证据但表达不出来」不算无证据 ⇒ 保留); ② 该段的证据可证明来自本文件(无// derived-from:标签,且某个顶层槽钉住了单个字面量 —— 今天的发射器会把调用点点观测拓宽(BUG-021),故单字面量域只可能来自本文件的域声明 /entry@)。 删除沿用既有「死段」路径(整段 + 尾随换行),填充EmitInterfaceResult.removed, 发一条 infonudo:interface-not-projectable(「evidence disappeared — dropping its generated section…」), 人类面formatEmitSummary增一行removed: <names>,机器面(nudo contract --emit --json) 增removed字段。重钉:无(既有断言一条未动;
interface-emitter.test.ts的「update 无证据保留原段」用例 其段是宽域 ⇒ 不满足「可证明来自本文件」⇒ 原样通过)。残留:① 宽域且来自本文件调用点的段,调用点消失后仍保留 —— 已收口(见下 「BUG-035 证据范围收口」:生成段记
// evidence: local|external,宽域段也能判定); ② BUG-021 之前的旧侧车,点字面量--from段与见证段不可区分,可能被删 (--dry-run可先预览);③ 只看顶层槽 ⇒shape({ x: lit(1) })形态的旧段保守保留 (现格式下由// evidence:判定,不再受此限);④ 带// derived-from:标签的段保留。追加:BUG-035 证据范围收口 —— 生成段记录
// evidence:,宽域段也能判定刷新症状(上一轮收口后仍留的最后一条边界):删除陈旧段的判据只能「证明」单点字面量域的 证据在文件内(今天的发射模型把调用点观测拓宽,单点字面量只可能来自文件内 case/entry)。 调用点来源的宽域段(
fn({ x: number() }, number()))与「--from采集的使用现场记录来源段」 逐字同形 ⇒ 调用点被删后宽域段只能保守留存(侧车继续承诺今天已不存在的域,与nudo check签名面矛盾);反过来盲删又会丢掉--from段的用户契约。修法(侧车格式变更):
FunctionAnalysis.externalEvidence(analyzer-orchestrate-uncached.ts的合成路径):本函数的 callsite 证据是否混入--from外部记录。判据取去重前的匹配集 ⇒ 保守方向永远是「少删」; 该字段是纯增量(cloneFunctionAnalysis走浅展开,缓存回放不丢)。- 生成段由三行变四行:
@generated/// source:/// evidence: local|external/ export (interface-emitter.ts的sectionText;roundTrip自检同文本,故自检与写盘同源)。 section-provenance.ts:新增sectionEvidenceScope();sectionEvidenceIsInFile()改为 「无derived-from标签 且(local标记 或 旧侧车无标记时的单点字面量启发式)」。 ⇒local宽域段在「今天没有证据」时可证「证据没了」⇒ 删段;external段与旧侧车宽域段 继续保留。旧侧车(无// evidence:行)行为完全不变;旧段在因内容变化被重写时自动带上标记。- 标记是确定性函数(证据范围只取决于本轮是否用了外部记录)⇒ 二次发射逐字节相同。
重钉(2 处,均为「当轮格式」更新,断言文本一条未动):
service/src/emit/__tests__/emit-bug-523-section-order.test.ts的SIDECAR夹具 (注释即「首次 emit 生成的形态」)补// evidence: local—— 该文件钉的是段序不重排 / 无改动,不是段的行数。lsp/src/__tests__/lsp-bug-196-single-writer-sidecar.test.ts的SIDECAR_CONVERGED补// evidence: local—— 该文件钉的是 add/update 逐字节收敛,格式变更后收敛态随之更新。
新回归:
emit/__tests__/emit-bug-035-evidence-scope.test.ts(7 例)—— ① 宽域local段 在调用点消失后被删(+removed台账 + info 诊断);②--from外部记录来源段带external标记、证据缺失时留存且逐字节不变;③ 旧侧车宽域段留存(迁移期零回归);④ 旧侧车单点字面量段 仍按旧启发式删除;⑤derived-from段即使带local标记也留存;⑥ 标记确定性/幂等; ⑦ 本地与外部记录混合 ⇒external(保守方向)。文档:
packages/website/docs/guides/contract.md与 zh-Hans 镜像的侧车示例与 dry-run diff 示例补// evidence: local(该行是两版之间的上下文行,hunk 头不变)。 - BUG-214 — 仅当全部用例都是
-
250f0ba: Fix bug-report category 09 (
nudo checkgate) — 10 of 15 defects.- BUG-046: a variadic flag no longer silently consumes the following path; a value the
flag cannot accept that exists on disk is reported as a usage error, so
check clean.js --only <code> broken.jsno longer exits 0 withbroken.jsunchecked. - BUG-047:
check --fixadvances its plan text outside the--writebranch, so a second hunk is@@ -1,2 +1,3 @@instead of a conflicting@@ -0,0 +1,2 @@, and dry-run output matches--write. - BUG-048:
--onlyvalues are validated against the diagnostic registry (unknown codes are a usage error; valid-but-unmatched codes are reported) instead of silently producing0 edits. - BUG-049: a sidecar write failure is reported (
check --fix cannot write <path>) instead of aborting the whole run with a bareEACCES. - BUG-066:
--quietis evaluated before--abs, so--abs --quietprints one line instead of the full signature block. - BUG-067:
--fixrefuses to write a sidecar that would conflict with a sibling file (.js/.mjs,.ts/.mts) and names the sibling. - BUG-115: the
--jsonenvelope gains an unambiguoussummary.pathErrors, so path failures are readable from the summary (the green shape is unchanged). - BUG-264:
sidecarPathOfstrips.dafter.nudo, so a.d.tssource yieldsapi.nudo.ts(and a.nudo.draft.ts-style draft) instead of a.d.name that TypeScript treats as a declaration file. - BUG-284: hard errors (input read failures / syntax errors) feed both CI channels, so
--gitlabalways emits exactly one parseable array and--ghaemits::error. - BUG-285: GHA annotations move to stderr when GitLab owns stdout, so
--gha --gitlabemits its::errorlines instead of dropping them.
Regression tests:
cli-bug-046-*,cli-bug-047-*,cli-bug-048-*,cli-bug-049-*,cli-bug-066-*,cli-bug-067-*,cli-bug-115-*,cli-bug-284-*,cli-bug-285-*,core-bug-264-sidecar-dts-name.Known follow-ups NOT covered here: BUG-014 (needs
commands/test.ts), BUG-015 / BUG-114 (needmigrate.ts, handed to the migrate category), BUG-262 (needspackages/lsp/src/validation.ts), BUG-056 (needs per-round module isolation;checkstill printsbump() => 2).BUG-056 诊断追加(未修复,定位已收窄)
同文件在同一进程被求值两轮时,闸门读到被上一轮写脏的结果(
bump() => 2,原生1; 连带main() => 11、once() => 1、nudo:interface-drift把干净侧车判成陈旧)。已排除(逐一实测,均无效):
- service
evictAbsModuleCacheFiles/evictEvalCacheForFiles:驱逐前后getAbsModuleCacheSize()都是0、getEvalCacheSize()由1归0,闸门仍是2; - core
evictGeneralizeMemoForPaths:仍是2; - core
resetNudoModuleExecCache(侧车模块执行表):仍是2。
已定位的方向:
checkSource的整文件 memo(packages/core/src/algebra/check-memo.ts)。 探针(同一进程内先跑分析器再跑闸门)在每次checkSource前resetCheckSourceMemo()后结果稳定为1(不重置则2,且第二次调用仍2)⇒ 陈旧CheckReport被跨轮复用, 不是模块实例泄漏。收口方向 = 在 CLI 轮边界按路径驱逐evictCheckSourceMemoForPaths([filePath])(该 API 已从@nudojs/core导出,无需动 public-api 快照);未落地的原因是上述探针全部跑在修复前的dist/上(@nudojs/*经 packageexports解析到dist),需要在源码构建上复核后再改 —— 否则无法区分 「memo 陈旧」与「模块实例脏」两种成因。追加:BUG-056 已修(根因与落法)
根因(实测确认,不是推测):
packages/core/src/algebra/generalize.ts与check-may-throw.ts各有一张evalRunMemo,缓存的是活的 run 表——模块级let状态 和对象身份都住在里面;键只有 source(+ mock scope + inject 指纹),没有路径、 没有轮次。后果:- 分析器一轮 generalize 与闸门一轮共用同一实例 ⇒
bump() => 2/main() => 11/once() => 1(同一文件在同一进程里被读作 1 / 2 / 3,字节相同的两个不同文件也共用); contract --emit写分析器的干净值、check打印被污染的值 ⇒nudo:interface-drift永不收敛(health 永久假红,重跑--emit无法自愈)。
落法:引入单调求值轮次(
collector-scope.ts),最外层runWithCollectorScope创建 作用域时涨轮;两张 run 表的键都带轮次前缀 ⇒ 跨轮不复用活状态;不做整表作废(整表 作废会让轮内的对象身份变化,递归泛化的 term 指纹随之坍缩成unknown);resetGeneralizeMemo同时清 run 表。已排除的无效方案(逐条实测):serviceevictAbsModuleCacheFiles/evictEvalCacheForFiles、coreevictGeneralizeMemoForPaths、resetNudoModuleExecCache、 按路径驱逐checkSource报告 memo —— 全部无法触及这两张表。回归:
core-bug-056-eval-round-identity.test.ts(3 例:分析器轮之后闸门仍读 1、字节相同的 第二个文件各自读 1、同一文件重复分析每次读 1);CLI 侧cli-bug-056-check-single-eval.test.ts钉住bump() => 1、once() => never throws Error、无nudo:interface-drift。追加:BUG-085 已修(
--abs观测面吃@nudo:assume前提)根因不在 core 的假定折叠,而在 CLI 观测面没喂前提:
nudojs/src/commands/shared.ts:: runAbsView直接tryEvalCall(...),@nudo:assume d <= max从未进入求值。落法(关键点:喂前提槽,不是
phi):每个待观测函数先从extractAssumeSegs(source, fnName)取ok段,折成ale(v(lhs), v(rhs))后withAssumePremises(phi, () => tryEvalCall(...))。div的关系折叠只读assumePremiseList(assume)(core/algebra/arithmetic/muldiv.ts:141),而前提槽在调用边界 会被清空;折进phi会既拿不到谓词、又把前提泄漏给被调方(不健全)。回归:
nudojs/src/__tests__/cli-bug-085-abs-assume-premises.test.ts(3 例)——check --abs打印pred: /(d, max) ≤ 1(此前缺失而--json已给出where,两面不一致)、 无 assume 行的对照两面都无谓词、nudo test --abs同源同结论。追加:CLI fail-closed 判据改为「可见性」,诊断按标签分两条通道
packages/nudojs/src/commands/check.ts:per-file collector 由「只收internal」改为 「internal或gateFatal === true」(plain check 与--fix两处采集点同口径), 并把诊断拆成两条:internal(引擎 / 宿主边界违约)⇒nudo:internal+ 「报引擎 bug」文案(既有);- 装载期逃逸的用户代码异常(标签
module-throw且gateFatal === true)⇒nudo:module-throw+ 指向用户代码的文案(BUG-073:不得让用户去报引擎 bug)。
这补上 BUG-072 在 CLI 侧的最后一个缺口:无句法证据的装载失败(模块顶层
JSON.parse(userInput)、顶层调用会抛的导入函数)此前零诊断 + exit 0(假绿),现在按gateFatal判红。unsupported:*(能力边界)与建模内NudoThrow的gateFatal === false⇒ 仍不入闸门(假红防线不变,1145 的 unsupported 用例守反向)。重钉:BUG-264 带来的落点改名(
.d.ts源的草稿名不再含.d.)BUG-264 修了「
.d.ts源的侧车 / 草稿名含.d.⇒ TypeScript 判成声明文件 ⇒ TS1254」, 把落点从api.d.nugo.draft.ts/api.d.nugo.ts改成api.nugo.draft.ts/api.nugo.ts。 该修复落地时只更新了 core 侧自己的钉,漏了 3 个 nudojs 侧的旧断言 ⇒ 它们的期望仍写着旧拼写。按 BUG-264 的权威规格重钉(保留旧拼写等于把 BUG-264 重新引回来):
cli-bug-659-from-dts-usage-order.test.ts:types.d.nudo.draft.ts→types.nugo.draft.ts(「CWD 里的同名草稿不存在」那条断言未动)。cli-bug-944-from-dts-write-path.test.ts(3 处):落点、next提示里的侧车名、拒绝覆盖提示里的路径 全部改成types/index.nugo.draft.ts/types/index.nugo.ts(CWD 无同名草稿、既有草稿逐字不变 等行为断言未动)。nudojs-bug-1147-contract-cli-text.test.ts(3 处):共享的draftPathOf辅助函数改成新落点 (拒绝提示双口子 / 人工改过永不被覆盖 /--force覆盖成功三条的语义断言未动)。
新增
cli-bug-944-from-dts-draft-invariants.test.ts(7 例):钉规则而不是拼写 —— 落点贴着源.d.ts且 basename 不含.d.、「next」侧车名不含.d.(旧名不得出现)、目标已存在 ⇒ 拒绝覆盖 (exit 1 +--force与NUDO_DRAFT_FORCE双口子 + 提示含hand-edited+ 既有草稿逐字不变 + 不谎报wrote)、内容未变 ⇒ 不拒绝、--force与NUDO_DRAFT_FORCE各自可覆盖机器原稿、 人工改过的草稿--force也不放行。零源码改动:实现的落点、拒绝、双口子与「人工改过不覆盖」规则本就符合 944/1147 的规格 (逐条手测复核过),只有断言的拼写过时。
残留:①
--from-dts --write在没有package.json祖先目录时无项目根守卫, 而--draft --write在同场景要求NUDO_DRAFT_FORCE=1—— 944/1147 夹具(无package.json)钉住 前者成功 ⇒ 对齐会与被钉住的行为冲突,故未动; ②--from-dts --write --dry-run在既有草稿不同时拒绝(exit 1)而非给 diff 预览, 与--draft --write --dry-run不一致(未动)。 - BUG-046: a variadic flag no longer silently consumes the following path; a value the
flag cannot accept that exists on disk is reported as a usage error, so
-
6fe6452: Fix bug-report category 10 (
nudo test/nudo health/nudo init) — 10 of 11 defects.- BUG-018:
nudo test --freeze <path>treats the value as a path unless it is a known mode, so a path is no longer swallowed withUsage error: needs at least one path. - BUG-036: witness identity keeps the call-site prefix, so deleting one of two call sites
is reported as drift instead of
0 case drift / OK / exit 0. - BUG-037: a never-frozen file no longer reports case drift (
frozenWitnesses > 0is required before comparing). - BUG-038: a missing path now lands in
pathErrors/targetErrorswithsummary.errors= 1 instead of being silently skipped. - BUG-039: contract drift counts
@generatedslots (ΣinterfaceDrift) instead of files, so detail, summary and--jsonagree. - BUG-054: health honours
--from(sameexternalAbsCallRecordssource ascheck), so drift is no longer invisible when--fromis used. - BUG-113:
health --jsonemits a JSON error envelope on a usage error instead of printing 0 bytes. - BUG-199: health's drift criterion now includes whole-section text drift
(
emitInterface(mode: "update", dryRun: true)), sohealthandcontract --emit --exit-on-diffagree on the same sidecar. - BUG-228: file-level
@nudo:envis resolved with the two-baseDir layering thatcheckuses, socheck'snudo:interface-driftand health's "0 contract drift" no longer contradict each other. - BUG-229:
nudo initrewrites the effective (last)"nudo"member and removes earlier duplicates, so the reported baseline is the one the loader actually reads.
Regression tests:
cli-bug-018-*,cli-bug-036-*,cli-bug-037-*,cli-bug-038-*,cli-bug-039-*,cli-bug-054-*,cli-bug-113-*,cli-bug-199-*,cli-bug-228-*,cli-bug-229-*.Known follow-up NOT covered here: BUG-136 (CLI
nudo testwitness line and the LSPagent-tools.tsobservationTitledisagree on indentation/spacing) needspackages/lsp/src/agent-tools.ts, which is outside this category's file set; aligningrun-test.ts#formatCaseLinealone would breaktest-entry-contract-note.test.ts. - BUG-018:
-
d5b189d: Fix bug-report category 11 (
nudo contractcommand layer).- BUG-042:
contract --draft --fn <name>for a non-existent export is no longer a silent no-op (exit 0 with an empty draft); it now mirrors--emitand exits 1 with a usage error listing the available exports. - BUG-100:
contract --from-dtsno longer silently swallows--emit/--fn/--all/--dry-run/--exit-on-diff; the flags are honoured, so the drift gate is no longer permanently green. - BUG-122:
contract --emit's derived branch and main branch no longer write the same sidecar with divergent formats, so--dry-rundiffs match what is actually written and--exit-on-diffno longer exits 1 forever.
Regression tests:
cli-bug-042-*,cli-bug-100-*,cli-bug-122-*.BUG-196:
nudo contract --emit的根侧车改为单写者 + 同源判定根因:
emitDerivedFromRoot(...)(派生分支,段文本 4 行含// derived-from:)与emitInterface(...)(直写分支,段文本 3 行)在同一次运行里写同一个侧车的同一段;后写的直写 分支把溯源行整段抹掉 ⇒ 净变化为零却报Updated;而 dry-run 比对按「未抹掉的版本」算 ⇒ 预览 要求加那行、真实写盘从不产生 ⇒--exit-on-diff恒 exit 1(漂移门禁永不收敛)。修法(先让「最终文本」成为结构上的事实,再让判定 / 预览 / 落盘都用它):
interface-emitter.ts:EmitInterfaceResult增finalContent(含 BOM,与真实落盘逐字节相同) —— 调用方不再需要从diff反解自身产物(CLI 里原先的applyUnifiedDiff已删除,约 110 行)。- 直写分支一律
dryRun: true(只算,不写);派生分支以直写分支的finalContent为baseContent,对直写分支负责的段(directSections)只并// derived-from:标签行、 不整段覆盖;根侧车由 CLI 一次原子写入(派生分支skipWrite)。 changed/Updated/ dry-run 预览 / 落盘全部用同一份最终文本(逐字比较)⇒ 幂等。
口径变化(重钉):
cli-bug-122-emit-net-effect.test.ts原先钉的是缺陷行为(首跑侧车不含// derived-from:、干净夹具 dry-run exit 0),现按 section 改为:首跑落盘含溯源行、内容真变才报Updated、干净夹具首跑 dry-run 正确报漂移(exit 1)而真写一次后 exit 0。残留:LSP agent 面(
packages/lsp/src/agent-tools.ts)的旧「派生 → 直写」双路顺序已收口 (见下文「BUG-196 残留收口」)。packages/service/dist需pnpm run build后才有新语义 (writeSrcTsconfig的测试钉源码)。BUG-196 残留收口:LSP agent 面改单写者(同源组合,CLI 口径一致)
上一节记录的残留(LSP agent 面仍是「派生 → 直写」双路顺序)已收口,改动全部在
packages/lsp/src/**。根因:
packages/lsp/src/agent-tools.ts的serializedEmit()沿用旧顺序 —— 先emitDerivedFromRoot(写盘,派生段 4 行含// derived-from:),后emitInterface(重写同一段,3 行、无溯源行)⇒ 溯源行被抹掉、净变化为零却报Updated;预览与真实写盘相反。修法(与 CLI
runContractEmit同构):直写分支恒dryRun: true,其finalContent作合并基底; 派生分支以它为baseContent、skipWrite: [根侧车]、directSections: 直写分支负责的段⇒ 只把// derived-from:标签行并进直写段(正文以直写为准),下游侧车仍由派生分支拥有; 根侧车文本 M = 派生结果 ?? 直写结果(BOM 守卫)⇒ 一次原子写(tmp + rename);changed/written/diff全部由 M 与写前字节比较得出(直写written∪ 根侧车派生的writtenNames), 根侧车的派生条目不再重复报「Updated」。重钉:无。新增回归
lsp-bug-196-single-writer-sidecar.test.ts(4 例):update 模式保留直写正文 + 保留// derived-from: lib.js:tag+ 收敛后内容逐字节一致 + 只写一次(统计renameSync次数); 第二跑无写盘、无「Updated」;dry-run 预览与真实写盘逐字相同;add 模式保留直写正文且只写一次。残留(已收口):LSP add 模式下,service 的「既有段不可动」规则使
// derived-from:标签并不进 本轮刚追加的段 —— 基底(= 直写分支产物)里已经有该段,派生分支把它当成「既有段」跳过。 现由emitDerivedFromRoot的directCreatedSections判据区分「本轮直写分支新建」与「此前既有」 (详见 cat-14 changeset「BUG-196(add 面)」):add 面只对本轮新建且直写负责的段就地并入溯源行, 既有段仍原样不动(不强制 update ⇒ 不会顺带刷新下游侧车的既有派生段);收敛后 add 与 update 写出的 根侧车逐字节相同。 - BUG-042:
-
8a22296: Fix bug-report category 12 (
nudo export) — 11 defects.- BUG-016: the module identity used by
--outis path-free (package-relative path, or<stem>|<export names>outside a package root), so exporting the same module from two directories produces one byte-identical artifact instead of accumulating contradictory stale copies. - BUG-026 / BUG-279: an
entry@witness contributes its element to a rest parameter, so the published type is one array rather than an array of arrays. - BUG-028: the
--format allstdout flattener pre-reserves the dts segment's (user API) identifiers, so user exports keep their names and the flattened dts matches--out. - BUG-033: a barrel module's dts surface is assembled before the early return, so re-exports are no longer dropped when the module has no functions.
- BUG-044:
nudo exportpublishes withcaseMode: "none", i.e. the same domain as thecheck/health/migrategate, instead of leaking@nudo:casedebug witnesses into the shipped dts/schema. - BUG-075: the stdout flattener registers all top-level identifiers (exports, locals,
import bindings), so the flattened output passes
tsc --strict. - BUG-120 / BUG-121: object-destructured parameters collapse to one slot keyed by the
formal name, and the constraint-disproof
fieldsbranch handlessumshapes symmetrically withprim. - BUG-204: identifier renaming in the stdout flattener is lexer-aware (skips strings, templates, comments, property keys and object keys), so slot-key data is no longer rewritten.
- BUG-231: the unique-name fallback in
--outhonoursisSameModule, so re-exporting the same module overwrites in place rather than writing a.2copy that diverges.
Regression tests:
cli-bug-016-*,cli-bug-026-*,cli-bug-028-*,cli-bug-033-*,cli-bug-044-*,cli-bug-075-*,cli-bug-120-*,cli-bug-121-*,cli-bug-204-*,cli-bug-231-*,cli-bug-279-*.Known follow-up: BUG-044's contract print face still consumes
packages/service/src/emit/interface-surface.tswith the defaultcaseMode: "all", sonudo contract's printed interface can still include@nudo:casewitnesses. The export products (dts/schema/guard) are now gate-consistent.追加:两处既有期望按 BUG-109 重钉(不是放宽)
BUG-109 声明正确行为 = rest 槽恒可选且只有一层数组,而两个既有用例钉的是修复前 的「必填」形状,与之相反 ⇒ 按声明正确行为重钉 expected 子串,行为断言原样保留 (一层数组、
not.toContain("z.array(z.array(")、错误形状仍被拒):cli-bug-026-rest-param-single-array.test.ts:standard 面槽 →{"key":"rest","node":{"k":"arr","element":{"k":"unknown"}},"optional":true}。cli-bug-279-rest-entry-witness-slot.test.ts:zod →z.object({ args: z.array(z.unknown()).optional() });standard 槽带"optional":true。
重钉:BUG-044(
@nudo:case见证不进发布面)+ 文档口径修正@nudo:case是调试见证、不是契约产品 ⇒nudo export以caseMode: "none"调分析器, 发布面(dts / schema / guard / standard)不消费见证。据此:docs/design/cli-semantics.md§2 的「已记录例外(export 投影面)」把签名数据源写清: 契约 / 调用点证据 /entry@兜底,并明写「@nudo:case调试见证不进导出面」。packages/website/docs/guides/export-ecosystem.md:114/185与 zh-Hans 镜像同步: 删除「@nudo:case见证喂导出签名」的表述,改为「nudo export与门禁一样以caseMode: "none"分析;见证不进发布面」。- 重钉 3 处旧断言(原断言钉住「见证拓宽形参 / 产出
Case:行 / 进Output校验器」):export-dts-evidence.test.ts:用例改名「调试见证不进导出面(BUG-044)」;toContain("export declare function greet3(u: { name: string }): string;")+toContain('Case: named …')⇒toContain("export declare function greet3(u: any): any;")+not.toContain("Case:")。cli-bug-619-skip-multi-witness-output.test.ts:zod 面toContain("twiceOutput")+toContain("z.literal(4)/6")⇒toContain("twiceInput")+not.toContain("twiceOutput")+not.toContain("z.literal(4)")+not.toContain("z.literal(6)");standard 面toContain("twiceOutput")⇒toContain("twiceInput")+not.toContain("twiceOutput")。 只带 case、无契约的 skip 函数发布面无Output校验器(域证据为空 ⇒ 返回面无种子)是 该口径的结果而非缺陷;「函数仍出现在产物里 + exit 0」仍被钉住。
- 附带(BUG-189 形态统一):
export-dts-evidence的「export default 函数进导出面」由toContain("export default function makeGreeting")改为toContain("makeGreeting")+toContain("as default");not.toContain("export declare function makeGreeting")(Bug 515:局部名不得成为具名导出)保留。
- BUG-016: the module identity used by
-
d4ab7fb: Fix bug-report category 13 (
nudo migratestatus / strip / verify / retire) — 20 of 21 bugs, plus two defects that were filed under other categories but live inmigrate.ts.- BUG-234:
migrate striprewrites an enum's computed member references toE["KEY"](reference-position aware) instead of leaving the initializer verbatim, so the stripped product no longer throws ReferenceError; string-valued computed members skip the reverse mapping like tsc. AenumComputedMemberRewrittenreport flag records the rewrite. - BUG-050:
striprefuses to write when a TS-only construct survives the stripper (namespace,import x = require(...)) instead of writing a.jsthat failsnode --check/nudo checkwith exit 0. - BUG-226:
migrate verify's env merge usesmergeHarvestUnderEnv(thecheckpath), so harvest-only exports are no longer dropped ⇒verifyno longer reportsunknownwherecheckreports a precise type. - BUG-064:
migrate verifyresolves project-level env against the project root and file-level env against the file's directory, and surfaces env load errors asnudo:env-unresolved. - BUG-061:
migrate verifyinstalls the eval-fallback collector, so an internal analysis failure is an error-levelnudo:internal(same code/severity ascheck). - BUG-114:
migrate verifyruns the strict, extension-aware parse first, so TS-only syntax inside a.jsfile is a per-filesyntax-errorinstead ofverifysayingnudoOk: true. - BUG-015:
migrate'signoreThrowsuses the same lenient parser ascheck. - BUG-051 / BUG-052 / BUG-103 / BUG-117 / BUG-118: retire batch semantics — a mixed batch
retries the work-bearing targets and reports the skipped ones;
retire --allsharesretireScopewith the single-target path; a leftovermigrate-retiring.jsonis recovered; a repeat run reportsalready retiredwith a zero delta (the ledger no longer leaks into this run's result); a multi-root failure reports every bad root. - BUG-053 / BUG-112 / BUG-179: JSON/human faces — dry-run results carry
dryRun; an unknown action emits a JSON error envelope instead of empty stdout; the human face prints only this run's deltas. - BUG-062 / BUG-063 / BUG-065 / BUG-102 / BUG-116: retire/status plumbing — the gate
script test is command-text based and reports the real
from; the workflow dedup key includes the line so the rewrite count is exact; a corrupt marker fails closed and is left byte-identical;statusandretireshare the same workflow scope; the product specifier is tried verbatim before candidate rewriting. - BUG-178:
migrate statususes retire's gate/compiler split for blockers and reports apreservedfield;next:branches on state instead of being unconditional.
Regression tests:
migrate-bug-{015,050,051,052,053,061,062,063,064,065,102,103,112,114, 116,117,118,178,179,226,234}-*andcore-bug-234-*.Known follow-up NOT covered here: BUG-017 (
--jsontop-level shape) is blocked because existing tests pin both an object envelope for failures and an array for success; a single shape breaks at least two ofcli-bug-696-migrate-strip-json-envelope,migrate-bug-cli-wiring,cli-bug-56-cli-face,cli-bug-675-migrate-retire-json-shape,migrate-bug-1028-marker-json-same-shape. Every failure path now uses the same object envelope (including the previously empty-stdout unknown-action path).追加:BUG-017
migrate --json顶层形状恒为数组成功路径早已是数组,动作级失败路径却输出对象信封(
{ ok:false, action, targets, error })⇒ 消费方JSON.parse(stdout).map(...)在失败路径抛异常。现统一为 数组:失败/正常终止信封一律包成单元素数组([ { ok:false, … } ]),status/verify/strip/retire四个 action 与未知 action 分支同口径。已有测试更新(原先钉住对象信封):
cli-bug-696-migrate-strip-json-envelope.test.ts(失败面读[0],并断言Array.isArray)migrate-bug-cli-wiring.test.ts(Bug 1006 失败面同上)cli-bug-56-cli-face.test.ts(正常终止信封failedTargets同上)
成功路径的数组形状(
cli-bug-675/migrate-bug-1028)不变。 - BUG-234:
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [206713f]
-
Updated dependencies [0650ef0]
-
Updated dependencies [fe03e18]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
-
Updated dependencies [9ff1709]
-
Updated dependencies [afd7c36]
-
Updated dependencies [7231e87]
-
Updated dependencies [37e9aa0]
- @nudojs/core@1.17.2
- @nudojs/service@1.10.3
- @nudojs/parser@1.5.6
- @nudojs/env@0.5.6
- @nudojs/harvester@0.4.6
1.7.2
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
- @nudojs/service@1.10.2
- @nudojs/env@0.5.5
- @nudojs/harvester@0.4.5
- @nudojs/parser@1.5.5
1.7.1
Patch Changes
-
0438f10: Fix evaluator correctness and remove duplicated machinery:
- Respect user bindings named
undefined/NaN/Infinity(module bindings, parameters) instead of unconditionally folding them; keep exact literal folding for unshadowed reads, suppress undefined-literal narrowing facts when the name is bound, and honor the same bindings in callee position (NaN(1)) and at the expression entry (declarations inside the expression itself). - Separate private top-level functions from the module export surface:
export *precedence is restored, private named imports now reportnudo:missing-export,transpileSourceno longer emitsexportfor private functions, and analysis keeps a non-enumerable local-function table (so same-name re-exports/CJS exports do not shadow analyzed locals). - Make the generated runtime import list a single source of truth (it is now self-consistent with
@nudojs/core/exec), dedupeRUNTIME_IMPORT_RE, and share thenew Functioncompile scaffold. - Dedupe the A/B call budgets and the two
@nudo:purememo caches behind shared factories; either public clear API now invalidates both. - Single-pass, memoized function facet analysis; dedupe Error/mutator/class-chain/nullish tables; remove dead service evaluator modules.
- Split the evaluator's largest dispatch functions (
$invokeInner,$get/$set,invokeArrMethod,transpileStatement) and move narrowing ops out ofruntime/async.ts.
- Respect user bindings named
-
Updated dependencies [f1d4958]
-
Updated dependencies [0438f10]
-
Updated dependencies [6ebf5a4]
- @nudojs/env@0.5.4
- @nudojs/core@1.17.0
- @nudojs/service@1.10.1
- @nudojs/parser@1.5.4
- @nudojs/harvester@0.4.4
1.7.0
Minor Changes
-
f896290: BREAKING: 类成员的调用点参数契约补齐三条保守边界(与普通函数 / 具名导入 同一口径)。
nudo check此前对以下类成员调用点零义务(违约代码判绿):- 未导出的本地类:
class L { @nudo:contract m }的const c = new L(); c.m(-1)/new L().m(-1)/L.s(-1)。普通未导出本地函数本来就在调用点执法 ⇒ 类成员与 本地函数规则不一致(同一义务两套口径)。 - 匿名
export default class { m(a){} }:import K from "./lib.js"后new K().m(-1)解析不到类(具名export default class K已可用)。匿名类没有 本地名 ⇒ 契约键用导出槽名(default.m,侧车键default_m;@nudo:contract的 指令 scope 同口径)⇒nudo check现在报fn: default.m。 - 命名空间导入:
import * as ns from "./lib.js"的new ns.K().m(-1)/ns.K.s(-1)(const m = require(...)的m.K同路径)。类解析与具名导入共用 同一套类 AST 事实(classBindingOf),不另写模块解析器。
修法:模块级本地类的 own 方法名并入调用点扫描的 knownFns(签名普查面 / L2 入口表 不动 ⇒
nudo check的签名列表不因本地类扩面);匿名默认类绑定名 =default; 命名空间模块按词法作用域解析(内层同名声明遮蔽 ⇒ 不解析)。谁不会坏(守卫,全部保持零新诊断):继承而来(非 own)的方法;构造器
this.m = …/ 同名类字段覆盖;getter / setter / computed 成员名;静态 / 实例交叉 调用(K.m调实例方法、new K().s调静态方法);接收者被形参 / 局部声明遮蔽; 重新赋值(失效范围从「当前作用域帧」改为沿作用域链——函数体内L = …之后不再套旧类契约);未声明契约的类与方法(未导出本地类的侧车不绑, 与未导出本地函数同口径)。有意保持不执法(与普通函数 parity,不发明更宽义务):
export { K as J } from "./lib.js"的别名再导出、import { K } …; export { K }、 以及命名空间经再导出 index(普通函数的ns.f同样不执法)。再导出环(a ↔ b)有 深度上限,终止且零诊断。 - 未导出的本地类:
-
a069994: fix(core,cli): 类成员的参数契约在导入类实例 / 内联
new/ 静态调用形态下 不执法(假绿)nudo check此前只对「本地类实例 + 同类文件里的const c = new C(); c.m(…)」做 调用点契约执法。以下形态解析不出被调方 ⇒ 整条调用被跳过 ⇒ 违约代码判绿:- 导入类:
const c = new K(); c.m(-1)(import { K } from "./lib.js") - 内联构造:
new K().m(-1)(导入 / 本地都) - 静态方法:
K.s(-1)(导入 / 本地都)
修法:类成员的调用点解析改由类声明 AST 的 own 成员事实驱动 —— 实例 / 静态分开 判定,
K.static.s沿用静态 / 实例同名时的既有 scope 名(@nudo:contract侧)。 本地类仍以nudo check的签名普查面为闸门(未导出的类保持零诊断、不扩面);导入类 按定义模块 + 定义文件侧车绑定契约(K_m/K.s等同既有侧车键)。BREAKING:
nudo check现在会对上述形态新报nudo:constraint-violated(及调用点前置条件违例)⇒ 此前依赖这些调用点静默的 CI 流水线会开始非零退出。 这些调用点本来就是 L1 义务的覆盖空洞:同一份契约在c.m(…)上执法、在new K().m(…)上放行,属于同一义务的两套口径。谁不会坏(守卫,全部保持零新诊断):继承而来(非 own)的方法;构造器
this.m = …或同名类字段覆盖的方法;getter / setter / computed 成员名; 静态 / 实例交叉调用(K.m调实例方法、new K().s调静态方法);接收者被形参 / 局部声明遮蔽或被重新赋值;未声明契约的方法。 - 导入类:
-
97f28ed: BREAKING: 产物面(dts / zod / standard / case)的形参位形状变了 —— 数组解构形参现在按元素下标聚合成元组,TS 的
this: T接收者标注不再 被当成形参。谁会坏:消费方
import生成产物并按旧形状调用的代码 ——- 数组解构形参(
fn({ a: number() })对[a, b]):dts 面此前给{ a: number }、zod 面给z.object({ a: … })(与真实形参形态颠倒), 现在给元组([ a, b ]/z.tuple([…]))⇒ 旧形状的调用点类型不兼容; this: T接收者标注:dts 多一个形参(消费方吃TS2554假红)、zod 多一个 字面量槽"this"、standard 多一个幽灵导出<fn>_this⇒ 这些幽灵位现在 全部消失。
怎么迁移:重新生成产物;数组解构形参按数组传参;消费方若引用过
<fn>_this之类幽灵导出,直接删掉(它们本就不存在)。fix(service, nudojs): 期望判定严格化、数组解构的产物面按元素下标寻址、
--assume的界落到形参前提、this接收者标注不进形参表- Bug 396(
@nudo:case期望判定):leqAbs的「同 prim 字面量视为可赋」捷径在 对象槽位上连字面量相等性都不比 ⇒shape({ a: lit(2) })这类期望永不被 执法(case 期望恒[ok]、nudo:case-expected零诊断 ⇒ 假绿),而同一份 契约在手写侧车面走逐字段约束树能抓到 ⇒ 两面自相矛盾。caseExpectedSatisfied补一道「期望槽里的字面量按值比较」(含嵌套对象槽),只作用于期望判定,leqAbs的既有语义一字不动(core 侧那一行不改 —— gold 的assign-compatible/wider依赖该口径)。 - Bug 394(产物面):数组解构形参的字段级侧车契约(
fn({ a: number() })对[a, b]来说a是下标 0 的元素,不是属性键)此前被摊成对象槽 ⇒ dts 给{ a: number }、zod 给z.object({ a: … })⇒ 产物输入面与真实形参形态 完全颠倒(合法数组调用被判红、非法对象调用被放行)。现在 dts / zod / standard 三面都按元素下标聚合成元组(未契约的元素位留any——无约束, 不是 unknown),dts 的声明名渲染成数组形态[ a, b ]。 - Bug 397(产物半):TS 的
this: T是接收者标注、不是运行时形参 —— service 侧形参表入口extractFormals现在兜底过滤它并重排 index (index 是形参表内的位置 ⇒ 实参位靠它对齐)⇒ dts / zod / standard / case 四个产物面不再多出一槽(dts 多一个形参 ⇒ 消费方吃 TS2554 假红;zod 多一个字面量 槽"this"⇒ 对每一个真实调用值报假红;standard 多一个幽灵导出<fn>_this)。 - Bug 976(CLI 半):
--assume声明的界此前被顶成写死的x>0⇒ 用户写--assume 'x>-5'时观察面只给"pos"(x=-1的分支被当成不可达 ⇒ 说谎)。 现在把用户声明的界(按形参名归并、同一形参多条取合取)落进形参自己的前提 (替换写死的默认,不是与它合取),并与 core 半 (buildArgsFromAssume的bounds形参)同批接线;契约的义务与用户的界并存 (契约 pred ∧ 用户界)⇒ 契约不被削弱、用户的界也不被顶掉。
- 数组解构形参(
-
b0878e3: BREAKING:
nudo export的产物面(zod / standard / dts / guard)参数位与返回位 的形状变了 —— 槽位表改以声明形参表为骨架,与nudo check的签名面合流。谁会坏:直接
import { <fn>Input } from "*.nudo.zod"(或 guard / standard 产物) 并按旧形状调用的消费方 —— 生成的.d.ts与 zod / standard 输入对象现在按 真实调用形态渲染(剩余参数...rest是一个数组槽、点路径契约键展开成 嵌套形状、声明级默认值让槽位可选),旧形状与新形状不兼容 ⇒ 消费方的tsc --noEmit会红。怎么迁移:重新生成产物(
nudo export --format all --out …)并按新形状改消费方 调用点 —— 剩余参数按数组传、点路径契约按嵌套对象传、有默认值的形参现在 是可选位。nudo export的参数面与返回面改按声明形参表合流:契约面与观测面不再二选一, 剩余参数 / 默认形参 / 点路径契约 / async 返回 / 违约返回都按真实调用形态投影。- 剩余参数(
...rest)此前被拆成「...rest一个槽 + 凭空造出来的argN槽」,槽值是单个实参(Bug 604)。现在槽位表以声明形参表为骨架:槽名取裸名 (rest)、槽值是数组、槽数取声明形参个数。 - 部分契约(契约只覆盖部分形参)时,未被覆盖的形参位此前被静默丢掉 (Bug 605)——契约面与观测面二选一。现在两者按形参合流:契约覆盖的位取契约 Abs,未覆盖的位取声明形参表 + 观测证据(不丢位),与 dts 面同口径。
- 声明级默认值此前不参与槽位可选性,带默认值的形参被渲染成必填槽
(Bug 611)——dts 面是
b?: number、zod 面是必填,两个产物面自相矛盾。现在 可选性按三来源口径(契约级 → 声明级默认值 → 观测级最短元数)产出,与 dts 面 逐位同。 - 有参数契约、无返回契约时,返回面此前回退到无约束的入口观测(缺种子 重算),与 dts / check 面矛盾(Bug 612)。现在先用契约参数作种子重算一次 返回位(与 dts / check 面同一条路径),重算失败才回落观测面。
- async 函数的返回约束此前被当成整个返回类型,
Promise<…>包装丢失 (Bug 618)。现在契约返回描述的是 await 后的值,返回面保留 promise 包装。 @nudo:skip+ 多条 case 见证时 Output 面此前不产出(兜底只取第 0 条断言 见证,而无断言的 case 是见证不是断言),参数面却 join 了全部见证——同一函数 两套口径(Bug 619)。现在返回面兜底 join 全部域证据见证。- 点路径契约键(
"card.grade")此前被当成字面量顶层属性名,约束也被当成 整个形参的约束(Bug 620)。现在契约参数按声明形参表定位,点路径展开成嵌套 形状({ card: { grade: … } }),与 dts 面的嵌套形状一致。 - 返回契约此前当「已证成的事实」直接投影,产物可能声明一个实现可被证否的 返回类型(Bug 626)。现在投影前复核实现:违约时不投影契约,回落实现实际的 返回形态。
产物面(zod / standard / dts / guard)因此与
nudo check的签名面口径一致: 同一份源码在两面给出的参数位与返回位不再互相矛盾。 - 剩余参数(
-
b0878e3: BREAKING:
nudo export的四个产物面现在共用同一条导出面规则 —— 未导出的内部实现不再发布运行时守卫(guard 面),zod / standard / dts 三面 此前投影每一个函数(含内部实现),现在只投影模块的公开导出面。谁会坏:直接
import { is<fn>Output } from "*.nudo.guard"的消费方 —— 未导出 (内部实现)的函数此前有守卫导出,现在没有了 ⇒ 消费方的tsc --noEmit会红;guard 的返回域也改成与 zod / standard / dts 同一条 (此前 guard 用单次调用的观测返回,与契约域矛盾)。怎么迁移:重新生成产物;只对公开导出的函数使用 guard 导出(内部实现不再有 守卫 —— 这是「一个导出一个出口域」的统一口径)。
nudo exportnow publishes one exit domain across its product faces, and a parameter named__proto__no longer disappears from the zod artifact.- The guard face (
--format guard) took the observed return value of a single call site, so a function with a declared return contract published a guard that rejected every value the contract allows (return data === 0.5;for a contract of "number between 0 and 1"), while the zod face of the very same run published the contract domain. The guard now consumes the same unified return face as the zod / Standard Schema / dts faces, so one export gives one exit domain. A contract the implementation violates is still projected as the implementation actually behaves — in every face. - The zod input object was assembled into an ordinary object, so a parameter
named
__proto__was swallowed by the inherited prototype setter and never became an own key: the artifact published<fn>Inputwithout that parameter, while the.d.tsof the same run kept it. The slot table is now assembled without a prototype, so the parameter is no longer lost while the artifact is assembled (the other inherited key names are kept as well). - The guard face now inherits the shared export-surface rule: a function that is not exported no longer publishes a runtime guard.
- The guard face (
-
b0878e3: BREAKING:
nudo export的四个产物面现在共用同一条导出面规则,且硬失败 不再静默发布产物。- 四个产物面只投影模块的公开导出面(此前 zod / standard / guard 投影每一个
函数,含内部实现)⇒ 未导出的内部实现不再有
<fn>Input/is<fn>Output之类的导出 ⇒ 直接 import 这些导出的消费方tsc --noEmit会红。 @nudo:skip的函数此前被导出面过滤器排除(它按设计没有 case 见证)⇒ 从不 出现在任何产物面;现在它照常投影 ⇒ 产物多出此前没有的导出。
谁会坏:按「产物里有某个函数」做存在性判断的消费方(内部实现不再有守卫 / zod 校验器);以及期待
@nudo:skip的函数不出现在产物里的脚本。怎么迁移:重新生成产物并只依赖公开导出面上的导出;
@nudo:skip现在会出现在 产物里(它只跳过 case 见证,不跳过投影)。nudo exportnow refuses to publish a projection that contradicts the contract, keeps the four product faces on one public-surface rule, and stops dropping@nudo:skipfunctions.- A sidecar (
*.nudo.js) that failed to load was silently ignored: the contract was lost, and the artifacts published the "not declared" case as "no constraint" (zodz.unknown()) — no message on stderr, exit 0.nudo exportnow reports the realnudo:interface-loaddiagnostic and exits 1 without publishing anything. - A contract parameter name that is not in the declared parameter list was
projected as-is, so the zod face published an
<fn>Inputwhose key the function signature does not have.nudo exportnow reportsnudo:interface-param-mismatchand exits 1 without publishing anything. - A contract whose conjunction is unsatisfiable (the source
@nudo:contractcontradicts the same-name sidecar) was projected with only half of the contract, producing a validator that can never pass.nudo exportnow reportsnudo:interface-conflictand exits 1 without publishing anything. - The dts face projected the module's public surface (export / export
default / CJS exports), while the zod / Standard Schema / guard faces
projected every function — internal implementations included. A module
with no exports at all still produced three runtime validators while its
.d.tswas silently missing. All four faces now share one export-surface rule, and a module with no public surface says so instead of producing nothing without a word. @nudo:skipfunctions were excluded from the export entry filter (they have no case witness by design), so they never reached any product face. They are now projected like any other exported function.
- 四个产物面只投影模块的公开导出面(此前 zod / standard / guard 投影每一个
函数,含内部实现)⇒ 未导出的内部实现不再有
-
b0878e3: BREAKING:
nudo export --out的产物文件名变了,且不再覆盖不是自己 生成的产物。- 产物名冲突时现在带模块键后缀(
lib.323a7411.d.ts/C.m.nudo.standard.ts/C.m.2.nudo.standard.ts)⇒ 此前a/lib.js与b/lib.js会互相覆盖 (后者静默盖掉前者)⇒ 消费方按固定文件名取产物的流水线现在会找不到文件。 --out现在拒绝覆盖它没生成过的文件(exit 1 +nudo:path-io)⇒ 此前 手写的.d.ts会被静默替换成unknown;现在构建会以非零码退出。
谁会坏:按固定文件名消费
nudo export --out产物的脚本(文件名现在带模块键 后缀 / 方法名);以及依赖「--out会覆盖输出目录里的同名文件」的流水线(现在 拒绝并 exit 1)。怎么迁移:改用产物里的
// nudo-export-module:marker 行定位产物(它记录产物 属于哪个模块),而不是硬编码文件名;确保输出目录里没有会被覆盖的同名文件 (或先清空输出目录)。产物内的// nudo-export-module:marker 用于区分 「同模块更新」与「另一个模块的同名产物」。nudo export --outno longer loses artifacts silently: product names are unique per module, hand-written files are never overwritten, and a failed write reports what actually landed.- Two modules could map to the same artifact path. The Standard Schema face
names its file after the function (so two modules exporting a function
of the same name collided), while the dts / zod / guard faces name theirs
after the source file stem (so
a/lib.jsandb/lib.jscollided). The second export silently overwrote the first one, and the consumer ended up with another module's declarations. A product name that is already taken by a different module now gets a module-key suffix (lib.323a7411.d.ts), so both modules keep their artifact. - Two functions with the same name in one module (two
mmethods of a class) were written to the same Standard Schema file — the second write overwrote the first. Each function now gets its own file (C.m.nudo.standard.ts,C.m.2.nudo.standard.ts). - A hand-written
.d.tsin the output directory was overwritten without a word, replacing precise types withunknown.nudo exportnow refuses to overwrite a file it did not generate (exit 1,nudo:path-iodiagnostic) and leaves the file untouched. - When a write failed, the artifacts that had already been written were
dropped from the output: stdout showed no
wroteline at all while the files were on disk. The written list is now replayed, and the error names the file that failed instead of only the directory. - The
fix:hint for a failed--outpointed atnudo check --out, an option that does not exist (error: unknown option '--out'). It now points atnudo export --outand says what to do.
Artifacts written with
--outcarry a// nudo-export-module:marker line that records which module they belong to; it is used to tell "same module, updated" from "another module with the same name". - 产物名冲突时现在带模块键后缀(
-
b0878e3: BREAKING:
nudo export --format all(stdout)的导出名变了 —— 同一模块 作用域内同名导出现在被改名而不是撞名报错。- zod 面与 standard 面都叫
<fn>Input/<fn>Output⇒--format all的 stdout 此前撞名(TS2451);现在后一个面改名(<fn>OutputStandard)⇒ 消费方import { <fn>Output } from "…"现在拿到的是 zod 面的那个名字,standard 面 的同名导出改名 ⇒ 直接按旧名 import 的消费方tsc --noEmit会红。
谁会坏:
nudo export --format all > out.ts后按名 import<fn>Output/<fn>Input的消费方(standard 面的同名导出现在带Standard后缀);以及期待--format allstdout 撞名报错的脚本(现在能出文件了)。怎么迁移:重新生成产物并按新名 import(zod 面保持
<fn>Output/<fn>Input, standard 面在--format all合并流里是<fn>OutputStandard);或分开导出 (--format zod与--format standard各自成文件 ⇒ 名字不冲突)。nudo exportto stdout now produces one usable module: the Standard Schema helper is declared once, the four dialects no longer collide on export names, and the dropped-preds ledger names the face it came from.--format standardto stdout repeated the whole__nudoCheckhelper for every exported function, because each per-function module carries its own copy and the chunks were concatenated as they were. The shared prelude (banner + helper) is now emitted once, so the artifact no longer fails to compile withTS2393/TS2300.--format allto stdout put the zod and the Standard Schema face into the same module scope. Both name the same validator<fn>Input/<fn>Output, so the artifact failed withTS2451. A top-level name may now be declared only once per stream: the first face keeps the product name and a later face that would repeat it is renamed (<fn>OutputStandard).- The
dropped predsledger was always titled "not projected into zod" even when the run produced no zod artifact at all (--format standard) and its entries come from the Standard Schema face. The title now names the face the entries come from, and--format allshows one zod ledger and one Standard Schema ledger instead of the same title twice.
Artifacts written with
--outare unchanged: each dialect keeps its own file and its own product names. - zod 面与 standard 面都叫
-
b0878e3: BREAKING: standard 面的返回面导出名恒为
<fn>Output(此前「有返回契约时」 叫<fn>Return)—— 这条改名随 CLI 到达消费方。谁会坏:
nudo export --format standard之后import { <fn>Return } from "*.nudo.standard"的消费方 ⇒ 旧名 import 断(消费方tsc --noEmit会红)。怎么迁移:改 import 名为
<fn>Output并重新生成产物;文档与scripts/verify-doc-examples.sh的 pin 已同步。nudo export的六片并发修复收口:主 agent 接线把「命名规则分叉」「同名条目折叠」 「契约可选性丢失」「模块身份靠猜」四处跨片缺口补上。- 命名规则的唯一产地(Bug 602 / 603 / 609 / 622):
export/stdout.ts原先 自带一份DIALECT_SUFFIX+uniqueSegmentName,export/io.ts又造了一份 ⇒ 「stdout 改名规则」与「落盘改名规则」可能分叉。删掉 stdout 侧的本地副本, 改为 importio.ts的实现(同一ArtifactDialect口径)。 - 同名条目不再折叠(Bug 623):zod 导出表原是普通对象 ⇒ 同一个类里两个
同名方法(
C.m出现两次)时后者覆盖前者 ⇒ zod 产物只剩 1 个C_mInput, 另一个方法的证据凭空消失。导出表改无原型对象 + 键侧去重 (C_mInput/C_mInput_2)⇒ 两份都在;guard 面同步接上generateGuardFunctionFromAbs的去重集合 ⇒ 同一份产物里不再出现两个 同名export function(此前是 TS2393 重复声明)。 - standard 面的可选性透传(Bug 627):参数面的
optional没传给 service ⇒ 契约允许undefined的形参在 standard 面被当必填 ⇒ 消费方判非法。 - 模块身份不再靠猜(Bug 609 / 622):
--out写盘时把源文件路径作为moduleKey传给写盘层 ⇒ 模块身份从「stem + 导出签名」升级为路径 ⇒ 同 stem 且导出名集合也相同的两个模块不再被判成同一模块(后者覆盖前者),且 改名后重导不会换唯一名、留下陈旧副本。 - 614 的破坏性重命名连带面同步:standard 面返回面导出名恒为
<fn>Output⇒scripts/verify-doc-examples.sh的 pin 与中英文档guides/export-ecosystem.md同步(否则verify:docs红)。
- 命名规则的唯一产地(Bug 602 / 603 / 609 / 622):
-
e5b3f38:
nudo migrate status --json的机器面新增了可选字段packageJsonError(畸形package.json的解析失败原因)⇒ 新增可选字段属增量变更(additive) ⇒ minor。nudo migrate statusnow reports the truth about a package: the nudo gate is detected from the command text, the dependency scope coverspeerDependencies,.tscounts stop at workspace package boundaries, atscscript blocks even when no.tsfile is left, a brokenpackage.jsonis reported instead of being read as "empty", and theblockerslist no longer carries the—placeholder (the JSON face reports[]).- The "no nudo check/test script yet" blocker matched the script name
(
/check|test/) while the scripts it looked at were collected by command text. A package already runningnudo check .under a name likelintortypecheck2was reported as having no gate — and the blocker never went away aftermigrate retire, which rewrites the script tonpx nudojs check .(a form the old/\bnudo\b/pattern did not even match). The gate is now detected from the command text (nudo check/nudo test/npx nudojs check). - The dependency scope merged only
dependenciesanddevDependencies, so a package carryingtypescriptinpeerDependencieswas reported astypescript dep: nowith no "typescript still in dependencies" blocker, whilemigrate retireon that same package did remove the dependency. All four dependency fields are now merged by one shared helper. tsFiles/tsxFileswere counted by a plain directory walk, so the root row of a workspace repeated every nested package's sources. Each row now counts only the files of its own package.- The "tsc still in scripts" blocker was gated on
tsFiles > 0, so a package with atscscript and no TypeScript source left — exactly the case worth retiring — reported no blocker at all. - A
package.jsonwith a JSON syntax error was silently read as "no dependencies, no scripts", whichnudo checkcontradicts.migrate statusnow reports the parse failure (inblockersand in the newpackageJsonErrorfield of the JSON face). - The
—placeholder for "no blocker" leaked into theblockersstring (1 tsc line(s) in .github/workflows; —) and into the JSONblockersarray, where a machine consumer counted it as one more blocker. The placeholder is gone: no blockers means no entry, and the JSON face reports[]. - A
scriptsentry whose value isnullis valid JSON (npm reads it as "no command") but crashedmigrate statuswith a bareCannot read properties of null (reading 'split'). Non-string script values are now treated as "no command".
- The "no nudo check/test script yet" blocker matched the script name
(
-
697c5e1: BREAKING:
nudo check的同 stem 选源规则变了 —— 同名.js产物现在 胜出于同名.ts源 ⇒ 源不再被门禁覆盖(此前门禁查的是源)。谁会坏:仓库里同时提交了
foo.ts与编译产物foo.js(且该.js不是nudo migrate strip产物)的工程 —— 门禁现在分析foo.js,foo.ts不再被 分析 ⇒ 只写在.ts里的契约 / 指令不再被门禁看到(覆盖静默丢失);分析对象 也换了 ⇒ 诊断集合可能变化。怎么迁移:让
foo.js与foo.ts同源(用nudo migrate strip的产物,或 删掉其中一个);本版本尚未落产物清单(marker)来区分「strip 产物」与「同名 的另一个模块」,因此同名.ts/.js并存的工程需要自己消歧。fix(nudojs):
migrate strip --write的产物.js不再被nudo check跳过(发布物零覆盖 ⇒ 假绿)现象:
nudo migrate strip --write默认保留源.ts⇒ 迁移过渡期 (strip → retire 之间)目录里.ts与.js并存是常态 ⇒nudo check(=migrate retire装到 CI 上的门禁)跳过同 stem 的产物.js⇒ 真正发布出去的产物零覆盖(假绿);且与migrate verify对同一包给出 相反结论(verify 红 / check 绿)。根因:目录扫描的「同 stem 只分析一份」规则把「取哪一份」硬编码成
.ts(迁移前的事实源:带类型标注 ⇒ 推断更准)⇒ 迁移过渡期恰好取 错的那一份。修法(
packages/nudojs/src/commands/shared.ts·collectNudoFiles): 同 stem 冲突时产物(发布物)胜出 —— 同目录存在同名产物 ⇒ 源被产物取代 ⇒ 门禁查要发布的东西;源单独存在时照旧分析源。- 不变式保持:一个模块 ⇒ 一次分析(源被压掉,不是两份都分析)⇒
summary.errors/functions/files不翻倍。 - 契约不丢:strip 保留注释 ⇒
@nudo:contract//// @nudo:import在产物里 仍然生效 ⇒ 产物侧的契约面与源侧同强度。
行为变更(请注意):
- 同 stem 的
.js若不是 strip 产物(例如手写的旧模块、或被提交进仓库的 编译输出),现在被分析的是.js而不是.ts⇒ 源不再被门禁覆盖。要区分 「产物」与「同名的另一个模块」需要 strip 落一份产物清单(marker),本次未做。 .mts/.cts源(它们本身不是分析目标)的产物.mjs/.js现在 会被分析;改前这类产物被「同名源存在 ⇒ 跳过」规则连坐 ⇒ 该模块被分析 0 次(零覆盖)⇒ 现在补上。
- 不变式保持:一个模块 ⇒ 一次分析(源被压掉,不是两份都分析)⇒
-
e5b3f38: BREAKING:
nudo migrate retire --all --json的顶层 JSON 形状现在恒为 数组(此前随结果条数变化:1 个包 = 对象,≥2 个包 = 数组)。谁会坏:解析
nudo migrate retire --all --jsonstdout 的机器消费方 —— 单包时顶层从{ … }变成[ { … } ]⇒payload.removedDeps之类变成undefined。怎么迁移:消费方改按数组遍历(
const rows = Array.isArray(p) ? p : [p]之类的 兼容读法,或直接改读数组)。族 16 收口接线:把各分片「越界发现」里明确交给命令层 (
packages/nudojs/src/commands/migrate.ts)的接线项补齐 —— migrate 的 四个子命令此前在命令层与库面口径分裂。Bug 668 —
migrate status只把targets[0]交给migrateStatus⇒nudo migrate status pkg-a pkg-b只报 pkg-a、无警告、exit 0(迁移审计场景下 这是危险的静默截断)。改为全量审计(按包根去重)。Bug 595 —
migrate retire <a> <b>只退役a,b静默跳过。改用库面的 多目标入口migrateRetireMany(全退役或全报错,任一失败 ⇒ 整批零写盘)。Bug 675 —
migrate retire --all --json的顶层 JSON 形状随结果条数变化 (1 个包 = 对象,≥2 个包 = 数组)⇒ 机器可读契约不稳定。改为恒为数组, 与migrate status --json/migrate strip --json一致。Bug 1006 —
migrate retire --all失败时 stdout 为空 ⇒--json契约 下 stdout 不是合法 JSON。改为失败时 stdout 也给出合法 JSON 信封 ({ok:false, action, targets, error}),人类面引导仍走 stderr。Bug 567 / 586 — 「无可退役」被当成错误(库面抛错 ⇒ CLI exit 1)⇒ 用户 跑一次正常退役却看到红色。改为「无可退役」是正常结果(exit 0 + 明确提示); 编译器角色的脚本被原样保留时,CLI 打印该脚本与保留原因(否则看起来像漏改)。
Bug 588(retire 侧) — 畸形
package.json被readJson的「解析失败 = 不存在」压成同一个undefined⇒ 谎报「no package.json under X」(与nudo check面的「package.json parse failed」不同口径)。改用详细读取并 fail-closed;retire --all侧同样不再静默跳过畸形清单。Bug 586(判据收口) — 「这个脚本是不是编译脚本」的判据必须是「它会不会真的 产出产物」,而不是「命令行里出现了
-p」或「脚本名叫 build」:tsc -p tsconfig.build.json(带outDir+declaration)⇒ 真会 emit ⇒ 编译器角色 ⇒ 原样保留(报告 586 要的就是这个);tsc -p .而 tsconfig 里compilerOptions.noEmit: true⇒ 不产出任何产物 ⇒ 它其实是类型门禁 ⇒ 改写成nudo check且 typescript 依赖可摘 (仓内公开样板docs/examples/migrate/before正是这一形状 —— 旧判定会让 「退役 tsc」的故事落空:依赖摘不掉)。 判定会读 tsconfig(含extends链)与 JSONC 注释;读不到配置 ⇒ 保守按 「会 emit」处理(不得猜着改写)。
-
169ed52: check 面新增了此前不存在的诊断码(
nudo:json-invalid等)⇒ 机器面新增 可观测的诊断码属增量变更(additive)⇒ minor。nudo checknow reports the diagnostics it used to swallow: module-loading problems and env-harvest conflicts reach the check face instead of being dropped.- A dependency that could not be found, or that did not provide the requested
export, was diagnosed by the analyzer but never surfaced, so the gate stayed
green on a program that could not even be loaded. Module-loading problems
are now visible on the check face (
nudo:module-missing,nudo:missing-exportas errors;nudo:module-cycle,nudo:module-depth,nudo:json-invalid,nudo:exports-unresolvedas warnings). - The same finding was reported twice when it arrived through both the mock channel and the module-graph channel; the duplicates are now collapsed.
- A handwritten
@nudo:envthat wins over the harvested environment was invisible on the check face although the documentation lists it as a check warning. It is now reported asnudo:env-harvest-conflict(warning, so it does not block the gate). --fromnow also sees call sites that live inside a function body: the call-site files are scanned statically as well, so a violation that was visible when the caller was checked alone is reported when the callee is checked with--from.
- A dependency that could not be found, or that did not provide the requested
export, was diagnosed by the analyzer but never surfaced, so the gate stayed
green on a program that could not even be loaded. Module-loading problems
are now visible on the check face (
-
02aa122: BREAKING:
nudo contract --json的顶层载荷形状从「一个对象」变成 「单元素数组」(目录形态此前是 N 份 JSON 首尾相接 ⇒JSON.parse直接抛)。谁会坏:解析
nudo contract --jsonstdout 的机器消费方 —— 单文件形态的顶层 从{ file, entries[], draftPath, … }变成[{ file, entries[], draftPath, … }]⇒payload.file/payload.entries变成undefined;元素内部的键 (file/entries[].fn/entries[].signature/draftPath/draftSource/diff)未变。怎么迁移:消费方改读
docs[0](并按数组遍历,别再假设「单文件 = 单对象」)。fix(nudojs):
nudo contract的--json机器面(跨文件聚合 + 失败可读)+--from-dts的用法校验顺序族 20 · 片 A(658 / 659 / 661 / 664)。
- Bug 658 ——
contract --json的 stdout 必须是一份** JSON(跨文件聚合层)。 改前 JSON 出口是单文档**(每个 root 一次console.log),而命令层对每个 root 各跑一次 ⇒ 目录形态的 stdout 是 N 份 JSON 首尾相接,JSON.parse抛Unexpected non-whitespace character after JSON。现在命令层加跨文件聚合层: 收集所有 root 的机器文档后一次打印;单文件也走同一路径 ⇒ 形态恒定。 ⚠ 破坏性变更:单文件载荷的顶层形状从「一个对象」变成「单元素数组」 (元素内部的键file/entries[].fn/entries[].signature/draftPath/draftSource/diff未变)。消费方请改读docs[0]。 同一修法覆盖 print 分支(contract --json <目录>改前同样是多份拼接)。 - Bug 659 ——
--from-dts不再绕过全部用法校验。改前--from-dts在所有 校验之前短路 ⇒--emit/--draft/--json被静默吞掉 (--from-dts --emit --draft不报互斥、exit 0;--from-dts --json的 stdout 是 draft 文本、不是 JSON)。现在--from-dts与其它模式共用同一套 「先校验、后分派」的顺序:--emit/--draft互斥、--write需要草稿模式、--exit-on-diff需要--emit --dry-run都对--from-dts生效;--json与--from-dts显式互斥(--from-dts没有机器可读载荷 ⇒ 显式拒绝,不许「给了不生效且不报错」)。 ⚠--write+--from-dts仍是合法组合(help 与 CLI Reference 的口径都是 「With--draft/--from-dts」)⇒ 校验按模式判定,不误伤。 - Bug 661 ——
--json形态下路径错误必须进 JSON body。改前--json把reportPathErrors(stderr 面)整段跳过,而pathErrors只接进 draft 分支 ⇒ print / emit 形态下「置红的那个原因」既不在 stdout 也不在 stderr,exit 1 没有任何理由。现在路径错误进聚合信封的pathErrors[](print / emit / draft 三形态统一),exit 仍为 1。 - Bug 664 —— 失败的 root 也必须进
--json载荷。改前 per-rootcatch只产 人类文本:单文件形态 stdout 0 字节 + exit 1(违反「绝不空 stdout + 非零 exit」不变量);目录形态 stdout 是一份只含好文件的合法 JSON,失败文件 彻底消失。现在失败 root 进聚合结果的errors[](code: nudo:contract-analysis-failed)⇒ stdout 永不为空、载荷不缺项。 - 顺带:
--json形态下的用法错误也落一份机器可读信封 (pathErrors[{code:"nudo:usage-error"}]+ exit 1),口径与nudo check --json的用法错误信封同款(--json下 stdout 永不为空)。
- Bug 658 ——
-
02aa122: BREAKING:
nudo contract --from-dts --write的草稿落盘位置变了 (Bug 944)—— 此前写在当前工作目录,现在写在源.d.ts旁边。谁会坏:跑
nudo contract --from-dts --write后在当前目录读草稿的脚本 (例如cat createUser.nudo.draft.ts)⇒ 文件现在在源.d.ts所在目录 (types/index.d.ts⇒types/index.d.nudo.draft.ts)⇒ 旧路径读不到; 从node_modules收割来的包类型不再写草稿(此前会写)。怎么迁移:按源
.d.ts的目录定位草稿(<dir-of-dts>/<stem>.nudo.draft.ts), 别再假设草稿落在 CWD;node_modules里的包类型先把.d.ts复制进工程再跑。nudo contract --emit/--from-dts: unmatched--fnnames no longer widen the write scope, the dry-run preview names the sidecar it would change,--json --emitnow emits a machine payload, and--from-dts --writelands its draft next to the source.d.tsinstead of in the current directory.-
Bug 657 —
--fn <misspelled>silently dropped the filter. When none of the requested names matched an export of the target file, the filtered list was downgraded to "no filter at all", so the emitter refreshed every existing@generatedsegment (or, with--all, created segments for every export) and wrote the sidecar — exit 0, no warning. Now a name that matches nothing is a usage error: the local export names are listed, the exit code is 1, and nothing is written. When only some names match, the unmatched ones are passed through unchanged and surface through the emitter's existingskipped <fn> (not-an-export)channel — the same wording the LSP / agent face already uses. -
Bug 662 — the
--emit --dry-runpreview named the source file. The preview saidwould update lib.jswhile the diff it printed was againstlib.nudo.js. The label now names the sidecar, matching the diff header and the other two branches of the same command. -
Bug 667 —
--json --emitignored--json. stdout was human text and the exit code was 0, so a machine consumer got unparseable output with no failure signal.--json --emitnow prints one valid JSON document: the per-file machine record (file,sidecar,changed,written,skipped,issues,diff), shaped like the--json/--draft --jsonrecords and collected into the same aggregated array. -
Bug 944 —
--from-dts --writewrote into the current directory and overwrote unconditionally (a draft belonging to a different file with the same base name was silently replaced; exit 0, no warning). The draft now lands next to the source.d.ts(samesidecarDraftPathconvention as--draft --write), an existing draft with different content is not overwritten (the write is refused with an explanation and exit 1; override withNUDO_DRAFT_FORCE=1), the write goes through the same guarded writer as--draft --write(never the formal sidecar, nevernode_modules, never outside the project root, unchanged content is not rewritten, an empty draft is not written), and the closing hint names the sidecar to copy the accepted exports into.Behaviour change: the draft produced by
--from-dts --writemoves from the current working directory to the directory of the source.d.ts(for exampletypes/index.d.tsnow yieldstypes/index.d.nudo.draft.ts). Scripts that read the draft from the working directory have to follow the new path. Drafts for package types harvested fromnode_modulesare no longer written at all — copy the.d.tsinto the project first.
-
-
02aa122: 新增 CLI 旗标
nudo contract --from-dts --write --force(覆盖既有草稿的可见 逃生口)—— 1.x+ 包的新旗标属增量变更(additive)⇒ minor。fix(nudojs):
nudo contract --from-dts --write新增--force旗标(覆盖既有草稿的可见逃生口)族 20 · 收口片(主 agent 接线)。
--from-dts --write在目标草稿已存在且内容不同时 会拒绝覆盖(exit 1,零写盘)。此前唯一的逃生口是环境变量NUDO_DRAFT_FORCE=1—— 对脚本不可见、不可审计。现在新增 CLI 旗标
--force:nudo contract --from-dts --write --force⇒ 允许覆盖既有草稿;- 与
NUDO_DRAFT_FORCE=1等价(旗标优先),但在 CLI 面可见、可被脚本审计; - 不加
--force时的行为不变(仍然拒绝覆盖 + exit 1 + 零写盘)。
旗标只在
--from-dts --write组合下有意义;与其它模式同用时不改变既有语义。 -
3432d8c: CaseJson 的断言面新增了第三种裁决
unchecked(外加可选字段uncheckedReason)⇒ 机器面新增可选字段属增量变更(additive)⇒ minor。nudo testcan now tell "the engine could not infer the value" apart from "the value does not match the expectation".- A failed inference used to be reported as a failed assertion. When the
engine cannot infer a witness' result (the observed value is
unknown, or its confidence isopaque), the assertion verdict was binary: the case was reported as[FAIL],nudo:case-expectedwas raised, and the run exited1. Writing the honest expectation (=> number()) could never fix it, because the real cause was the failed inference, not a type mismatch — while the very same source was only anINFO(nudo:opaque-result, exit0) on thenudo checkface, i.e. the two faces gave opposite severities for one fact. - The opposite expectation passed for the wrong reason.
=> any()(the top type) satisfied every expectation, including the ones the engine could not judge at all, so the assertion reported[ok]while nothing had been inferred — a hollow pass.
Both assertion report faces — the CLI one (
nudo test,nudo test --json,nudo test --abs) and the LSP agent tool one (testTool) — now use the same three-state verdict: a case whose observed value could not be inferred is recorded as unchecked (it is neither a failure nor a pass), it does not turn the run red, and the report says so explicitly ("cannot judge — the engine could not infer the actual value") and points at thenudo:opaque-resultremediation path instead of claiming a type mismatch. Theuncheckedcount in theassertionssummary and in the--jsonpayload now includes those cases, and a real mismatch is still reported as[FAIL]with exit1. - A failed inference used to be reported as a failed assertion. When the
engine cannot infer a witness' result (the observed value is
-
ebe909e:
@nudojs/core新增公开可选项TranspileOptions.disableAsyncGen(async 生成器路径的安全网开关)、@nudojs/service新增公开导出analyzeFileWithEvalFailures/analyzeFileAsyncWithEvalFailures/FileEvalFailure⇒ 均为纯增量 ⇒ minor。nudojs的闸门口径翻转(模块级求值失败 ⇒ 不再静默放绿)按 minor 发布:nudo check以 error 级nudo:internal报出并以非零码退出,nudo health的Result不再报OK。这是闸门口径的翻转(详见下方「BREAKING」)。bump 级别说明:本项目尚无外部用户,本批 1.x 包的破坏性变更统一以 minor 发布并保留
**BREAKING**:标注(谁会坏 + 怎么迁移照旧写全)⇒ 不占用 major 跳版, 也不触发发布侧gate-major的人工确认闸门。一旦有外部用户依赖这些包面, 即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」政策。fix: review 报告 34 条缺陷收口(闸门假红/假绿 · 契约面宽松 · 机器面谎报 · 文档与 changeset 漂移)
本轮把一份 34 条缺陷的 review 报告逐条落地:每条都先在当前代码上复现(或判定为 非缺陷),再修,并逐条用回滚法自证「修前红 / 修后绿」。新增 39 个回归测试文件。
BREAKING:
nudo check/nudo health现在对引擎内部回落(模块求值失败 ⇒ 该文件 的导出全部丢失)fail-closed。此前这类文件零诊断 + exit 0 ⇒ CI 闸门假绿 (合法代码与违约代码都判绿)。现在:命中内部回落 ⇒ 报 error 级nudo:internal(消息含文件路径与原因)⇒nudo check非零退出;nudo health报Result: FAIL (engine internal fallback found)并非零退出。谁会坏:依赖「坏文件也能过闸」的 CI 流水线(此前引擎自己挂了就当无事发生)。这些文件 本来就是引擎缺陷的暴露面 —— 现在会显式报出来。
怎么迁移:修掉被报出的文件(消息里给了路径与原因)。注意口径边界:
unsupported:*(能力边界)与nudo:opaque-result(推断精度)不触发该失败路径;只有引擎内部回落 (internal)才 fail-closed。
高危(闸门级 · 5 条)
-
await的位置表与转译侧脱节 ⇒yield落进嵌套箭头 ⇒ 整模块编译失败 ⇒ L2 闸门假绿 (core/algebra/exec/transpile/async-plan.ts·core/algebra/exec/run.ts):async 体的 真挂起靠宿主生成器(function*(){…}+await发射yield)实现 ⇒yield必须落在 生成器体内联位置;而转译侧把若干操作数包进宿主 thunk ——yield落在里面是 SyntaxError ⇒new Function编译失败 ⇒ 整个模块的导出全部丢失 ⇒ 闸门看不到任何 入口 ⇒ 零诊断 + exit 0 ⇒ CI 闸门假绿。位置表此前只把「分支臂 / 循环体 / 短路右臂 / 三元两臂」判为 thunk,漏了:成员调用的实参(o.m(await 1))、成员赋值的接收者/计算键/ 右值(o.x = await 1)、成员自增的计算键(o[await k]++)、逻辑赋值的右值 (x ||= await 1)、循环判别式与步进式、switch 的 case 测试、早退守卫之后的后续 语句(if (!c) return null; … await …)。实测:export async function load(id){ if(!id) return null; const res = await fetch("/x/"+id); return res.json(); }修前 ⇒nudo checkOK / exit 0 / 签名全 unknown;修后 ⇒ error 级nudo:entry-may-throw(与 main 同结论)。 修法(两处,缺一不可):① 位置表补齐(上列位置判 thunk ⇒ 该 async 体回落$async同步 路径,产物是合法 JS);② 安全网:生成器模式编译失败时关闭asyncGen重试一次 ⇒ 纵有未来新增的脱节位置,模块也编译得出来 ⇒ 导出可见 ⇒ 闸门照常判定 (宁可少精确,不可整模块消失)。 -
模块级求值失败 ⇒ 闸门假绿(
service/src/analyzer-orchestrate.ts·nudojs/src/commands/{check,check-report,health}.ts):见上方 BREAKING 段。 修法:按文件收集internal回落(进程级计数无法定位到文件)⇒ 命中即产出 error 级nudo:internal(复用已注册码DIAG.internal,未新增第二套码表)⇒ok:false⇒ 非零退出;分析失败的降级产物不回写磁盘缓存(回写 ⇒ 下次命中缓存跳过求值 ⇒ 静默转绿)。 -
早返回的关系补集默认「x 不是 NaN」⇒ 契约被证成 ⇒ 假绿 (
core/algebra/exec/transpile/stmt/{fn-body,statement}.ts):¬(x <= k)还含x为 NaN 的情形(NaN 与任何比较皆假)⇒ 后续路径只该断定x > k ∨ x is NaN;此前直接断言x > k(排除了 NaN)⇒if (x < 0) return 0; return x;+return nonNeg判成立 (零诊断),而原生x=NaN时返回 NaN ⇒ 真违规被放过。且与三元写法 (x < 0 ? 0 : x)结论不一致(三元判unproven-return)。修法:撤销后续路径的否定界 窄化 ⇒ 两条路径同口径。 -
Bug 370 把「确定违规」降为 warning(
core/algebra/postcondition.ts):证据面判据 从「ret.pred有事实」改成「含界原子」⇒typeof级证据(@nudo:contract x num的 声明域参数)被判成「无证据」⇒ 返回义务降级成nudo:unproven-return(warning,且 warning 不改变 exit code ⇒ 门禁空转)。if (x === -1 || x === -2) return x;+return positive是确定违规(x=0 即违约),此前只出 warning。修法:判据回到「ret.pred有 事实」⇒ 声明域参数 ⇒ error 级nudo:constraint-violated。 -
契约合取的结构型义务被静默丢掉 ⇒ 假绿(
core/algebra/interface.ts):合取遇任一侧 结构型就直接返回前侧 ⇒ 源码 shape{id}∧ 侧车 shape{id,name}的name义务整条蒸发 ⇒ 契约面比声明面宽松 ⇒ 违约代码被放过。修法:改为字段级合并(两侧都有的字段递归 合取、单侧字段保留、optional取交集);合不了的形态组合按既有口径不判 conflict (能力边界 ≠ 语义不可满足)但显式留痕(新增EffectiveInterface.undecidable⇒ check 面 发 warning 级nudo:interface-conflict,不静默宽松)。
闸门可信度(假红 / 假绿 · 14 条)
- 展开实参被计为 1 个 ⇒
nudo:arg-count假红(core/algebra/scan/literal-args.ts):impl(...args)被计成 1 个实参 ⇒ 报「expects 2 argument(s), got 1」;数组字面量展开的空洞 (three(...[1,,3]),原生是 3 个实参)被跳过;幻影槽位破坏 rest 聚合(few(1, ...more)对array(number()).max(1)报长度违规)。修法:个数不可判时让位元数检查;空洞按undefined计入;rest / length 边界在展开处停止。 - 裸名 callee 解析不看作用域 ⇒ 无契约也触发 arity 假红(
core/algebra/scan-call-graph.ts): 外层函数的形参 / 局部 const / 嵌套函数 / for-of 绑定 / 解构绑定同名时,把顶层声明当被调 方 ⇒ 报「log expects 2 argument(s), got 1」+ 假 may-throw。修法:callee 解析引入作用域链。 memberToFn按变量名做键 ⇒ 同名局部/参数互相串味(core/algebra/scan-call-graph.ts): 别名与成员绑定改为按作用域分桶,重新赋值时失效。- TS
x?: T与 JSDoc[x]被当成必需参数 ⇒ arity 假红(core/algebra/param-surface.ts):h()对/** @param {number} [x] */ function h(x)报「expects 1 argument(s), got 0」。 or契约的「不可判定」成员被当成失败(core/algebra/scan/literal-shapes.ts):union(number().gt(0), lit("a"))对非字面量 number 实参误报。修法:三值聚合 —— 全部成员确定假才报;不可判定且域容纳该形态 ⇒ 整条 union 保持未决。- 显式
undefined被当成值(core/algebra/scan/literal-args.ts):d1(undefined)对带默认值 的形参报约束错误。修法:显式undefined⇒ 走默认值。 - 默认值填充只在零参时发生 ⇒ 假绿(
core/algebra/scan-literal-calls.ts):e4(1)缺失的尾部位不补(运行时 x = -5)⇒ 静默。修法:补齐所有缺失的尾部位置。 - switch 分组 case 标签的
hit收窄不安全(core/algebra/exec/transpile/stmt-predicates.ts):const x = null; switch (x) { case null: case "ab": return x.length; }原生抛 TypeError, 引擎按源码推导读"ab".length⇒ L2 may-throw 消失。case 0:还会把-0重绑成+0(原生1 / -0=-Infinity,引擎算成Infinity= 自信的错值)。修法:只有同体全部 标签都是原始字面量才产命中事实;0按交集细化{0, -0}。 lit(NaN)契约被判自相矛盾 ⇒ 假红(core/algebra/interface.ts):字面量值比较用!==⇒NaN !== NaN⇒ 同一个lit(NaN)自比被判成「两个不同字面量」⇒nudo:interface-conflict。修法:改用既有 helpertermEquals(===+ NaN 特例)。- import 别名撞 ambient builder 声明 ⇒ 整个 sidecar 装载失败
(
core/algebra/refine.ts):import { number as string } from "@nudojs/core"与包装器的const { number, string, … } = __nudoInjects同处一个外层作用域 ⇒ SyntaxError ⇒ 侧车整体 装载失败 ⇒ 契约全丢。修法:显式 import 的本地名从 ambient builder 名单里排除。 autoBind:false下不可读的 ambient sidecar 仍被报成 error ⇒ 假红 (core/algebra/load-deps-fp.ts·core/algebra/check.ts):指纹计算的推测性读取 走的是分析读通道 ⇒ EACCES 被收口成 error;而那份侧车在autoBind:false下根本不会被 绑定。修法:推测性读走未经降级闸的通道(读失败只让指纹标readError)+ 按 ambient 绑定资格 gate。- 缓存的 sidecar 诊断丢失依赖归属(
core/algebra/refine.ts):root→dep 递归求值共享同一 diags 数组 ⇒ 依赖侧车的诊断一律记到 root 名下。修法:诊断带来源文件并纳入去重键。 lit(1n)的大字面量被提前过滤 ⇒ 假绿(core/algebra/contract-face.ts):bigint 过滤 发生在literalMeetsConstraint之前 ⇒lit(1n)契约下返回2n的被调函数被判满足 ⇒ 违约被放过。修法:bigint 参与比较(1n !== 1,与 number 不混同)。
机器面 / 契约面 / 工具链(8 条)
@nudo:skip签名分支输出旧机器面(core/algebra/check.ts):JSONdisplay带#exact而终端显示number⇒ 机器消费方拿到的是人类面之外的文本。修法:与其它路径 同款(formatSigCached)。- 内部临时名遮蔽用户标识符(
core/algebra/exec/transpile/{member-path,expr/assignment, expr/call,expr/optional-chain,expr/short-circuit}.ts·helpers.ts):引擎写死的__nudoMp*/__nudoDefR/__nudoReArgs/__v会遮蔽用户源码里的同名绑定 ⇒ 自信错值 或 TDZ ReferenceError(⇒ 闸门假红);模块级同名还会撞出重复声明 SyntaxError ⇒ 整模块 fail-closed ⇒ 闸门假绿。修法:改用既有internalTmpName/internalTmpNameSet(无碰撞时基名原样返回 ⇒ 产物逐字不变)。 - CJS 对象字面量导出的普查键必须是成员键(
core/algebra/export-slot.ts):module.exports = { greet: function inner(x){…} }的侧车契约整个不绑定(只剩unproven-return警告、签名退成unknown⇒ 假绿),且内层 id 与成员键碰撞时映射串。 修法:导出槽映射只用成员键。 leq的 fn arity 只比较必需参数个数(core/algebra/leq.ts):(a = 1, b) => b.toFixed()被接受为单参目标(原生g(1)抛 TypeError)⇒ 判定比原生松 ⇒ 假绿。修法:按最后一个必需 参数的位置比较。- 生成的守卫对
new Proxy(...)抛错(core/algebra/denote.ts):x instanceof Proxy在 原生抛 TypeError(Proxy 没有 prototype)⇒ 守卫产物一跑就炸。修法:对无可用 prototype 的构造器跳过身份子句。 - 超参 warning 忽略可选/默认槽位(
core/algebra/diagnostics.ts):f(a, b = 1)被f(1, 2)调用时误报「takes 1 argument(s) but 2 were passed」。修法:上界按非 rest 形参总数。 - 多行
@nudo:case … !! throws声明丢失(core/algebra/directive-scan.ts):case 参数跨行 时后缀正则匹配不到 ⇒ 申报的 throws 丢失 ⇒nudo:entry-may-throw假红。修法:先在完整 注释里找平衡的 case 参数终点再识别后缀。 export default C的类入口被漏(core/algebra/scan-top-functions.ts):Babel 的Identifier字段是name(代码读的是d.id?.name⇒undefined)⇒ 类入口不在入口表里 ⇒ 构造器入口闸门看不到它 ⇒ 假绿。
async 运行时(2 条)
- callee 有 2 个及以上 await 时 caller 提前恢复(
core/algebra/exec/runtime/async.ts): 队列为[callee-resume, caller-resume]⇒ callee 的第二次续体排在 caller 之后 ⇒ caller 读到占位符。实测async function g(){ log.push(1); await null; log.push(2); await null; log.push(3) }原生"1,2,3"/ 修前"1,2"/ 修后"1,2,3";return await h()原生7/ 修前unknown/ 修后7。修法:live promise 维护 pending 态 + waiter 列表,await 的 恢复排在 settle 之后。 Promise.all取调用期快照(core/algebra/builtins/promise.ts):元素尚未 settle 时取到 占位符 ⇒ 兑现值被永久冻住;元素拒绝通道丢失 ⇒ 拒绝臂成死代码(假绿)。修法:组合子 自身 pending,元素 settle 后重算聚合;任一元素确定拒绝 ⇒ 组合子短路拒绝。
约束构造器(1 条)
.int()暴露给非 number builder ⇒ 同一约束两个裁决(core/algebra/constraint.ts):literalMeetsConstraint("abc", string().int())(域面)接受"abc",而 Abs/投影面却带整数 谓词。修法:非 number builder 上.int()抛错(与shift()同口径)。同批收口:fn()缺字段表守卫、boolean().gt(1)/string().length(-3)等恒假契约(假红)、array(1,2)静默丢元素约束(假绿)。
文档 · changeset · 诊断注册表(4 条)
- 自称破坏性的 vite-plugin changeset 声明为 patch(
.changeset/fix-vite-plugin-s{1,3,4}.md等 32 个):按docs/versioning.md逐个复核并校正 bump 级别(pre-1.0 的破坏性 ⇒ minor; 1.x+ 的 JSON 形状变更 / 默认严重级变更本应 ⇒ major,但本项目尚无外部用户 ⇒ 本批 统一以 minor 发布,见上方「bump 级别说明」),并补**BREAKING**:与迁移说明。 - 设计文档引用了被 gitignore 的产物(
docs/design/generator-laziness.md·docs/design/architecture-debt.md):tmp/…路径(读者不可达)、bun命令、过时行号、$gen发射点数目(3 ⇒ 实为 4)。修法:删交接笔记、引用符号名、指向仓内回归钉。 - 中文 API 文档漂移(
packages/website/i18n/.../api/{agent,cli-reference,lsp,harvester, service}.md):手写页与 EN 现状不一致(--json的形态、force?: boolean、旧契约…)⇒ 逐页同步;同时收紧文档覆盖闸门(docs-coverage.test.ts)让手写 api 页也进闸门。 - 诊断码绕过注册表(
packages/core/src/algebra/diag-codes.ts·packages/nudojs/src/commands/migrate.ts):nudo:migrate-strip-failed此前直写字面量 ⇒ 进DIAG注册表并由 CLI 引用常量。
附带(不改变对外行为)
nudo init的祖先配置继承口径与加载器对齐(本包已有nudo键 ⇒ 祖先不可继承 ⇒ 不再用 祖先配置当拒绝理由,消除「拒绝 + 不可修复」的死锁)。contract --help的--json描述、contract --from-dts的拒绝提示(同时给出--force与NUDO_DRAFT_FORCE=1;人工改过的草稿永不被覆盖这条口径不变)。nudo:migrate-strip-failed进注册表;interface缓存面新增undecidable透传。- 6 条被放松/空转的既有测试恢复为强断言(
check-regex-capture-narrow-136·eval-loop-return-join·eval-bug-499·core-bug-1064·loop-pack-shadow-soundness·core-bug-1079)—— 此前它们在 main 上也通过,钉不住任何回归。
-
-
dde4b03: BREAKING: dts 面的投影形状变了 ——
.d.ts现在按模块面装配 (类作为类声明投影、成员在类体内;export default保持默认形态;export * from/export { x } from的再导出被复现);standard 面的输入面 导出名也统一成<fn>Input(解构形参不再导出字段级校验器act_a/act_b)。谁会坏:消费方
import生成.d.ts的类型并按旧形状引用的代码 ——- 类成员此前被摊成模块级声明(源码里并不存在这些顶层符号)⇒ 旧
.d.ts的形状与新.d.ts不同 ⇒ 消费方tsc --noEmit会红; - 再导出的符号此前整个缺失 ⇒ 现在出现(反向:依赖「它不在」的代码会冲突);
- standard 面解构形参的
act_a/act_b导出移除,改为<fn>Input。
怎么迁移:重新生成产物并按新形状引用(类成员走
Class.member,再导出符号现在 可用);standard 面改 import<fn>Input。Cross-shard wiring for the
service-emitbatch: the CLI now feeds the product faces the same information the analyzer holds, and a frozen witness no longer takes over a function's published type.nudo export --format standardbuilds its module with the service assembler (absToStandardSchemaFunction) instead of a hand-rolled projection, so the standard face has the same input validator as the zod face (<fn>Input, one validator for the whole argument object) and a destructured parameter no longer exports field-level validators (act_a,act_b) that reject the correct argument.- The dts face is now assembled from the module surface: a class is
projected once as a class declaration (members inside the class body)
instead of one flat declaration per member,
export defaultkeeps its default form, andexport * from/export { x } fromre-exports are reproduced. Before, the class members were emitted as module-level declarations that did not exist in the source and a re-exported symbol was missing from the.d.tsentirely. - A contract that declares an optional parameter now reaches the product
faces: the constraint's
isOptionalis carried explicitly (the entryAbsdoes not keep it), so the zod input object renders.optional()and the dts declaration usesx?: T. nudo contract --emitrenders each diagnostic exactly once. The emit summary already renders and consumes the issue list, so the CLI's trailing error-only loop printed the same diagnostic a second time on the dry-run path.nudo contract --emit --writenow exits non-zero when it refuses to overwrite a hand-edited draft. The file is left untouched (as before), but a silent exit0told CI that the draft had been regenerated.nudo check --fixstates explicitly when the fix did not turn the gate green but changed the diagnostic instead (for example the oldconstraint-violatedbecame a newentry-may-throw). The previous message ("N residual error(s) remain") read as if the fix had worked.nudo exportno longer collapses a function's published type to a single frozen call site. A@nudo:casewitness without an assertion observes one point; it is not a domain claim, so it must not own the return face.nudo test --freezewrites exactly such a witness, so freezing a call used to narrow the zod face toz.literal(3)and the guard face todata === 3— a guard that rejects every legal call — whilenudo checkstill reportednumber | stringfor the same function. A function whose only evidence is a point witness now keeps its inferred domain, and the zod, standard, guard and dts faces agree with the check face.nudo testclassifies a case as synthetic by its source instead of by its name. A witness written by--freezeis named after the call site (call@<file>:<line>) but is declared in the source, so it was reported as synthetic and the run claimed "no declared @nudo:case expectations" even though the source now declares one.nudo contract --emitremoves a generated section whose export no longer exists in the source. The stale section kept the name occupied in the sidecar, so a hand-written contract for a new function of the same name produced an invalid sidecar.- A rest parameter is now observed as a variable-length argument, and
the entry fallback observation of it is marked uncertain. Before,
xs.lengthwas observed as the literal1of the single placeholder argument, and the zod, standard and guard faces projected that one-off observation as the output domain (literal(1)) — a validator that rejects the value the exported function itself returns — while the dts face wrotenumber.
- 类成员此前被摊成模块级声明(源码里并不存在这些顶层符号)⇒ 旧
Patch Changes
-
5749924: 族 21 修复 C1:Bug 674 682 683 691 947 948 949 ——
nudo health的诊断与判定面。- 674:
health把所有非 drift 的分析诊断丢掉 → 坏掉的侧车在 health 面 绿灯(假绿)。现在 analyzer 的 error 级诊断(「分析错误」:nudo:interface-load/nudo:module-missing…)进report.error⇒ok:false/errors≥1/ 非零 exit,与nudo check对同一路径同口径 (口径 =guides/health.md的 health 门「Analysis errors」)。 - 682:witness drift 计数不再用「新集合大小 + 旧集合大小」的和式
(把同一条见证的改写拆成 +1 new / -1 removed 各计一次 ⇒ 只改 1 条见证报
「2 条变更」,且与同屏 Summary 的「1 case drift」自相矛盾)。改为按见证
身份(调用点)逐条比对的实际变更条数(同一条见证被改写只计 1 次);
--json面额外给出drift.changed(机器面可拆分 new / changed)。 - 683:
health --from的使用点一条调用记录都没有时,整段漂移检测被 静默跳过 ⇒ 见证早已陈旧仍报Result: OK/ exit 0(假绿)。现在显式报 「无法判定漂移」(nudo:path-missing-callsite+fix:提示)并判红; 没有冻结见证时「0 drift」属实 ⇒ 不发假红。 - 691:
health的契约漂移判定不施加 mock 通道 ⇒ 同一份陈旧生成段,nudo check报nudo:interface-drift而health报 0 contract drift / OK / exit 0(假绿 + 跨动词自相矛盾)。现在契约漂移判定与nudo check同口径(同一注入包装配:模块图 + mocks + env 全局 + replace/as)。 - 947:
health不设「分析目标」闸门 ⇒ 把.d.ts/ 侧车 /.jsx当成 已检查的源文件并报「Result: OK」(exit 0),而check/test对同一 路径 exit 1「Not an analysis target」(假绿 + 跨动词自相矛盾)。现在目标解析 与 check / test 同口径(isNudoTargetPath闸门 + 同款pathNotTarget错误:同样的 message / suggestion)。 - 948:
health --json在空目标集时给出"ok": true+"files": []+ exit 0 ⇒ 机器消费者读到「一切正常」,而实际上一个文件都没检查。现在 空目录与 check 同口径判红(nudo:path-empty-dir+ok:false+ 非零 exit)。 - 949:
health的uncovered指标在结构上恒为 0(过滤式恰好排除了文档 定义的「entry fallback」那一类)⇒ 文档承诺的「uncovered ⇒ Reported, informational only」永不成立;机器面读出的"uncovered": 0恒为假。 现在uncovered= 「无调用点证据(回落 entry@)」的函数(口径 =guides/health.md)⇒ 文本面逐个点名报出,机器面summary.uncovered真实; 仍是 informational only(不判红)。
- 674:
-
5749924: 族 21 修复 C2:Bug 687 688 925 927 929 —— health 的输出面与 watch 面。
- 687:文本面与
--json面的 error 计数同源(文件内 error +--from路径错误 ⇒totalErrors)⇒ 同一轮两个面不再给出两个数字(此前文本面 「0 error(s)」+ JSON 面summary.errors: 1)。 - 688:
health的--from多值语义与check/contract同口径 —— 多文件--from被接受(nudo health lib.js --from a.js b.js), 分析目标仍是lib.js;多值时 stderr 如实说明「--from之后的裸 token 全部按使用点文件处理」。无位置路径时仍是 usage error(文案如实: 此时 paths 确实为空,与 check / test / contract 同款)。 - 925:
health --json的机器面序列化 budget 截断快照 (files[].budget,与nudo check --json同源同义)+ 多文件聚合出summary.budgetTruncated⇒ 文本面报「budget truncated / 结果被宽化」时, 机器消费者也拿得到truncated标志(此前 JSON 面给"ok": true的 「干净」报告)。 - 927:
health --watch在装 watch 之前做路径存在性校验 ⇒ 缺失路径 与无 watch 面同款(File not found上屏 + exit 1)且不装 watch ⇒ 不再是「静默空会话 + 绿」(假绿)。 - 929:watch 的 runner 按轮去重(
startWatch的onRoundStart)—— 一轮只跑一次runHealth⇒ 首轮只产出一份完整报告(此前按文件数重跑整个 路径集 ⇒ N 份报告 / N 份 JSON 文档 ⇒JSON.parse(stdout)必炸)。
- 687:文本面与
-
5749924: 族 21 修复 C3:Bug 671 684 685 686 689 1026 —— 目录扫描与 watch 路径面。
- 671:目录目标的文件收集跟随符号链接判定(
statSync),链接进来的 文件 / 目录不再被静默丢弃 ⇒check <dir>不再对链接进来的坏文件假绿 (exit 0),目录链接按 realpath 防环。 - 1026:目录发现复用产品唯一的范围闸门(
shouldAnalyzeFile)⇒ 产品默认安全排除三条全生效(node_modules / dist / coverage,此前 CLI 只抄了 1/3)⇒dist/里的陈旧构建产物不再被当源码门禁(nudo test <pkg>不再假红),CLI 与 IDE / vite 对同一文件结论一致。 - 689:watch 扫描走同一个 service 闸门 ⇒ 应用
nudo.analysis.include/exclude(文档承诺「watch 扫描:应用」), 不应用 mode ⇒ 与 IDE 对同一文件口径一致;CLI 非 watch 的目标扫描仍 忽略 include/exclude(「点名路径即意图」)。 - 684 / 685 / 686:watch 的监视根按每个路径各自解析(目录→该目录, 文件→其所在目录),事件路径按所属监视根换算 ⇒ 多路径且首个是文件时 watch 不再彻底失效,同目录多文件时变更文件不再被误记成首个路径,跨目录 路径时其余目录不再是盲区;关闭句柄一次关掉全部 watcher。
- 671:目录目标的文件收集跟随符号链接判定(
-
5749924: fix(cli):
check --abs观察面与 watch 输出面的产品面修复check --abs --fn <不存在的名字>:拼错的名字不再被报成「引擎推导失败」 (unknown / conf: partial),改为与「文件里没有该函数」同款的用法错误 (stderr +fix:提示)+ 非零 exit。check --abs --assume <坏值>:坏值不再被静默吞掉(命令照跑并 exit 0), 改为用法错误 + 非零 exit,且不进入观察面。check --abs:有效契约(源码@nudo:contract+ 侧车*.nudo.js)约束的 形参真的进求值(与签名表同源),不再回落any—— 同一函数在check(g(x: number) => string)与check --abs(g(number) => string) 两个面上不再给出互斥的类型。check --abs --assume:>=不再一律按>构造(x>=1过去实际得到x>1);多条假设合取(过去互相覆盖,只有最后一条生效);与--generalize组合时显式拒绝(该模式没有 Φ 入口,旧的「接受并回显、 然后忽略」是静默说谎)。- watch 横幅(人类进度)一律走 stderr:
nudo test --watch --json/nudo health --watch --json的 stdout 现在是纯 JSON(JSON.parse(stdout)不再抛)。 - watch 增量轮:env 模板判定排在
isNudoTargetPath之前(旧的 env 反向边 分支是死代码 ⇒ 改了 env 模板,依赖它的源文件永不复分析)。
-
5749924: fix(cli):
nudo init的幂等判据 / 作用域 / IO 错误面 / 写盘保真度,与migrate strip的机器面nudo init的幂等判据与配置加载器的真值判据对齐(packages/service/src/evaluator/config.ts的readNudoKey):只有「nudo键存在 且 值是非 null 的非数组对象」才算 一份有效配置。形状非法的值(null/ 标量 / 数组)过去让 init 报「already has a nudo config」而一个字节不写(加载器却按「无配置」提示你去跑nudo init⇒ 死循环), 现在被替换成 adoption 基线。nudo init不再遮蔽祖先配置:祖先 package.json 已有有效nudo配置时, init 拒绝写入遮蔽键(error:/fix:引导 + exit 1)—— 过去它静默写下一个nudo键,让 monorepo 根的 strict 档整段消失,红的 CI 门禁被静默翻绿。nudo init不再向上逃逸:最近的 package.json 若是 workspace / 容器根 (pnpm-workspace.yaml/lerna.json/package.json#workspaces/ 常规 workspace 目录下的子包),init 拒绝写入(提示先给目标包建 package.json)—— 过去它把基线写进仓库根,整个 monorepo 的门禁档被改。nudo init的 IO 失败路径可区分:读失败报「cannot read」(过去被误报成 「不是合法 JSON」),写失败不再冒泡成裸 errno,而是「cannot write」+fix:引导 + 非零 exit。nudo init写盘改为最小改动:只在原文本上插入 / 替换nudo键,其余字节 逐字保留(缩进单位、键序、冒号后空格、换行风格、尾换行状态)—— 过去整份JSON.stringify(pkg, null, 2)重写,把 4 空格缩进规范化成 2 空格、把整数样键 重排、并强行补尾换行。nudo migrate strip逐目标收集结果:一个目标失败(语法错)不再吞掉其它目标 的成功结果;--json失败时 stdout 仍是合法 JSON(ok:false+results+ 带文件名的pathErrors),stderr 带文件名。nudo migrate strip --write在写盘之前检出「剥完仍有 TS-only 语法」的目标 (类成员修饰符private/public/protected/readonly、构造器参数属性) 并拒绝写盘 + 响亮报错 —— 过去它静默写出一个 Node 解析不了的.js(migrate 是一程闸门,写坏了没有回退路径)。产物本身可解析仍取决于packages/core/src/strip-types.ts的降级发射面。
-
5749924: Five CLI-surface fixes (flags / JSON envelope / watch / config robustness).
--what-ifnow acceptsname=typeas well asname:type. The documented commands (guides/ai-native-dx.md, reference/agents.md) use the equals form; the parser only accepted the colon form, so the whole token was taken as the binding name and the assumption silently did not apply ("Bindings not applied", exit 0).package.json#nudo.check.ignoreThrowsis parsed by the same parser as--ignore-throws(comma-separated, trimmed, bare string or array). The config side used a strictstring[]filter, so"TypeError"and["TypeError,RangeError"]were silently dropped and the gate stayed red although the throw class looked ignored. A malformed value (number / boolean / object) falls back to the default and prints one stderr warning.- The
CheckJsonMultienvelope no longer counts--frompath errors as analysis errors:summary.errorsequals the sum ofreports[].summary .errorsequals the human-face count (the contract core asserts). Path errors stay inpathErrors[]; a non-emptypathErrorsstill meansok: falseand exit 1. nudo check --watch --fromre-collects the call-site evidence every round instead of using a start-up snapshot, so a dependent file and its caller no longer give opposite verdicts for the same call in the same round. Missing call-site evidence turns the round red instead of silently reusing stale data.package.json#nudo.envwith a non-array value is reported as aconfig-shapewarning (file name + diagnostic code) in both the human and the--jsonface, and the consumption point no longer iterates it blindly.
-
79d7feb: fix(nudojs): CLI 机器面的 3 条(族 56 · nudojs CLI 面)
这 3 条都是机器消费者能看见的问题(
nudo migrate的--json面 / 迁移 闸门):- 排除清单未上 stdout(
migrate status/migrate retire --all):排除 清单(pnpm 负向模式!packages/legacy命中的包)此前只出现在 stderr 的人读行 ⇒ 机器消费者看不到「哪些包被排除了」。现在它同时进 stdout 的 机器面:--json的每行/每条结果多一个excluded字段(相对扫描根的 posix 路径,与 stderr 那行逐字一致)。口径:只在有排除时出现 ⇒ 无排除 时--json输出与旧版逐字相同;文本面 stdout 不变(stderr 那行人读 提示仍在原处)。 - 多目标退役的错误消息只带第一个失败目标(
migrate retire <a> <b>):migrateRetireMany此前遇到第一个失败就抛 ⇒ 其余失败目标丢失 (用户以为只有一个包有问题)。现在消息列出全部失败目标(<原因> (target: <目标>)之后追加<目标>: <原因>清单),--json面另有结构化的failedTargets。原子性不变:任一失败 ⇒ 整批零写盘;单个失败的消息与旧 实现逐字同形。附带修一处假绿:一批里混着「无可退役」与真错误时, 旧口径按第一个失败项定 exit(真错误被当成正常结果 ⇒ exit 0)⇒ 现在 「全部失败项都是无可退役」才算正常结果,否则报红。 - verify 的扫描面不含
.jsx(migrate verify):verify 此前复用 service 的isNudoTargetPath(排除.jsx)⇒ JSX 产物(旧migrate strip的.tsx → .jsx映射产物,Node 加载不了)对迁移闸门不可见 ⇒ 闸门对不可 加载的产物发绿灯。verify 现在自己算扫描面(纳入.jsx/.tsx/.cjs;声明文件 / 侧车 / draft 产物仍不是目标 ⇒ Bug 566 同口径不变)。 ⚠ 根因仍在 service(isNudoTargetPath排除.jsx)——nudo check/nudo health/nudo test共用那条规则,本片只做 CLI 侧兜底。
- 排除清单未上 stdout(
-
ae9a2b9: fix(nudojs): health 文本面量纲 /
pathErrors[]命名 / watch 多轮 JSON 形态(族 63 · nudojs CLI 协议面)这 3 条都是机器消费者能看见的问题(
nudo health的报告面 +--json面、--watch的 stdout 形态):- health 文本面两处量纲不一:Summary 的「N case drift」计的是有漂移的
文件数,而同屏明细行计的是见证条数 ⇒ 同一份报告里两个「N」量纲不同
(一个文件里两条见证陈旧 ⇒ Summary 印「1 case drift」、明细行印「2 witness
directive(s) changed」⇒ 用户读到的数自相矛盾)。现在 Summary 的数 =
见证(case)条数(= Σ 各文件明细行的条数)⇒ 标签「case drift」(一条
@nudo:case见证指令)与数字终于同义;--json面的summary.drift同一 量纲(= Σfiles[].drift.(added+removed))⇒ 文本面 / JSON 面 / 每文件 明细行三个面同一个数字、同一个量纲。 ⚠ 机器契约变更:--json的summary.drift的单位由「有漂移的 文件数」改为「见证条数」(无漂移时仍是0⇒ 无漂移场景的输出逐字不变)。 「有漂移的文件数」仍可由files[]逐条数出(summary.files是文件总数)。 pathErrors[]命名漂移:C1 把「分析目标闸门」错误(非分析目标 / 空 目录 / 路径不存在)也推进了同一个 sink ⇒ 该数组名不再只表示「--from路径 错误」⇒ 机器消费者按名字误读。既有字段pathErrors[]的名字与内容逐字 保留(兼容既有机器消费者:它是路径级错误全集)⇒ 另新增一个可选 字段targetErrors[](分析目标闸门错误的精确子集)⇒ 语义可见、旧字段 兼容、事实不丢。(--from路径错误不进targetErrors[]⇒ 新字段是精确 入口,不是副本。)- watch 多轮累积的 JSON 形态:第 2 轮起 stdout 里会有第 2 份文档 ⇒
机器消费者的
JSON.parse(stdout)直接炸("Unexpected non-whitespace character after JSON")。现在--watch --json的 stdout = JSON Lines (每行一份完整 JSON 文档;nudo health --watch --json一轮一份,nudo check/test --watch --json一轮每文件一份)⇒ 机器消费者可逐行JSON.parse,不再随轮数炸。非 watch 的单轮输出逐字不变(仍是一份 pretty 文档);watch 横幅继续走 stderr(stdout 保持纯机器面)。
- health 文本面两处量纲不一:Summary 的「N case drift」计的是有漂移的
文件数,而同屏明细行计的是见证条数 ⇒ 同一份报告里两个「N」量纲不同
(一个文件里两条见证陈旧 ⇒ Summary 印「1 case drift」、明细行印「2 witness
directive(s) changed」⇒ 用户读到的数自相矛盾)。现在 Summary 的数 =
见证(case)条数(= Σ 各文件明细行的条数)⇒ 标签「case drift」(一条
-
5323af0: fix(nudojs):
pathErrors[]命名漂移 —— check / test / contract 三个动词补齐targetErrors[](族 63b)pathErrors[]这个名字原本只承诺「--from路径错误」,但 C1 把「分析目标 闸门」错误(路径不存在 / 空目录 / 非分析目标)也推进了同一个 sink ⇒ 数组名不再副实 ⇒ 机器消费者读pathErrors[]时会误以为里面全是--from路径问题。口径与
nudo health(族 63 · health 面)同款,三个动词统一:pathErrors[]:有序全集,字段名 + 内容 + 顺序逐字不变 (既有机器消费者零影响;--json的既有场景 stdout 逐字不变);targetErrors[](新增的可选 JSON 字段)= 分析目标闸门错误的 精确子集--from路径错误不进它(它是精确入口,不是副本);- 闸门错误同时留在
pathErrors[]里(全集不变 ⇒ 不丢事实);
- 无闸门错误 ⇒
targetErrors[]不出现(既有场景输出逐字不变)。
覆盖动词:
nudo check --json(CheckJsonMulti 信封)、nudo test --json(CaseJson 信封)、nudo contract --json(聚合信封的错误条目)。 人类面(stderr 文案)逐字不变。 -
a069994:
nudo checknow explains mock-load failures with the suggestion that fits the failure, instead of one generic sentence.- A duplicate
@nudo:mock-moduledeclaration (nudo:mock-invalid) used to be answered with "Fix the @nudo:mock expression", which points at the wrong problem. It now says to remove the duplicate declaration and keep one directive per module specifier. - A mock file that does not export the named binding
(
nudo:module-missing) used to be answered with "Create the mock file", although the file exists. It now names the missing export and the mock file path, and suggests adding the export or dropping it from the directive. - Diagnostics, severities and exit codes are unchanged; only the
suggestion line differs.
nudo checkandnudo migrate verifynow use the same helpers as the editor and agent surfaces, so all of them report the same suggestion for the same file.
- A duplicate
-
3ce08ae: fix(nudojs):
migrate strip库面改逐文件错误隔离(族 56b · Bug 696 的库面半边)台账里的「
migrate verify库面整批 abort」经实测已不成立(migrateVerify早已逐文件隔离:同目标内部分文件语法错 ⇒ 失败文件记analysis-error、成功文件 照常返回);仍整批 abort 的是同族的migrateStrip——planStrip→makeStripPlan遇解析错即throw⇒ 同目标内其它文件的成功结果全丢(且与 verify 的口径不一致)。现在解析失败降级成一行错误(结构与
migrateVerify的逐文件错误行同款:code+error,error带文件名;失败码沿用 verify 的analysis-error,不另立 码表)⇒ 库面与 verify 同口径:先算完全部结果(含错误行)⇒ 再决定写不写。- 原子性不变:任一文件失败 ⇒ 整批零写盘(成功文件也不落盘)——好性质保留, 没有为「不丢结果」改成部分写盘;写盘模式下成功行会附一条「未写盘」注记 (防调用方把「计划成功」误读成「已写盘」)。
- CLI 面逐字不变:
nudo migrate strip的 stdout / stderr / exit code 与改前 逐字相同(失败详情沿用旧文案parse failed: <文件>: <原因>);失败目标仍 判失败(exit 1)、不进results。 - 成功行的字段逐字不变(负控:成功行不带
code/error键 ⇒--json的 成功信封与旧版逐字相同)。 - ⚠ 仍整批 throw 的两类错误(未改):
.tsx不可迁移(Bug 583 的产品判定)与 目标级用法错误(not found/ 非 TS 源)——它们不是逐文件的解析失败。
-
b37321b: The command line now answers the same questions as the editor, and stops answering them differently.
nudo checkandnudo healthdisagreed about an export that has no contract root: the health report counted it, the check report did not mention it. The check report now lists it asnudo:interface-entry-only.nudo:mock-invalidwas reported as an error, although the reference says it is a warning, and the same file reported it as a warning on another path. It is a warning now. The gate itself does not change: an explicit contract and the entry-throws rule are unaffected, and a mock file that is missing is still an error.nudo test --frompointed at a file that could not be parsed or evaluated reported nothing and exited successfully, which is indistinguishable from "no call sites". The failure is reported and the run exits non-zero.- A
package.jsonwhosenudokey is not an object — or is a falsy value — was accepted without a word. The check report now says the configuration could not be read, and the "this project has no Nudo configuration yet" hint is not shown. - An import cycle made every file in the cycle report
unknown. The dependency graph is no longer dropped, and a genuinely recursive cycle is truncated by the recursion budget instead. - The vite plugin never read the path-env load failures, so a
@nudo:env ./missing.jsthat failed to load was invisible during a build. The failure is reported now. - An unreadable dependency was described as a missing file.
-
5749924: 族 21 收口接线:把各分片「越界发现」里明确交给主 agent 的接线项补齐 —— 以及一条真源缺口(672 的剥除面在 core,不在 CLI)。
Bug 672 的真源(core
strip-types.ts) ——nudo migrate strip --write写出的.jsNode 解析不了:private/public/protected/readonly/abstract/override/declare这些类成员修饰符原样保留,构造器参数属性 (constructor(private opening: number))也原样保留 ⇒ 产物仍是 TS。 现在:- 类成员修饰符被剥掉(只在类成员节点上删 —— 这些字段名在别的节点上没有 TS 语义);
- 构造器参数属性降级成「普通形参 + 构造器体开头补
this.x = x」 (TS 语义 =「字段 x + 构造器里this.x = x」;字段声明不必显式写 —— JS 的this.x = …就是动态字段,语义等价)。Babel 7 的TSParameterProperty包装节点与 Babel 8 的「修饰符直接挂在参数上」两种 AST 形态都认。
Bug 670 的越界(
nudo contract --json) ——runContractPrint完全不看opts.json⇒nudo contract --json把人类文本(<file>+ 每行签名)写进 stdout ⇒JSON.parse(stdout)抛错。--json是机器面 ⇒ 现在 stdout 是 合法 JSON({ file, entries: [{ fn, signature }] }),人类面不变。Bug 1026 的残留(
migrate的发现清单) ——migrate verify的扫描集合此前只 抄了产品默认安全排除 3 条里的 1 条(node_modules)⇒dist/与coverage/的 陈旧构建产物被当源码门禁 ⇒migrate verify(绿)与migrate retire装上的nudo check .(红)扫描的文件集合不同。现在补齐 3 条(另排除.git/.nudo)。Bug 928 的 test 面同机制 ——
nudo test --watch --from的调用点证据此前是 启动快照、每轮从不刷新 ⇒ 同一轮里两个文件对同一次调用给出相反裁决,且与同一 磁盘状态下的全新非 watch 运行结论相反。改为每轮开跑前重采(与nudo check --watch --from同口径);本轮证据缺失 ⇒ 本轮红。Bug 693 的钉真落在 watch 形态 —— 该钉原先用
node tsx/dist/cli.mjs <cli> … --watch起子进程:tsx 的 CLI 会把--watch当成自己/node 的旗标吞掉 ⇒ 子进程的process.argv里没有--watch⇒ CLI 根本没进 watch 形态 ⇒ 钉在测 非 watch 路径(假通过)。改用共享的 watch runner(node --import <绝对路径的 tsx loader>+ 显式追加--watch)⇒ 钉真的落在 watch 形态上;runner 另支持 「等 stdout 里出现一份可解析的 JSON」(谓词分开收 stdout / stderr —— 合并判断会被 stderr 的横幅干扰)。Bug 948 的文本面对称 —— 空目标集现在
ok:false+ 非零 exit ⇒ 文本面必须 有裁决行,否则出现「exit 1 但无 Result / 无 Summary」⇒ 与 JSON 面不对称。既有钉的契约适配(2 条) —— 695(信封
summary.errors不再含路径错误)与 672(真源修好后命令层闸门不再拦)两处契约变更使既有钉失配 ⇒ 按新契约改钉 (不是回退修复)。nudo init的文档漂移 —— 新行为(非法值被替换 / 拒绝遮蔽祖先可继承配置 / 拒绝越界写容器根)此前未写进文档 ⇒ 同步docs/design/cli-semantics.md、packages/website/docs/guides/cli.md、packages/website/docs/api/cli-reference.md(及 zh-Hans 版)。 -
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
2d96c29:
@nudojs/service新增公开导出absolutizeEnvSpec(env 规格的绝对化入口) ⇒ 纯增量(additive)⇒ minor。fix: 并发 review 收口的 10 条缺陷(闸门假红/假绿 · IDE/CLI 口径分裂 · 机器面谎报)
上一片(并发 review 收口 25 条 + 族 65/1094 两轮)之后又做了一轮并发 review(5 个分片 × 只读审查 + 逐条代码层复核)⇒ 查出 10 条该轮改动 引入或遗留的缺陷,本片一次性收口。核心仍是闸门可信度:
nudo check是 CI 闸门,假红卡死用户仓库、假绿让门禁空转。本片新增 7 个回归测试文件(全部含「修前红 / 修后绿」实测),另补 1 个 残留洞(指令作用域闸门)。
高危(4 条 · 闸门级)
-
构造器 may-throw 证据被整体丢弃且「归因落点」根本不存在 ⇒ L2 闸门假绿 (
core/algebra/check-may-throw.ts·core/algebra/scan-top-functions.ts·core/algebra/check.ts):实例方法桥把构造器跑在独立 may-throw 会话里 (软效果不进方法域 ⇒ 假红已消除),但硬抛(无条件throw)也被catch {}吞掉;而注释声称"归因给new C()入口"——该入口并不存在 (scan-top-functions.ts只登记Class.method,跳过 ctor)⇒export class A { constructor(x){ throw new TypeError("boom"); } }在 check 闸门与 test 见证面双面零诊断(0 error / 0 warning / exit 0)。 修法:新增类导出入口普查面listClassEntryNames(new C()是真实入口) ⇒ 类入口并入 L2 入口表(check.ts),构造器的硬抛进 throws 域、报在 类声明位置;构造器的软效果(any 补位的强制转换)仍不进 ⇒ 普通类 不触发 error 级nudo:entry-may-throw(假红不回归)。另:类入口的@nudo:throws申报落点 = 构造器 scope(C.constructor)⇒ 用户已申报不再被卡 (declaredThrowsForEntry)。 -
同一「裸实例兜底」在值域通道产出自信的错值 ⇒ 方法签名折
never+ 假红 (core/algebra/generalize.ts):兜底实例的内层是空 obj ⇒ 构造器写过的 字段被建模成「确定不存在」⇒this.v读成确定的undefined、this.v + 1读成确定的NaN;this.v.toFixed(2)在虚构实例上抛 ⇒ 签名never(谎称"该方法必抛、恒返回 never")⇒ 连带 error 级nudo:entry-may-throw。修法:兜底实例内层改 unknown(构造器写过的 字段 = 不可知,不是"缺槽")⇒ 不折确定错值、不在虚构实例上抛 ⇒ 签名落unknown,且方法体照常求值(不退化成整体 opaque)。与上一条同源,两处 就地复刻的孪生实现已互相点名,防止再漂移。 -
Proxy
getOwnPropertyDescriptor不变量新增规则的 3 处阈值错误 ⇒ 假红 (core/algebra/builtins/object/descriptor.ts):上一片新增的enforceProxyGetOwnPropDescInvariant在 Object 面与 Reflect 面同时接线, 三处口径与 node v26.10.0 不符 ⇒ native 不抛、引擎抛 TypeError ⇒ error 级nudo:entry-may-throw⇒ 直接卡 CI:- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
IsCompatiblePropertyDescriptor只在current.[[Configurable]]为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判; frozen被当成enumerable:false⇒Object.freeze只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);- 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒
defineProperty把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落configurable:true⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen不再改 enumerable;靶侧三标志 统一复用同文件currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
-
项目级 env 的「两层基准」只做了一半 ⇒ 分析器通道丢 env 全局 / IDE 与 CLI 结论相反(
service/src/analyzer-orchestrate*.ts·service/evaluator/env-loader.ts·lsp/src/validation.ts·lsp/src/agent-tools.ts):上一片把项目级 env 改为按项目根解析,但只改了预载侧;收集期仍用原始相对名查表, 而相对说明符只有唯一候选(按文件目录解析)⇒ 与预载登记的 key 不匹配 ⇒ 只要被分析文件声明了任何@nudo:env(哪怕是内建名node),项目级 path env 就对它完全不可见 ⇒ 返回面退never+ 假阳nudo:builtin-unknown; 同时 LSP 的env-unresolved诊断按「记录时的 preload 目录」归档 ⇒ 项目级 env 的失败被静默吞掉(IDE 假绿,CLI 同刻仍报)。 修法:绝对化规则收进env-loader.ts的单一 helper(absolutizeEnvSpec), 预载侧 / 收集期 / 缓存键 / LSP 注入 / LSP 诊断五处共用;LSP 诊断按fileEnvBaseDir + projectEnvBaseDir双取合并去重。改后 IDE 与 CLI 对同一 文件结论一致。
中危(4 条)
-
migrate strip --write把「未写盘」的成功行报成wrote(nudojs/src/migrate.ts·nudojs/src/commands/migrate.ts):库面在有失败时整批零写盘(原子性)并给 成功行附注记,命令层却把注记行当普通成功行推入results,人类面用opts.write ? "wrote" : "dry"无条件打wrote⇒ 同一行既说 "wrote" 又说 "not written",而磁盘上根本没有.js;--json侧只有一条自由文本notes能区分 ⇒ 机器消费方极易误判已产出。修法:新增机器可判定的writeStatus("written"/"not-written"/"planned"),人类面按逐行 状态措辞(wrote/not written/dry)。 -
HOF 元组元素域把已知的 null/undefined 压成
any(core/algebra/hof.ts): 引擎把null/undefined建模成unknown形状 + lit 项,而元素域按 shape kind 判"域是否可知" ⇒ 把已知类型误判成"域不可知" ⇒[null]的元素域从null退成any、[1,null]退成any(应为number | null);any是"自信的任意值",参与算术即强制转换 ⇒ 记 may-throw ⇒ L2 假红面。修法:三分类——已知 nullish(不参与异型判定、只贡献 可空性,用仓内既有makeSum表达联合)、真·推断失败(退unknown, 不是any)、其它(同型判定不变,异型仍退any)。 -
文件级指令的作用域闸门未覆盖
ArrayExpression/ObjectPattern/ArrayPattern(parser/src/directives/file-directives.ts·core/algebra/directive-scan.ts): 写在数组字面量 / 解构模式里的@nudo:env被静默提升成整文件生效(零诊断, 越权)。修法:两侧孪生闸门同步扩到三类嵌套体(两通道 23 组样例逐例一致)。 -
引理账本写入是「死写」(
core/algebra/check-return.ts):Φ 侧的消费在 证明段里记进账本,而调用方传入的consumedAssume快照取自调用之前 ⇒ Φ 侧的写入永远读不到 ⇒ 账本与归因两套口径(changeset 宣称的"经noteAssumeConsumed记进账本 ⇒ 归因可见"实际断在取数时序上)。 修法:归因集就地取账本(读在写之后)⇒ 账本是"消费过"的唯一事实源, 调用方快照退化为兜底。
验证
- 全仓
tsc --noEmit(pnpm run lint)0 错误;pnpm run buildexit 0; pnpm run test全量绿(1757+ 文件 / 14500+ 用例,exit 0);- 新增 8 个回归测试文件,全部修前红 / 修后绿实测(红数由回滚修复逐条复核):
core-bug-1095(Proxy 阈值,22 例 · 修前 12 红)、core-bug-1096(构造器 归因,11 例 · 修前 6 红)、core-bug-1097(HOF 元素域,15 例 · 修前 10 红)、core-bug-1102+parser-bug-1101(指令闸门,79 例 · 修前 12 红)、core-bug-1103(引理账本,5 例 · 修前 1 红)、service-bug-1098+lsp-bug-1099+lsp-bug-1104(env 两层基准,11 例 · 修前 6 红)、nudojs-bug-1100(migrate strip 写盘状态,6 例 · 修前 5 红)—— 合计 149 例; - 产品 CLI 面逐条复现核对:
nudo check对"构造器必抛"报 error 级nudo:entry-may-throw(归在类入口)、对"构造器软 throw"零 error; Proxy 三场景(可配置靶异形态 / 冻结靶 / brand 靶)零 error;migrate strip --write失败批输出not written且磁盘零写盘、--json带writeStatus: "not-written";项目级 env + 文件级 env 并存时nudo check得f() => 42(修前为never+ 假阳)。
已知边界 / 未闭合
- Proxy
gOPD仍有 3 处漏抛(靶不可扩展且键不存在时报configurable:true; 靶不可写+不可配置而陷阱省略value;靶为不可配置访问器且 get/set 身份不同)—— 基线同样不抛(非本次回归),新增抛点有制造新假红的风险 ⇒ 已把 node v26.10.0 实测矩阵写进core-bug-1095测试文件注释,留待单独立项。 - 不可配置访问器靶现在也会比对
enumerable(原生确实抛)——属收紧, 若有用例依赖旧的"访问器靶跳过该比对"需按原生重判。 - HOF 异型元素仍退
any([1,"a"])——既有保守口径,本片未窄化成联合。 - 真·未知 ⇒
unknown会让该 α 恰为返回类型时多一条 warning 级nudo:unknown-inference(级别 warning,不影响 L2 闸门)。 - 进程级
lastEnvBaseDir单槽(同步analyzeFile路径下的文件级相对名) 与 Windows 下isPathEnvName只认/均为既有基线,本片未动。 - MCP
nudo check工具面(同步、无 path env 预载)与migrate strip --json顶层形态不统一(成功=裸数组 / 失败=对象信封)仍待单独立项。
-
-
2af2bae:
nudo checknow sees assignments inside function bodies, judges generated segments against cross-file call sites, and points diagnostics at the offending directive.nudo:assign-mismatchonly covered module top-level assignments: the assignment recorder was installed around the top-level evaluation, but function bodies had already been evaluated (by the generalizer) before that, so every$assignRecordfrom a function body was dropped. Real code assigns mostly inside functions, so the check reported "OK" on functions that assign a string to a number. The recorder is now installed before the function loop, and repeated evaluations of the same assignment site are folded into one diagnostic.nudo:interface-driftnever fired when the call site lived in another file: the "today" evidence came only from evaluating the checked file itself, so a generated segment written with--fromcould not be judged stale.CheckOptions.fromnow carries cross-file call-site records into the same judgment; records are attributed to the checked file, so a same-named function in another module cannot pollute the verdict.nudo:assume-invalid,nudo:invariant-invalid,nudo:contract-syntaxandnudo:interface-conflictcarried no position: the LSP drew the red squiggle at line 1 column 1 andnudo check --jsonreportedissues[].line: null, even when the offending directive was on line 7. All four codes now report the line and column of the directive that caused them.
-
e59c991: Type renderings no longer read as the wrong type, and
nudo check --what-if --targetprints a real return domain instead of?.- A function type inside an array or a union is now grouped with
parentheses.
formatShaperendered an array of functions as(number) => number[], which TypeScript reads as "a function returningnumber[]" rather than "an array of functions", and rendered a union of a function and a number as(number) => number | number, where the|binds to the function's return type. The.d.tsrenderer already grouped both, so the two renderers disagreed about the same abstract value. Function members and function elements are now parenthesized; other member kinds are unchanged. nudo check --what-if --target <function>printed() => ?for the targeted function: the top-level binding's abstract value carries no return type, while the signature table reads a different abstract value. The target now takes the function's real return domain, so the two faces agree; the?placeholder itself is unchanged.
- A function type inside an array or a union is now grouped with
parentheses.
-
e59c991: String unions are now concatenated member by member, and generated line comments no longer carry a block-comment escape.
-
A value that is one of several string literals was concatenated as if the literals were one piece of text.
("a" | "b") + "!"was reported as the single string"ab!"— a value no call can produce, because the real answers are"a!"and"b!". The same happened to`v=${x}`, which was reported as"v=ab". A union now keeps its members apart while it is converted to text, and the two sides are combined member by member, so the result is the union"a!" | "b!". -
The comment cleaner escaped the end of a block comment everywhere it was used, including inside
//line comments, where it has no meaning. The contract draft printed bynudo contract --draft— the text a user is asked to copy into the sidecar — showed/* no evidence — tighten *\/instead of/* no evidence — tighten */. Line comments now keep the text as it is; a line break inside a comment is still flattened, so a comment can never spill out of its line. Block comments (the JSDoc in the emitted.d.ts) still escape it, because there the escape is what keeps the comment from ending early. -
Member results are combined with the engine's existing "same primitive" rule (
joinValues), not as a raw union. Two literal members still form an enumeration ("a!" | "b!"), but a literal combined with a same-primitive arm that carries no narrowing evidence collapses to that primitive — the same rule the rest of the algebra uses. Without it, a union member whose rendering is alreadystringwould sit next to a literal and print as"NaN days" | "NaN day" | string | …: harder to read than the type it describes, and inconsistent with the signature the same function has everywhere else (formatAge(durationMs: number) => string).
-
-
e59c991:
nudo check --jsonno longer ships the engine's internal variable ids, and its signatures now match the ones printed on the terminal.- The machine-readable signature fields rendered the abstract value's
term/predunconditionally. Those terms mix in the engine's internal variable ids (len#0,len#2, …), which are minted by a process-wide counter, so the id a file got depended on the file's position in the command line. Checking three identical files gavelen#0/len#2/len#4, and swapping the order swapped the ids — the JSON payload of a single file was a function of its argument position rather than of its contents. The internal ids are now replaced by a stable name (len#2→len), so the abstract term and predicate evidence survives while the drifting number is gone. signatures[].displayis now rendered with the sameformatShapeprojection the terminal uses, so the machine face and the human face of one command agree:nudo checkprintsf() => numberwhile--jsonused to reportnumber = len#0 where len#0 ≥ 0 #pathfor the very same function. The confidence marker and the branch-join note are still available — through theconffield and thedetail/absfields.
- The machine-readable signature fields rendered the abstract value's
-
5dd89ca: fix(nudojs):
migrate strip的产物面事实回报 + 兜底闸门扩围(族 12 S2)族 12 的六条缺陷(445 / 446 / 447 / 448 / 913 / 968)的根因全部在
@nudojs/core的strip-types.ts(已由 S1 修好)。本片只做产物面:migrate strip的 notes 跟事实(stripTsToJs):notes 现在基于stripTypes的report事实回报,而不是「enum 被删」这一过时口径 —— 运行时 enum 现在是被合成(不是被删除)⇒ note 改成「已合成运行时对象」, 不再误报「runtime semantics lost」。另补:export =/export as namespace被剥除(CommonJS 出口面消失)、this形参被剥除、类型专用 import 被消掉 (tsc 同口径)、保守保留的 import(本地再导出 / 包说明符 / 未引用 ⇒ 产物 可能链接失败)与「指令条数前后不一致」的提示。- 兜底闸门扩围(
migrate strip写盘前的「产物可解析性闸门」):除TSParameterProperty与 4 个类成员修饰符 flag 外,新增认得export =/export as namespace、类成员的x!/y?/m?()、TS 的this形参。零误伤:这些判据在纯 JS 源码里零命中(TS-only 节点类型 / TS-only 字段 /this不是合法形参名)。 - 六条产物面回归钉(
packages/nudojs/src/__tests__/cli-bug-445|446|447| 448|913|968-migrate-strip-*.test.ts):产物必须node --check过、 指令必须存活、门禁行为正确(源红 / 产物同样红,不再假绿)。
migrate verify的语义未改(它的契约是「跑nudo check」);nudojs的 公开导出面零新增。 -
b4768ca: 族 27 收口接线:让三个产物面(内存收割面 / 磁盘缓存面 / 落盘源码面)与 两个产物面(收割面 / 草稿面)在同一份
.d.ts上给出同一个类型。磁盘 ABI v8 → v9 → v10 ——
HARVEST_DISK_ABI随收割语义抬版本。不抬则 用户本地~/.cache/nudo/deps/里的旧收割产物会继续命中 ⇒ CLI 看不到本轮 修复(实测:同一夹具,旧缓存 ⇒useDefault(xs: any) => unknown)。 v10 覆盖收口时又改的三处语义:this形参不再进收割签名(Bug 794)、declare class进入接口成员表并带ctorfacet(Bug 796 / 826)、顶层declare namespace的运行时成员收进命名空间自有记录(Bug 793)。磁盘投影补 facet ——
HarvestSig此前只投影params/returns,把obj的索引签名与开放标志、tuple的 rest、fn的ctor与静态槽全部 丢掉 ⇒ 缓存往返把「开放对象 + 值域」抹成闭合空对象(成员读 undefined ⇒ 定抛)、把「构造器」抹成普通 fn(new落「可构造性未知」⇒ 假红)、把类型 字面量的具名成员抹掉。absToHarvestSig投影 +harvestSigToAbs还原两侧 同时补齐。磁盘投影补条件元数据 ——
fn形态加inferFrom/condFallback:条件 类型判不出时的绑定线索与假支此前不投影 ⇒ 缓存命中后条件元数据丢失 ⇒ 同一份.d.ts,冷缓存与热缓存给出不同类型(实测:改前冷 ⇒callCond()返回0,热 ⇒any;改后冷 / 热完全一致)。落盘源码面补
ctor/ 静态槽 ——emitAbs的fn分支此前只发relationFn([...], ret, { conf: "exact" }),把 facet 全丢 ⇒ 走落盘 env 模块 时new X()判「可构造性未知」。用 IIFE 在relationFn之后补 facet(不改 core 冻结面)⇒ 三路径同型。草稿面
this形参跳过 ——dts-contract-draft.ts的参数收集此前把this写成必填实参位 ⇒ 草稿元数 +1(第一个真实实参被绑到this槽)。 判据同收割面。草稿面接口 heritage 展开 ——
extends基接口的成员进草稿(带环保护)。CLI 汇总行接
droppedDirs——nudo contract --from-dts <目录>的目录 模式只取dtsPathToContractDraft的files、丢掉它的 stats ⇒ 「遍历不到的目录」不出现在汇总行 ⇒ 汇总行报「0 skipped」而实际丢了东西。 现在并进skipped。 -
e5b3f38: 族 16 修复 M1:Bug 570 / 579 / 943 / 966 / 967 / 924 / 580 / 1005 —— tsc 的检测口径与改写口径统一(版本钉住
tsc@5.4.5、路径限定型./node_modules/.bin/tsc、非命令位的tsc旗标值/描述文字),CI workflow 改写改为 YAML 语义(只认run:标量、引号标量不再漏改、块标量跨行命令不再被拆坏),tsc argv 解析认识${{ … }}/$( … )/ glob,不再写出必然红的门禁命令。 -
e5b3f38: 族 16 修复 M3:Bug 581 / 584 / 597 ——
nudo migrate的 workspace 包枚举改为真 glob:对象式workspaces({ packages: [...] })不再被静默丢弃(子包在 status 与retire --all里可见并被真正退役);pnpm 负向模式!packages/legacy真的排除该包(不再被retire --all改写 / 删依赖 / 写 marker);packages/**与多段 pattern(packages目录下两层*)能发现嵌套成员(不再「nothing to retire」假绿)。被排除 / 未匹配的包通过 stderr 显式说明。 -
e5b3f38: 族 16 修复 M4:Bug 574 / 575 / 583 / 585 / 587 / 591 / 592 / 596 / 917 / 923 / 969 ——
nudo migrate strip的写盘面修好:两阶段(先算完再写)+ 事务写盘 ⇒ 语法错文件不再留下半写状态,错误信息点名文件;写目标前检测既有同名.js⇒ 不再静默覆盖手写 JS(--backup时先备份);--backup撞名改用*.1.bak并在输出里交代,不再静默跳过;侧车草稿落在草稿路径*.nudo.draft.js(不再冒充正式侧车*.nudo.js);产物的相对模块说明符按真实文件补成显式扩展名(./helper→./helper.js);notes 改为基于 AST 事实(注释 / 字符串里的 "enum" / "namespace" 不再误报);.cts产物不再谎称 CommonJS;.tsx明确拒绝(strip 不做 JSX 变换,不再产出 Node 加载不了的.jsx);单文件路径与目录路径走同一条侧车迁移逻辑(既有*.nudo.ts一并迁到*.nudo.js,产物契约不丢);目录级分析按模块计数(源.ts与产物.js是同一模块,不再翻倍)。 -
e5b3f38: 族 16 修复 M5:Bug 567 / 576 / 578 / 586 / 595 / 920 / 1006 / 1028 ——
nudo migrate retire的退役面、审计记录与作用域:- 没有可退役的东西就不写盘(567):既无
typescript依赖、又无门禁角色 tsc 脚本的包,retire现在报「nothing to retire」并零写盘(此前仍写.nudo/migrate-retired.json并注入check:nudo,migrate status随后把它标成[retired])。 - 二次运行不再擦掉审计记录(576):
.nudo/migrate-retired.json与既有记录合并(并集 + 保留首次retiredAt),此前第二次运行把removedDeps/rewrittenScripts/rewrittenWorkflows清空并改写retiredAt。 - 注入真的落盘(578):
check:nudo注入写回pkg.scripts(此前只改了局部副本 ⇒ 落盘文件里根本没有scripts键,CLI 输出与审计记录却都谎报「已改写」)。 - 编译脚本不再被换成门禁(586):只改写门禁角色的脚本(
--noEmit/ 裸 tsc);build/compile/bundle/emit等构建角色与带发射语义旗标(--outDir/--declaration/-b/-p无--noEmit)的脚本原样保留,并在结果与审计记录里列出(preservedScripts);这类脚本仍需 tsc ⇒typescript依赖相应保留(摘掉它 build 当场坏掉)。只有编译脚本的包明确拒绝退役并说明原因。 - 多目标全退役或全报错(595):新增
migrateRetireMany(paths)(原子;任一目标失败 ⇒ 整批零写盘),CLI 侧需把targets[0]!换成targets(见交付报告)。 - workflow 改写作用域限定在被退役包(920):退役子包只改写该包自有的
.github/workflows,仓库根共享的 workflow 属于整仓作用域,不再被静默替换成npx nudojs check .。 retire --all包间原子(1006):整批先规划后统一提交,第 N 个包失败 ⇒ 前 N−1 个包也不落盘(此前已提交的包留在仓库里而错误消息不点名);错误消息点名本批涉及的包。- 同键同型(1028):stdout
--json报文与落盘 marker 的rewrittenWorkflows现在都是{file,from,to}对象数组(此前 stdout 是对象数组、marker 是路径字符串数组),审计记录不再丢掉 CI 改写的前后内容。
- 没有可退役的东西就不写盘(567):既无
-
e5b3f38: 族 16 修复 M6:Bug 566 568 569 582 589 593 ——
migrate verify与nudo check判定同源(文件筛选排除侧车/.d.ts、分析注入带模块图与 mock)、--jsonstdout 只放 JSON(人工报告走 stderr)、批量目标 per-file 隔离(语法错不再整批中止)、--with-tsc基线真的加载 tsconfig 并按文件切分诊断、空目录判红(不再静默 exit 0)。 -
169ed52:
nudo checkno longer bails out early on a flag combination, and the JSON machine face now reports usage errors inside the same envelope as every other failure.--fixcombined with--json/--abs/--gha/--gitlab/--watch/--verbose/--from/--what-ifused to abort with a bare usage string, so a CI job that combined two flags got no machine-readable answer at all. The combination is now rejected through the normal JSON envelope (ok: falseplus apathErrorsentry carrying the machine codenudo:usage-error), and the process exit code is decided only byok.--dry-runcombined with--writeused to run the write path, so a supposedly read-only invocation still mutated files on disk. The dry-run flag now wins, and the write path is not entered.--watchtogether with--jsonused to fall back to the human face and print a second, different report. The JSON face is now honoured in watch mode as well (jsonFaceis an optional field, so the existing callers are unaffected).
-
169ed52:
nudo check --gitlaband the disk cache no longer lose or duplicate results.--gitlabannotations were emitted a second time on stdout in addition to the collected rows, so a CI log carried the same finding twice. When the caller collects the rows, they are no longer printed as well.- A run that produced both a per-file result and a whole-project result entered the disk cache twice under two different keys, so the second entry could be served for the first one's input. Both entries now collapse into a single cache entry.
-
169ed52:
nudo checkandnudo check --fixnow analyse the same program, and the gate no longer accepts TypeScript-only syntax in a.jsfile.nudo check --fixfed the analyzer a different input set thannudo check: the auto-bind setting, the project directory and the injected modules were missing, and the mock environment was not assembled. A project could pass the gate and still be reported as broken by--fix, or the other way around. Both commands now build their analyzer input through one shared constructor.--fixalso materialised plans for findings that had been downgraded to a warning, so a diagnostic that no longer blocks the gate still wrote a sidecar into the user's repository. Only error-level findings are materialised now.- A
.jsfile containing TypeScript-only syntax (private x = 0,x as T) was parsed happily, so the gate reported success on a file that Node cannot even load. The parser now picks its plugins from the file extension, and the check face reports the syntax error instead. - A project-level path environment (
package.json#nudo.env) was resolved relative to the analysed file rather than to the project root, so a subdirectory file could not find the environment it declared. - Environments are merged with the harvested ones under the same precedence the test and service faces use, so a harvested export that does not collide with a handwritten environment is no longer dropped.
-
169ed52:
nudo checkno longer loses a failing input, misreports the gate tier, prints an unappliable diff, or stays green on a broken sidecar.- An input file that exists but cannot be read (permissions, I/O) escaped the
command as a raw
EACCESmessage. With--jsonthe command printed nothing at all, so a CI job got an empty stdout and a non-zero exit code without a machine-readable reason. The failure is now reported as a path error (nudo:path-io) inside the usual JSON envelope, and the human face prints the reason plus afix:hint. - The warning about an unknown
package.json#nudo.check.profilealways saidusing default strict, even when an explicitcheck.entryThrows(or a CLI flag) had put the gate into a different tier. The message now names the tier that is actually in effect, so it can no longer contradict the report. nudo check --fixprinted its own---/+++header in addition to the header of the unified diff, polluted the+++path field with the[fix] …explanation, and used absolute paths (which produceda//…). The diff now has a single header with a relative path, exactly like the siblingnudo test --freeze --dry-runoutput, and can be consumed bygit apply.- A sidecar that imports something that is not a constraint builder (for
example
import { totallyBogus } from "@nudojs/core") was diagnosed while the sidecar was executed, but the diagnosis was dropped as soon as the execution result was cached. Because the analyzer runs before the gate, the gate itself never saw it:nudo checkreported success and exited 0 on a sidecar that could not be loaded. The diagnosis is now cached together with the execution result and reported again on every cache hit, so the gate reportsnudo:interface-loadand turns red.
- An input file that exists but cannot be read (permissions, I/O) escaped the
command as a raw
-
169ed52: Two reported
nudo checkdefects were already fixed by earlier releases; this change only adds regression pins that keep them fixed.- A string in
package.json#nudo.envis rejected with a shape warning and the environment list is ignored; it is no longer expanded character by character. - A cycle in the module graph no longer discards the whole dependency graph, so a cyclic and an acyclic project produce the same result.
- A string in
-
169ed52:
nudo check <callee> --from <caller>now closes the loop on call sites that live inside a function body, arrow function, or method body.The
--fromusage-site files were handed to the checker only as executed call records. A call site that had never been executed — for example one wrapped in a function body — produced no record at all, so the callee's gate stayed green while checking the caller alone reported the very same violation. The usage-site file paths now reach the checker as well, and the call-site obligation is re-checked with the same criterion the single-file channel uses, so both channels report the same code for the same fact.nudo check <callee> --from <caller>now exits 1 with exactly onenudo:interface-domain-exceedsfor a call site wrapped in a function body; before this change the same command exited 0.- Checking the caller directly is unchanged: it still reports exactly one
nudo:constraint-violated. - A call site that is reported by both channels is still reported only once.
-
02aa122: fix(nudojs):
nudo contract --draft的 dry-run 面(打 unified diff)+--json/--write显式互斥 + 项目根判据按路径分量族 20 · 片 B(660 / 663 / 665)。
- Bug 660 ——
--draft --write --dry-run不打 unified diff(只打一行 「[dry-run] would write → …」),而 CLI Reference 承诺--dry-run= "Print a unified diff instead of writing"。同一个--dry-run旗标在--emit与--draft两条分支上语义不同。现在--draft分支复用--emit分支的同一个 diff 生成器(unifiedDiff,已在@nudojs/service/emit⇒ 零新增导出),对照面是既有草稿文件的磁盘内容 (与--draft --json审阅面同款口径),diff 头与--emit --dry-run同形 (--- a/<path>/+++ b/<path>);dry-run 仍然不写盘。 - Bug 663 ——
--draft --json --write静默丢弃--write(--json分支 早退 ⇒ 写盘分支不可达)⇒ 草稿根本没落盘、exit 0、零提示 ⇒ 假绿 + 静默 数据丢失。现在--json与--write显式互斥:error: --write cannot be combined with --json+ exit 1,机器面仍给出 一份合法 JSON 载荷({file, errors:[{code:"nudo:usage-error"}]},由命令层的 跨文件聚合层收进恒定数组外壳)。 - Bug 665 —— 项目根边界用
rel.startsWith("..")判逃逸 ⇒ 项目根下的 合法目录名(..data//...cfg/)与合法文件名(..data.js)被误判 成「越出项目根」⇒ 草稿拒写(exit 1),而同一项目里的普通文件正常写出。 判据改成按路径分量:「整段等于..」或「以..+ 路径分隔符开头」或 「跨盘(绝对路径)」——CLI 半(nudo contract --draft --write)与 service 半 (writeInterfaceDraft的写盘守卫)逐字同款;真正越出项目根的路径仍被 拒。
- Bug 660 ——
-
02aa122: refactor(nudojs):
nudo contract的三个分支函数拆到同包内部模块(行为零变化)族 20 · S0(串行前置重构)。
packages/nudojs/src/commands/contract.ts里 按分支天然分块的三个函数,搬到同包内部模块:runContractDraft→packages/nudojs/src/commands/contract-draft.tsrunContractEmit→packages/nudojs/src/commands/contract-emit.tsrunContractFromDts→packages/nudojs/src/commands/contract-from-dts.ts
contract.ts只保留registerContractCommand(唯一导出)+runContractPrint- action(含 per-root 循环)。
- 函数签名逐字不变(参数、返回类型、行为全部不变);函数体逐字搬移。
- 零新增公开导出:
packages/nudojs/src/index.ts一行未动;nudojs的exports仍只有"."⇒ 三个新模块不在公开面上。 - 行为零变化:同一批夹具(
nudo contract的 print /--json/--draft/--draft --json/--emit/--emit --dry-run/--from-dts七个形态) 改前 / 改后各跑一遍,stdout / stderr / exit code 逐字零差异。
-
3432d8c:
nudo test: one failure channel for the machine face, one conclusion for "this file has no functions", and the flags the help text promises are now actually accepted.- Bug 650 — a syntax error was reported as a bare message with no file
name, and
--jsonprinted nothing at all. The Babel parse error escapedrunTestup to the top-level catch, which printed onlyerr.message(no path, noline:column, no source excerpt), and the--jsonserialization point sat after the throw ⇒ stdout was 0 bytes andJSON.parse(stdout)threw.nudo testnow reuses the syntax-error branch ofnudo check: the human face gets a tsc-style block (path +line:column+ source excerpt +^caret) and the--jsonface gets the same CaseJson envelope as every other failure, withpathErrors[{code:"syntax-error"}]. - Bug 652 —
nudo test --absexited 1 on a file that declares no function, while the same command without--absexited 0. The--absface borrowedrunAbsView, which treats "this file has no functions" as a usage error (Function not found+ exit 1) — that is the intended behaviour ofnudo check --abs(Bug 669) and is left untouched. Insidenudo testthe observation face is now skipped when the file declares no function, so both faces print the same report and exit with the same code. - Bug 653 —
--exit-on-diffwas silently ignored without--freeze. The precondition check lived inside theif (opts.freeze !== undefined)branch ⇒ without--freezethe flag was swallowed and the command exited 0, which turns a CI gate into a no-op. The check now runs before the branch, so--exit-on-diffwithout--freezeis a usage error (exit 1) — the same stancenudo contract --exit-on-difftakes. - Bug 654 / Bug 656 —
--helppromised--freezemodesupdate | add, but--freeze=addwas rejected with exit 1. The help text and the flag parser had each been written on their own. The parser now accepts--freeze=add(identical to omitting the value), and the error message for an invalid value lists the same set of legal values as the help. - Bug 919 —
nudo test --absswallowed the whole diagnostics section. The predicate that decides whether diagnostics are printed excluded the--absface ⇒ a wrong expectation (=> 42x) produced zero hints on screen while the assertion failed.--absno longer excludes diagnostics, so the default,--jsonand--absfaces report the same number of diagnostics for the same file.nudo check --abskeeps its existing shape. - Bug 957 —
--jsonusage errors produced an empty stdout plus a non-zero exit. Every usage-error branch ofnudo test(missing path,--json+--abs,--jsonwith several files,--freeze+--json, the variadic--fromswallow) wrote to stderr and returned before the machine face could be produced, while the path failures of the very same verb did produce a proper envelope ⇒ two failure channels, two machine shapes. Usage errors now go through the same CaseJson envelope (pathErrors[{code:"usage-error"}]+ exit 1); the human-readable text of the non---jsonface is unchanged.
- Bug 650 — a syntax error was reported as a bare message with no file
name, and
-
3432d8c:
nudo test --watchno longer swallows a failed file, andnudo test --fromno longer lets an unresolvable import pass silently.- Bug 926 —
nudo test --watchkept the gate green when a file failed to analyze. The shared watch loop (startWatch, used by thecheck/test/healthwatch faces) caught the exception thrown by a single file, printed one stderr line and moved on — without ever setting a non-zero exit code. The watch face was therefore the only place where a broken file stayed green:nudo check --watch,nudo health --watchand the non-watchnudo testall exit 1 on the same directory. The per-file catch now marks the round red (process.exitCode = 1), in the full round and in the incremental round alike, matching the exit-code semantics the same file states ("the exit code is the gate state of the most recent round"). A broken file still does not abort the round — one bad file must not stop the others from being analyzed. - Bug 1060 —
nudo test --from <callsite>silently accepted a callsite file whose imports do not resolve. Importing a module that does not exist, or a name the module does not export, evaluated successfully (the lenient loader stubs out the unresolved import) but the call sites were lost: the command printed nocall@record, fell back toentry@, and exited 0 — a false green, because the user believes the call sites were verified while nothing was. Syntax errors and top-level throws were already reported (that was the half of the previous fix); module resolution failures are now reported the same way. The callsite probe asks the engine for the module-graph issues it already computes (missing/missing-export/unreadable/json-invalid— the same set the main analysis channel reports asnudo:module-missing), and a callsite file that carries one is reported as a callsite load failure (nudo:path-missing-callsite) with a non-zero exit code. The probe now runs for every callsite file, not only for the ones that produced zero records: an unresolved import produces a record pointing at a function that does not exist, so the record count alone never revealed it.
- Bug 926 —
-
3432d8c: nudo test: 补一条反向回归钉,锁住「声明式
@nudo:case不得因名字前缀被丢出断言面」。本片零实现改动 —— Bug 651 的引擎侧根因已由族 14/15 的收口提交
dde4b037修掉: synthetic 判据已从名字前缀(name.startsWith("call@") || name.startsWith("entry@")) 改成来源判据(c.source !== "directive",CLI 面packages/nudojs/src/run-test.ts与平行副本packages/service/src/test-report.ts同改)。本片只补钉,把「已修」的 行为钉住 ⇒ 防止将来有人把判据改回名字前缀。新钉
packages/nudojs/src/__tests__/cli-bug-651-declared-case-name.test.ts(5 例, 只钉语义、不钉汇总行字面量):- 声明式见证
@nudo:case "call@L42" (2) => 5(实得 4)⇒ 计入失败、exit 1、 报告面出现[FAIL]行(旧行为:被当成 synthetic ⇒ 断言面「0 failed」、exit 0, 而诊断面同时报nudo:case-expectederror ⇒ 报告自相矛盾)。 - 同一形状的
entry@L42前缀变体 ⇒ 同上。 --freeze写回形态的名字(call@<file>:<line>)⇒ 同上(这正是来源判据的原始动机: 写回的见证写在源码里 ⇒ 已声明)。- 同名对照:普通名字(
myCase)的失败断言行为与前缀变体完全一致。 - 期望相符的
call@L42⇒ 计入通过、exit 0(不是unchecked、不是 synthetic)。
实测:钉子在 HEAD 只读副本上通过(5/5 ⇒ 假阳性钉在 HEAD 上通过); 把副本里的判据改回名字前缀后 4/5 失败(只有普通名字的对照例仍通过) ⇒ 钉子确实能抓住「判据改回名字前缀」这一回归。
- 声明式见证
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [cc9b638]
-
Updated dependencies [2688251]
-
Updated dependencies [7fea13a]
-
Updated dependencies [a1c093f]
-
Updated dependencies [9f26414]
-
Updated dependencies [1caec28]
-
Updated dependencies [67abd92]
-
Updated dependencies [3d66f5a]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [b4768ca]
-
Updated dependencies [1b08a18]
-
Updated dependencies [b4768ca]
-
Updated dependencies [5fd3cbb]
-
Updated dependencies [5fb8a51]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [27a795e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [02aa122]
-
Updated dependencies [3432d8c]
-
Updated dependencies [3432d8c]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [aa23265]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [106ad1d]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
-
Updated dependencies [8542f44]
- @nudojs/core@1.16.0
- @nudojs/service@1.10.0
- @nudojs/env@0.5.3
- @nudojs/parser@1.5.3
- @nudojs/harvester@0.4.3
1.6.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
- @nudojs/env@0.5.2
- @nudojs/harvester@0.4.2
- @nudojs/parser@1.5.2
- @nudojs/service@1.9.2
1.6.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
- @nudojs/env@0.5.1
- @nudojs/harvester@0.4.1
- @nudojs/parser@1.5.1
- @nudojs/service@1.9.1
1.6.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every
existsSync(p) && statSync(p)double call (TOCTOU race + errno swallowing) with a singlestatSync(p, { throwIfNoEntry: false })per the repo's load-module convention: ENOENT stays a silent miss, EACCES/EIO surface via the site's error channel (top-level catch,reports.push({error}), exit-1 message, or a logged warning) instead of masquerading as "file absent". Read-failure catches now branch one.code: sidecar contracts unreadable for reasons other than ENOENT print awarning: cannot read sidecar contract …incheck/check --fix(no more silent contract-blind green runs);@nudo:mockseed evaluation failures warn inexportbefore degrading;pnpm-workspace.yamlread failures other than ENOENT abortmigrate(a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read reportread-failedwith the errno instead of the misleading "Mock file not found"; npm entry probes and LSP module-candidate stats log persistent failures instead of degrading a package's export face to unknown or silently breaking go-to-definition;contract --from-dtspath-like arguments that don't exist now error aspath not foundinstead of being treated as npm package names ending in a misleadingno .d.ts files found. - 9a3d6e7: Stop silently swallowing business-Promise failures.
nudo check/test --watchincremental rounds died silently when the round body threw outside the per-file try (buildModuleGraph/evictForDependents/topoSortDirty) — the screen just froze on the previous round's results; the error is now printed (nudo <label> incremental failed: …), mirroring the existing first-round BUG-023 handling. In the LSP server,validateDocument(didOpen / didChange debounce) andhandleNudoDepFileChanged(didOpen / didChange / watched-files) rejections were discarded with an empty catch — a file throwing in the analyzer produced no diagnostics and no trace, forever; failures are now logged to stderr as[nudo-lsp] …lines. Best-effort client capability requests (DiagnosticRefresh/CodeLensRefresh/ inlay-hint refresh) keep their intentional silent catch. - Updated dependencies [aae0f96]
- Updated dependencies [52de5ca]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
- @nudojs/service@1.9.0
- @nudojs/harvester@0.4.0
- @nudojs/parser@1.5.0
- @nudojs/env@0.5.0
1.5.0
Minor Changes
-
c19bd48: DX batch: face consistency across check/fix/export/health/test, plus
nudo initand onboarding (fix-12, 20-point TS-parity batch).export --format dtsconsumes contract faces through the sameeffectiveInterfacesource ascheck— non-exported top-level functions no longer leak into.d.ts; evidence-less params stay unknown with a stderr note.healthbudget line no longer contradictscheck: per-file budget snapshot, attribution segments only for the budget that actually triggered (depth 64/64, not "eval calls 71/20000"); human face and multi-envelope budgets aligned.check --fixno longer writes non-fixing contracts: array-method receivers synthesizearray(shape({...}))from callback element reads, and a re-check gate downgrades unprovable totality to[review]— no auto-applied half-fixes.- new
nudo init: writes an idempotent adoption baseline into package.json (L2 → warning). - zero-config failing check prints an onboarding block (
init/contract --draft/--profileadoption); gate exit code unchanged. nudo.test.profiletypos warn on stderr; syntax-error files print tsc-style blocks (path:line:col + excerpt + caret),--jsonfolds them intopathErrors.nudo testannotatesentry@fallback cases on contracted functions.- TTY colors for severity markers / section headers (
NO_COLORmaster switch,FORCE_COLORoverride, piped output stays plain);check --quietsuppresses signatures;check --helpflags grouped (Common/Observation/Fix/CI/What-if);contract --draftemits uncomment-to-accept suggested bindings; diagnostics outside cwd print absolute paths; multi-file check prints an opt-in cache hint.
Patch Changes
- Updated dependencies [c19bd48]
- Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
- @nudojs/parser@1.4.24
- @nudojs/service@1.8.0
- @nudojs/env@0.4.42
- @nudojs/harvester@0.3.28
1.4.0
Minor Changes
-
0d9e7de:
@nudo:skipno longer kills@nudo:caseevaluation (#176) — the declared face and runtime ground truth are no longer a trade-off.- A skipped function keeps
combinedAbsfrom its declared return face (dts/sidecar/draft consumers unchanged), while declared@nudo:casedirectives are evaluated and asserted as usual;nudo testprints the skip note and the case assertions in the same block (previously the cases vanished entirely: "no declared @nudo:case expectations") nudo checkbehavior is byte-identical (caseMode none — no case evaluation, no synthesized entry@ for skipped functions)
- A skipped function keeps
Patch Changes
- Updated dependencies [0d9e7de]
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
- @nudojs/service@1.7.0
- @nudojs/env@0.4.41
- @nudojs/harvester@0.3.27
- @nudojs/parser@1.4.23
1.3.26
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
- @nudojs/env@0.4.40
- @nudojs/harvester@0.3.26
- @nudojs/parser@1.4.22
- @nudojs/service@1.6.25
1.3.25
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
- @nudojs/env@0.4.39
- @nudojs/harvester@0.3.25
- @nudojs/parser@1.4.21
- @nudojs/service@1.6.24
1.3.24
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
- @nudojs/env@0.4.38
- @nudojs/harvester@0.3.24
- @nudojs/parser@1.4.20
- @nudojs/service@1.6.23
1.3.23
Patch Changes
-
82eaae8: Fix
nudo:recursion-truncatedmisattributing call-cycle truncation to "depth/size budget", and makenudo check --jsonbudget stats see the B-path ($callNamed) truncation (issue #158):enterCall/evalEnterCallnow attribute a truncation reason —cycle(same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers orgrow-style recursion) vsdepth/calls(real budget exhaustion). The check diagnostic message, suggestion, structured action, and a newreasonfield on the issue (cycle|depth|calls|budget) split accordingly: cycle says "budget cannot lift this" and never points at@nudo:budget; depth/calls name the exact raisable dimension (@nudo:budget depth=…/calls=…).- The
check --json/ health budget block no longer reportstruncated:falsealongside anudo:recursion-truncatedinfo: B-path counters are latched across execution sessions within one host entry and surfaced asevalCalls/maxEvalCalls/evalCallTruncated, pluscycleTruncatedand a sortedreasons[]set (single-file and multi-file envelopes, and the disk-cache round trip). Fork counters/truncation flags are latched per host entry too (the last-session snapshot could previously erase an already-reportednudo:fork-truncated). - The
@nudo:budgetquickfix (nudo check --fix/ LSP code action) is no longer offered when the truncation reason iscycle; thereasonis plumbed throughcheck --json, the disk cache, LSP diagnostic data, andmaterializeAction. - Raising
@nudo:budgeton a same-args recursion could never lift the truncation — the old message misled real budget investigations into "directive ignored" hypotheses. - Loop-iteration truncation (
#loop-iterations) no longer masquerades as recursion: it now emits its ownnudo:loop-truncatedinfo with an honest message and suggestion (the call-budget knobs cannot lift a loop budget —@nudo:budget calls=/depth=does not apply), gets aloopTruncatedflag in thecheck --json/ health budget block (single-file and multi-file envelopes), and no longer offers the misleading@nudo:budgetquickfix it used to inherit from the recursion branch.
-
Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
- @nudojs/service@1.6.22
- @nudojs/env@0.4.37
- @nudojs/harvester@0.3.23
- @nudojs/parser@1.4.19
1.3.22
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
- @nudojs/env@0.4.36
- @nudojs/harvester@0.3.22
- @nudojs/parser@1.4.18
- @nudojs/service@1.6.21
1.3.21
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
- @nudojs/env@0.4.35
- @nudojs/harvester@0.3.21
- @nudojs/parser@1.4.17
- @nudojs/service@1.6.20
1.3.20
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
- @nudojs/env@0.4.34
- @nudojs/harvester@0.3.20
- @nudojs/parser@1.4.16
- @nudojs/service@1.6.19
1.3.19
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
- @nudojs/env@0.4.33
- @nudojs/harvester@0.3.19
- @nudojs/parser@1.4.15
- @nudojs/service@1.6.18
1.3.18
Patch Changes
-
35ce944: Fix recursive-fn local hover poisoning and arity-only fn hover display
$nodoPosposition records and call/assign records now carry the caller-frame depth; hover replay surfaces (absNodeAtPosition,collectEnclosingFnLocals) only read outermost-frame records. Recursive functions on self-referential contracts (lazy(() => astNode)) no longer bind cycle-truncatedopaque unknowninto local-variable hovers (objnow shows the computednull | string | undefined).const x = <non-call init>declarations record the bound Abs at the declarator-id position during hover replay (recordPositionsonly) — ternary/optional-chain/literal-initialized locals are hoverable (prop,q).callTranspiledExportFullInnerrefines the called fn AbsreturnTypeslot after a successful call (same policy as class method slots, display-only).- LSP hover: an arity-only fn Abs (empty
returnTypeslot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature(node: nullable(astNode)) => null | string | undefinedinstead of(arg0) => ?.
-
Updated dependencies [334b914]
-
Updated dependencies [94197eb]
-
Updated dependencies [b8db17b]
-
Updated dependencies [fa52735]
-
Updated dependencies [35ce944]
-
Updated dependencies [5e275df]
- @nudojs/core@1.10.0
- @nudojs/service@1.6.17
- @nudojs/env@0.4.32
- @nudojs/harvester@0.3.18
- @nudojs/parser@1.4.14
1.3.17
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
- @nudojs/env@0.4.31
- @nudojs/harvester@0.3.17
- @nudojs/parser@1.4.13
- @nudojs/service@1.6.16
1.3.16
Patch Changes
- Updated dependencies [b6495c6]
- Updated dependencies [b6495c6]
- Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
- @nudojs/service@1.6.15
- @nudojs/env@0.4.30
- @nudojs/harvester@0.3.16
- @nudojs/parser@1.4.12
1.3.15
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
- @nudojs/env@0.4.29
- @nudojs/harvester@0.3.15
- @nudojs/parser@1.4.11
- @nudojs/service@1.6.14
1.3.14
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
- @nudojs/env@0.4.28
- @nudojs/harvester@0.3.14
- @nudojs/parser@1.4.10
- @nudojs/service@1.6.13
1.3.13
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
- @nudojs/env@0.4.27
- @nudojs/harvester@0.3.13
- @nudojs/parser@1.4.9
- @nudojs/service@1.6.12
1.3.12
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
- @nudojs/env@0.4.26
- @nudojs/harvester@0.3.12
- @nudojs/parser@1.4.8
- @nudojs/service@1.6.11
1.3.11
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
- @nudojs/env@0.4.25
- @nudojs/harvester@0.3.11
- @nudojs/parser@1.4.7
- @nudojs/service@1.6.10
1.3.10
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
- @nudojs/env@0.4.24
- @nudojs/harvester@0.3.10
- @nudojs/parser@1.4.6
- @nudojs/service@1.6.9
1.3.9
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
- @nudojs/env@0.4.23
- @nudojs/harvester@0.3.9
- @nudojs/parser@1.4.5
- @nudojs/service@1.6.8
1.3.8
Patch Changes
-
d6fa067: fix(core): 函数边界缺参归一——省略尾实参不再以宿主 undefined 流入(Bug 7 / Bug 12)
- Bug 7(部分传参,假阳性):
two(s)对two(a, b)把宿主undefined送进$add等算子(读.shape崩溃被收成假 may-throw),或经 return 通道泄漏裸值。修复:宿主绑定元数内省略槽位按「显式传 undefined」归一为lit(undefined)——函数声明/类方法在转译 prologue 收形(p = $absVal(p)),函数表达式/对象方法在$fnValapply 钩子按impl.length补齐(读宿主arguments的 function 包装走padArgs: false+ 体内归一,arguments.length不膨胀)。 - Bug 12(零参调用,假阴性):
f(a){return a.b}零参原折unknown无 throws(确定抛被折成保证不抛)。归一后$get/解构守卫走 nullish 硬抛——throws TypeError与原生一致;wave-1 的 unknown 接收者政策不变。 +代数不设lit(undefined) ⊗ any专用零抛臂:undefined + any落既有 anyLike 臂(值域number | string,any 侧可为 Symbol → 原生 may TypeError,与any + 1/any ⊕ any同口径记 may-throw——省略归一只消除宿主裸值崩溃/泄漏,不放宽 any 的投射面);s + 1的 policy 不变。- 红线保持:默认参照常取默认、rest 收
[]不补、typeof折"undefined"、显式undefined实参语义不变、数组解构零参迭代守卫硬抛、checkSource 入口 any 路径不变。
- Bug 7(部分传参,假阳性):
-
Updated dependencies [d6fa067]
-
Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
- @nudojs/env@0.4.22
- @nudojs/harvester@0.3.8
- @nudojs/parser@1.4.4
- @nudojs/service@1.6.7
1.3.7
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
- @nudojs/env@0.4.21
- @nudojs/harvester@0.3.7
- @nudojs/parser@1.4.3
- @nudojs/service@1.6.6
1.3.6
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
- @nudojs/env@0.4.20
- @nudojs/harvester@0.3.6
- @nudojs/parser@1.4.2
- @nudojs/service@1.6.5
1.3.5
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
- @nudojs/env@0.4.19
- @nudojs/harvester@0.3.5
- @nudojs/parser@1.4.1
- @nudojs/service@1.6.4
1.3.4
Patch Changes
- 50e50f1: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) - Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
- @nudojs/service@1.6.3
- @nudojs/parser@1.4.0
- @nudojs/env@0.4.18
- @nudojs/harvester@0.3.4
1.3.3
Patch Changes
- a00bccc: fix(env+check+eval): env 表不再遮蔽宿主命名空间(Math/Number/JSON/Object/Array/String/Date/Promise/BigInt——issue #87,区间透传恢复);check 与 test/LSP 同口径 preload path 型 env(issue #89);rewriteBareImports 支持子路径 specifier + nudojs 依赖
@nudojs/env+ path env 导入失败发nudo:env-unresolvedwarning(issue #88);??左值 nullish 臂过滤($removeNullish,issue #90);循环 pack/unpack 名单剔除循环体内局部词法声明(issue #91,消除 ReferenceError 误报) - 446914f: fix(nudojs):
check --gitlab多 target 在 action 层聚合成单个 Code Quality JSON 数组(旧实现逐文件各打一个数组,拼接产物无法被 GitLab 解析);--gitlab 面 stdout 不再混入 docs 深链(机器契约面与终端面分离)。watch(check/test 共用循环)每轮前复位process.exitCode——红轮置 1 后不再粘滞,退出码始终反映最近一轮门禁状态。check --fix读文件失败改为上屏并计入 residualErrors(不再静默跳过导致静默绿)。重构:runCheck 拆为 loadCache / buildInjection / report+exit 三段,门禁解析链抽resolveGateForFile单源(plain check 与 --fix 同链),静态依赖的await import提升为顶部静态引入(输出/退出码零漂移,cli-e2e-golden 快照不变)。 - Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [a00bccc]
- Updated dependencies [446914f]
- Updated dependencies [39332ca]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [89358f2]
- Updated dependencies [89358f2]
- Updated dependencies [89358f2]
- Updated dependencies [446914f]
- @nudojs/core@1.7.2
- @nudojs/service@1.6.2
- @nudojs/parser@2.0.0
- @nudojs/env@0.4.17
- @nudojs/harvester@0.3.3
1.3.2
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
- @nudojs/harvester@0.3.2
- @nudojs/parser@1.3.2
- @nudojs/service@1.6.1
1.3.1
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
- @nudojs/service@1.6.0
- @nudojs/harvester@0.3.1
- @nudojs/parser@1.3.1
1.3.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
- @nudojs/service@1.5.0
- @nudojs/parser@1.3.0
- @nudojs/harvester@0.3.0
1.2.0
Minor Changes
-
64ca356: feat: clamp bounds + scalar-over-sum + action-map quickfixes (#68 #69)
#68 inference
Math.min/Math.max/Math.round(and floor/ceil/trunc) propagate operand numeric bounds:max(0, min(100, n))derives[0, 100].- NaN is explicit (option 1): a possibly-NaN operand yields
NaN | number@bounds, so clamp contracts stay honest;if (Number.isNaN(n)) return …narrows the false arm (ne(n, NaN)) and the guarded clamp is provable. - Scalar return contracts now distribute over sum arms like shape/array
(
nullable(c)+ multi-returnnull | numberis provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings tounproven-returnwarnings instead of errors.
#69 DX
actionsForIssuekinds are materialized as LSP quickfixes with[fix]/[silence]/[review]/[adjust]/[scaffold]titles.nudo check --fix [--only <code>] [--write]reuses the same edit layer (default dry-run prints unified diffs).- Body-read fields auto-fill types from usage (
node.type === "x"→string(), arith →number(), no evidence →any()); never emit emptyshape({}). - L2
entry-may-throwsuggestions include a copyable sidecar clause.
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
- @nudojs/service@1.4.0
- @nudojs/harvester@0.2.19
- @nudojs/parser@1.2.1
1.1.0
Minor Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
Patch Changes
- Updated dependencies [f10066d]
- @nudojs/core@1.4.0
- @nudojs/parser@1.2.0
- @nudojs/service@1.3.0
- @nudojs/harvester@0.2.18
1.0.9
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
- @nudojs/harvester@0.2.17
- @nudojs/parser@1.1.9
- @nudojs/service@1.2.4
1.0.8
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
- @nudojs/harvester@0.2.16
- @nudojs/parser@1.1.8
- @nudojs/service@1.2.3
1.0.7
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
- @nudojs/harvester@0.2.15
- @nudojs/parser@1.1.7
- @nudojs/service@1.2.2
1.0.6
Patch Changes
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/core@1.2.1
- @nudojs/harvester@0.2.14
- @nudojs/service@1.2.1
- @nudojs/parser@1.1.6
1.0.5
Patch Changes
-
5ff4202: refactor!: rename B-path / BPath engine identifiers to eval / evaluator
The AST-walk interpreter is long gone, so the dual-engine campaign name "B-path" no longer means anything and forced a glossary entry just to explain itself. The single production evaluation engine is now simply the evaluator (mechanism: transpile →
new Functionon Abs).Renamed B-path engine to evaluator/eval — see the @nudojs/core table above.
-
Updated dependencies [5ff4202]
-
Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
- @nudojs/service@1.2.0
- @nudojs/harvester@0.2.13
- @nudojs/parser@1.1.5
1.0.4
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
- @nudojs/harvester@0.2.12
- @nudojs/parser@1.1.4
- @nudojs/service@1.1.4
1.0.3
Patch Changes
- Updated dependencies [3bf9997]
- Updated dependencies [43fb345]
- @nudojs/core@1.1.3
- @nudojs/parser@1.1.3
- @nudojs/service@1.1.3
- @nudojs/harvester@0.2.11
1.0.2
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
- @nudojs/harvester@0.2.10
- @nudojs/parser@1.1.2
- @nudojs/service@1.1.2
1.0.1
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
- @nudojs/harvester@0.2.9
- @nudojs/parser@1.1.1
- @nudojs/service@1.1.1
1.0.0-beta.3
Patch Changes
- 247f751: docs(website): product narrative — runtime-adjacent variables, Observation/Contracts layers, cost face (tokens / rounds / edit latency), top-level glossary (Abs origin, B-path, fail-closed, conf grades), TypeScript comparison without permanent dual-gate framing.
1.0.0-beta.2
Patch Changes
-
4305674: Split the
@nudojs/servicegod package: harvest →@nudojs/harvester, IDE surface →@nudojs/lsp, emit products consolidated under@nudojs/service/emit.BREAKING for
@nudojs/servicesubpath consumers:Removed subpath Migrate to @nudojs/service/interface@nudojs/service/emit@nudojs/service/dts@nudojs/service/emit@nudojs/service/case@nudojs/service/emit@nudojs/service/lsp@nudojs/lsp(library entry — no server side effects)@nudojs/service/harvest@nudojs/harvester@nudojs/servicekeeps.,./analysis,./evaluator,./emit. The language server moves to@nudojs/lsp/server(binnudo-lspunchanged);@nudojs/lspis now a side-effect-free library entry re-exporting the IDE surface.No dependency cycles:
lsp → service,harvesterstays independent ofservice. Emit is a service subpath (same package). Public function signatures and diagnostic codes are unchanged. -
Updated dependencies [4305674]
- @nudojs/service@5.0.0-beta.1
- @nudojs/harvester@1.0.0-beta.1
1.0.0-beta.1
Major Changes
-
e29ceac: BREAKING: merge
@nudojs/cliintonudojs— one install unit for thenudocommand.nudojsis now the full CLI (check/test/contract/export/health/migrate), withbin: nudoand the previous@nudojs/clidependencies.nudo --versionprintsnudojs <ver>(+@nudojs/core <ver>when resolvable).@nudojs/cliis a deprecated migration stub that forwardsnudoand the module entry tonudojsand prints a deprecation line on stderr. Prefernpm i -g nudojs. The stub will be unpublished.- No more "shell ≠ engine" version heads-up: the package you install is the product version.
Migration:
npm rm @nudojs/clinpm i -g nudojs # same `nudo` binimport "@nudojs/cli"/npx @nudojs/clikeep working via the stub for one beta cycle.
1.0.0-beta.0
Major Changes
-
0e1432a: feat!: source contract directive is
@nudo:contractonly@nudo:refineand@nudo:interfaceare deleted with no alias layer. The product word is contract end to end (sidecar*.nudo.js,@nudo:contract,nudo contract,package.json#nudo.contract.*).- BREAKING: replace every
@nudo:refine/@nudo:interfacewith@nudo:contract(including@nudo:contract return <constraint>). Grammar is unchanged:@nudo:contract <param> <constraint>. - Constraints still enter Abs as Preds and participate in algebra (
x>0⇒x+1>1) — this is not a call-site validation gate. - Diagnostic codes
nudo:interface-*are unchanged in this release. - Chinese product copy uses 契约, not 精化.
- BREAKING: replace every
-
8db7320: feat!: remove
env harvestfrom the product CLI faceHarvest is not a user task. Product verbs are
check/test/contract/export/health.- BREAKING:
nudo env harvest(and theenvcommand group) is removed. Third-party@typesstill auto-fill during analysis via module-graph harvest; env-package generation stays available as the@nudojs/harvesterlibrary. - Handwritten
@nudojs/envremains the fixed product env (es/web/node) and still wins over harvest on overlapping modules/exports. - Scripts that called
nudo env harvestshould either rely on analysis auto-fill or callharvestDts/emitEnvModulefrom@nudojs/harvesterdirectly.
- BREAKING:
Patch Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
-
Updated dependencies [22baf33]
-
Updated dependencies [0e1432a]
-
Updated dependencies
-
Updated dependencies [279d73a]
-
Updated dependencies [8db7320]
-
Updated dependencies [5a5e167]
- @nudojs/cli@4.0.0-beta.0
0.3.2
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/cli@3.0.0
0.3.1
Patch Changes
- @nudojs/cli@2.0.1
0.3.0
Minor Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/cli@2.0.0
0.2.2
Patch Changes
- @nudojs/cli@1.0.1
0.2.1
Patch Changes
- bd28356: Rename thin shell package from unavailable npm name
nudotonudojs. The installed command remainsnudo(npx nudojs infer …/npm i -g nudojs→nudo infer …).
0.2.0
Minor Changes
-
0f0b7d5: Feature: Interface 分层推导 Phase 1(design-refine-derivation.md)
- 侧车同名自动绑定:
foo.nudo.js导出绑定foo.js本地 named export;手写 >@generated> 隐式合并序 - 约束代数:
lit/union/fn/shift/and/partial/pick/omit - Abs→ 契约投影与字面量域隶属(domain-membership)
- 新诊断:
nudo:interface-drift/interface-domain-exceeds/interface-conflict/interface-cycle/interface-load/interface-name-clash - CLI:
nudo interface(别名refine)分层打印;--emit/--fn/--all/--dry-run/--exit-on-diff/--callsites;nudo check --callsites - 配置:
package.json#nudo.interface.autoBind(默认 true;node_modules 永不 ambient 加载) - LSP:CodeLens interface 默认层 + persist/update;agent 工具
nudo.interface/nudo.interface.emit(emit 路径限制在项目根内) - 新薄壳包
nudojs(bin委托@nudojs/cli,命令名仍为nudo)
- 侧车同名自动绑定:
-
0fd253f: 新增
nudojs薄壳包:npm i -g nudojs或npx nudojs直接获得nudo命令(委托 @nudojs/cli,参数与退出码透传)。
Patch Changes
- Updated dependencies [0fd253f]
- Updated dependencies [0f0b7d5]
- Updated dependencies [de47d84]
- @nudojs/cli@1.0.0
@nudojs/parser 1.5.11
1.5.11
Patch Changes
- Updated dependencies [795e322]
- Updated dependencies [161d156]
- @nudojs/core@1.20.1
Version history (61)
1.5.10
Patch Changes
-
190761e: Propagate the source filename into parse-mode selection for pure-JS paths.
parseSourcealready skips the strip-types pass for.js/.mjs/.cjs/.jsx(structurally a no-op there), but service / transpile / module-graph / fingerprint / directive-scan call sites omitted the filename, so JS sources were parsed in ts mode and paid two extra full-AST walks. ThreadingfilenamefromanalyzeFile,transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors andlocalNamedExportsdrops a 9.14 MB self-contained JS file from 20,755ms to 14,594ms (-29.7%); the remaining strip-types share in the profile is ~2% (checkSourcepath 1.7%).兼容性:解析模式由文件扩展名决定(缺省仍为 ts 模式,未知扩展名行为不变);
.js里的 TS-only 语法仍是 syntax-error(Bug 114 / Bug 451 口径不变)。 -
Updated dependencies [c93a32d]
-
Updated dependencies [190761e]
-
Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
1.5.9
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
1.5.8
Patch Changes
- Updated dependencies [9a087f9]
- Updated dependencies [09d49af]
- Updated dependencies [c6cf8fa]
- Updated dependencies [e1e6892]
- Updated dependencies [ca8005b]
- Updated dependencies [fb54d1a]
- Updated dependencies [869f22d]
- Updated dependencies [09f5ff8]
- Updated dependencies [df56e83]
- Updated dependencies [af8173b]
- Updated dependencies [61c22d5]
- Updated dependencies [c8aac63]
- Updated dependencies [9886482]
- Updated dependencies [3ddcb81]
- Updated dependencies [897b19f]
- Updated dependencies [53d8248]
- Updated dependencies [792eb79]
- Updated dependencies [949ddce]
- Updated dependencies [56d8227]
- Updated dependencies [14cf89a]
- Updated dependencies [49cdb00]
- Updated dependencies [4fc7e19]
- Updated dependencies [4e986cd]
- Updated dependencies [47463ae]
- Updated dependencies [018bc20]
- Updated dependencies [b4435ae]
- Updated dependencies [e4dc7df]
- Updated dependencies [7ddd831]
- Updated dependencies [06bd8ee]
- Updated dependencies [533c8c6]
- Updated dependencies [951b256]
- Updated dependencies [0331e00]
- Updated dependencies [f7d105a]
- Updated dependencies [fdc0a5a]
- Updated dependencies [c9c39e8]
- Updated dependencies [b6cdf66]
- Updated dependencies [1316e42]
- Updated dependencies [4ea0cbc]
- Updated dependencies [ead77d6]
- Updated dependencies [cd7c6e2]
- Updated dependencies [f66e104]
- Updated dependencies [5267658]
- Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
1.5.7
Patch Changes
-
5cd4106: Dedup batch 2 (jscpd + hand-sync-comment audit): single-source the remaining cross-file / cross-package copies that were pinned together by comments or mirror tests instead of code.
- String-aware scanners (
splitTopLevelArgs/findTopLevelColon/stripJsdocContinuation→ newcore/algebra/text-scan.ts, exported via@nudojs/core/internal): the check face (case-arg split) and the parser directive face each kept verbatim copies — Bug 1009 was exactly this pair drifting (check face treated\as an escape ⇒ one arg fewer ⇒ L2 witness silently skipped).scanWithStringswas dead after the move and is gone. - bigint operand predicates (
isNullishLitOperand/isKnownNonBigintNumeric/isMaybeBigintOperand):surface.tscarried a forked copy ofarithmetic/coerce.ts— itsisMaybeBigintOperandlacked the Bug 946arr/tuplearms and only stayed sound by accident of the catch-all throw. Single source in coerce;foldNumericBinOpnow mirrors foldBigintBinOp's explicit arr/tuple hard-throw so1n & []still throws deterministically. - Bug 946 member-level fix (behavior):
isMaybeCoercionThrowOperandnow recurses intosummembers and skipsarr/tuplemembers —x & 1/1 - xwithx: number | []no longer records a false TypeError may-throw (native never throws; the old member scan dragged arr members into the may-throw channel ⇒ potential L2 false red). Regression-pinned in the Bug 946 suite, including the sound positive control (1n + xon the same union still records may-throw: the number member genuinely throws). collectNestedBodyRangeswiring completed: core exported it via@nudojs/core/internaland its comment claimed parser reuse, but parser still ran a full local copy.file-directives.tsnow consumes the single source.parseIgnoreThrows/configIgnoreThrows: service is the declared single implementation (CLI / LSP / vite-plugin); the CLI kept its own verbatim copy and the LSP test suite used that copy as a mirror oracle. nudojs now re-exports from@nudojs/service; the tautological mirror assertion is replaced by direct-value assertions.absShapeForTsTypeTextvia@nudojs/core/internal: service'stsAnnotationShapewas a hand-synced table replica ("勿单边扩表") with a drift-gate test holding the two copies together; both the replica body and the drift-gate file are gone.- emit section extraction:
interface-derivation-emit.tsandinterface-emitter.tsduplicated the export-statement →{names, bindings}extraction (31 lines) andstripSections(14 lines); both now shareservice/emit/export-section-scan.ts. ScanLiteralCallsOptions: the thin shell's inline opts literal type was a documented structural mirror of the named interface; the shell now consumes the interface directly.
- String-aware scanners (
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
7d7abe4: Dedup batch 4 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the three remaining comment-pinned manual-sync pairs and the largest in-file twins. Pure refactor — outputs byte-identical (vitest --changed 15548 passed, verify:examples 251 checks, public-api freeze 9/9).Comment-confessed sync pairs now single-sourced:
- lsp hover
formatEntryParamShapeLike→ coreformatEntryParamShapevia@nudojs/core/internal(the old comment claimed "core adds no export"; the internal face is the sanctioned route). - lsp
server-code-actionsnorm/resolveRelcopy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) →@nudojs/service/emitexportsnormPosixPath/resolveRelativeSpec; the lsp-only extensions stay at the call site. - standard-schema brand ctor list:
GLOBAL_BRAND_CTOR_NAMESlocal array + Set → schema-generatorRUNTIME_GLOBAL_CTOR_NAME_LIST(single array source; Set +isRuntimeGlobalCtorNamepredicate derive from it; the embedded validator serializes the same array, byte-identical).
In-file twins single-sourced:
- core
hof.ts:predUsesMappedVars/mapHasShapeOnlyVar→ parameterizedpredAnyVarwalker. - core
scan/literal-shapes.ts: 21 structurally identicalconstraintViolatedissue pushes →pushPrecondIssue(message/suggestion templates byte-identical). - core
builtins/promise.ts: then/catch rejected-arm microtask twins →definiteRecoveryPromise/unsettledRecoveryPromise; then-microtask dual reject arms →joinRejectedArm;Promise.alldual reject faces →allRejectFace. - core
check.ts: handwritten return-contract recording block (skip branch + main branch) →recordReturnContract. - core
leq.ts/postcondition.ts: duplicateprimOfsingle-sourced in leq. - core
builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) →taOwnKeysTuple; gOPD class/Error/.prototypeslot→descriptor arms →ownSlotDescriptor; 8 identical nullish-receiver guards →throwIfNullishRecv. - core
builtins/array.ts+template.ts: tuple join folding loops →tupleJoinParts(recv, onSymbol)(symbol element: throw vs abstract — the real semantic fork, parameterized). - core exec runtime:
$whileSeq/$forOfapplyExitJoinclosures → new pureloop-exit-join.tsapplyLoopExitJoin(the discoveredexhausted && widengate difference is an explicit parameter;$forOfpassesexhausted: true, provably equivalent). - core
directive-scan.ts↔ parserfn-directives.ts:CASE_TAG_REGEXscan loop → coreiterCaseTags(text, caseArgSpans)via@nudojs/core/internal(Bug 978 diagnostic actions and downstream regexes stay consumer-side). - service
dts-generator.ts:DtsClassMemberSurfacebase interface —scanClassSurfacereturn type no longer re-declares the member fields (BUG-168/151 docs live once). - lsp:
replay.tsasync env-preload twins sharepreloadEnvsThen, function scope walkers sharewalkFnScope;server-navigation.tsreferences/rename share the gate+parse prologue;hover.tsgeneralize blocks sharetryGeneralizeEnclosing.
Skipped as intentional parallel data or non-identical semantics: env node/web table clones (MessagePort ports, dual Storage, exec options), dts obj-slot widen pair (Bug 240 selective flags vs whole-slot spread), object methods string char-tuple pair (values vs entries elements).
- lsp hover
-
5769211: Dedup batch 5 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the four remaining comment-pinned manual-sync obligations and the seven whole-function twins. Pure refactor — outputs byte-identical (vitest --changed 16815 passed, verify:examples 251 checks, lint + lint:tests clean).Comment-confessed sync pairs now single-sourced:
- transpile
stmt/statement.tsyield try-context bits (raw1|4|8/& 2/~(16|32|64)literals pinned by a "钉死同步" comment to runtimecontrol.tsYIELD_* constants) → new zero-dependency leafexec/yield-bits.ts; runtime (control.tsre-export removed,async.ts) and transpile (statement.ts) both import the named constants. - parser
case-arg.tsTYPE_EXPR_CHAIN_METHODShand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exportsCONSTRAINT_CHAIN_METHOD_NAMES(public barrel, next toCONSTRAINT_BUILDER_NAMES); parity pinned byconstraint-chain-methods.test.ts(method-face drift ⇒ CI red). - service
builtin-prototype.tsBUILTIN_ERROR_CLASSESverbatim 8-name copy of coreERROR_CTOR_NAMES→ imported via@nudojs/core/internal(the dead module-level re-export is removed; no public face change). - core
promise.tsaggregateErrorAbslocal error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated ineval-bug-293-promise-combinator-settle.test.ts(slot-key set / non-enumerable flags / inherited name vserrorBrandAbs).
Whole-function twins single-sourced:
- core
builtins/error/binary.tsmakeArrayBufferAbs/makeSharedArrayBufferAbs→ parameterizedmakeBufferAbs(brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved). - core
transpile/member-path.tsmemberWriteIfe/memberWriteRootIfe→ sharedmemberWriteIfeImpl(only real difference: return written value vs new root). - nudojs
version.tsthree walk-up-to-package.json loops →findPkgDirUpwards+readVersionAt. - nudojs
migrate.tsplanWorkflowRewrites→ delegates toplanWorkflowRewritesIn(findWorkflowDir(from));readPackageJsonDetailed/readMarkerFile→ sharedreadJsonObjectDetailed(path, label)(missing / invalid / unreadable / ok grading unchanged). - service
emit/quickfix-edits.tssidecarClearsEntryThrow/sidecarClearsConstraintViolation→ sharedsidecarClearsDiags(input, codes)(Bug 556 dual-code gate preserved). - core
generalize.tsctorParamCountOf/ctorFormalsOftwin class-ctor walkers → singlectorParamNodesOfwalker (Bug 1031 null-declaration skip lives once; count still raw param length, formals stillformalParamsFromNodes— thethis-param skip semantics unchanged). - lsp
server-commands.tshandleSelectCase/handleSelectContract~20-line resolve→read→caseTargets→knownFunctionNames preamble →resolveCaseTarget(error strings byte-identical).
- transpile
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
1.5.6
Patch Changes
-
206713f: Fix bug-report category 06 (directive system) — 5 of 7 defects.
- BUG-013: the scope-boundary guard no longer aborts at the walk root, so a bare-block annotated statement is replaced instead of falling through to a false "matched no expression" warning; the diagnostic now distinguishes "blocked by a nested scope" from "no such expression".
- BUG-086: orphan diagnostics for inline directives are reported per instruction (with the right line/column) instead of being swallowed by a global orphan counter.
- BUG-184:
@nudo:replaceonly matches value-slot expression nodes; binding and key positions fall through to the "matched no expression" warning instead of being transpiled. - BUG-195: an in-body
/// @nudo:importline comment is now reported as misplaced (it previously fell into a silentcontinue). - BUG-283:
@nudo:skip(and the@nudo:puresibling) bind to the shallowest same-name scope instead of the last writer, so an inner function can no longer steal the outer one's skip and an inner-only skip can no longer erase the exported function'sthrowsannotation.
Regression tests:
service-bug-013-*,service-bug-086-*,service-bug-184-*,service-bug-283-*,parser-bug-195-*.Known follow-ups NOT covered here (blocked on core/service call sites outside this category's file set): BUG-020 and BUG-180 (
@nudo:mockscope degrades to file level when there is no same-name conflict) needcore/src/algebra/generalize.ts(scopeSelectedInject/hasMocks),core/src/algebra/check-may-throw.ts(evalThrowsOutcome) andservice/src/abs-modules-graph.ts(evalDep).追加:BUG-080 已修(
@nudo:as在解构声明上被静默丢弃)根因:
exec/transpile/stmt/statement.ts的emitVariableDeclaration里asVar(matchAsOverride(stmt)的结果)只在 Identifier 分支被消费,解构分支(d.id非 Identifier) 从头不读它 ⇒ 覆盖被静默丢弃;而指令本身采集正常(VariableDeclaration是语句,isDirectiveCarrier = isStatement)⇒asTargets非空 ⇒ 连 orphan 诊断都不触发 ⇒ 彻底静默、零诊断。修法:解构分支与 Identifier 分支同口径消费
asVar—— 覆盖值取代 init 的值,原 init 仍求值 (((initSrc), asVar)逗号表达式 ⇒ 副作用与 throws 域保留;@nudo:as是类型覆盖不是求值替换)。 随后emitDestructure照旧逐项$get/$idx,读到的自然是覆盖值 ⇒ 每个绑定按源键(对象模式)/ 位置(数组模式)取自己的槽;改名 / 默认值 / rest / 嵌套模式全部走原生语义,无特判。回归
core-bug-080-as-destructure.test.ts(8 例):对象 / 数组模式、改名绑定、Identifier 对照不退化、 无指令与未标注声明的负控制、原 init 的副作用保留、原 init 的throws域保留;捕获力已实证 (回退该行 ⇒ 前 3 例失败)。循环头解构(
for (const {a} of xs))上的@nudo:as没有 initializer(for-of 头不经emitVariableDeclaration,而是在emitForOfStatement内直接调emitDestructure)⇒ 该形态不施加覆盖, 改为发一条显式nudo:directive-syntax(详见下文「BUG-080 残留收口」)。BUG-080 残留收口:解构子名进绑定表 + 不可用的
@nudo:as载体显式诊断上一节记录的两处残留已收口:
残留 A(假绿)—— 解构声明的子名此前不进顶层绑定表(
$recordBinding只在 Identifier 分支登记)⇒ 该名字在别处被当作实参时解析不出类型 ⇒checkSource的varAbs查不到 ⇒ 调用点的契约检查被整条跳过 ⇒ 同一份值走 Identifier 形态会报nudo:constraint-violated,走解构形态一声不吭。 同一张表还喂collectAbsBindingsFromGraph(hover / IDE 绑定)与mock-abs.ts⇒ 解构名在那些面上也没有 Abs。修法(
packages/core/src/algebra/exec/transpile/stmt/statement.ts的emitVariableDeclaration): 解构分支按 Identifier 分支同口径登记绑定名($recordBinding(name, name),取自collectPatternNames)—— 只限顶层 depth 0;块内 / 形参 / catch / for 头不是顶层绑定(作用域正确)。 覆盖对象 / 改名 / 数组 / 嵌套 / rest / 默认值 / export 包装全部走原生语义,无特判。残留 B(静默)——
@nudo:as标注在无适用目标的语句上时被静默忽略:matchAsOverride只在emitVariableDeclaration与emitReturnStatement被询问,而指令采集接受任意语句 ⇒ 标在 for 头 / for-init / if / 表达式语句 / 函数声明上的@nudo:as被采集却施加不到任何东西 ⇒ 类型不变 + 零诊断(假绿)。 修法(packages/service/src/eval-injection.ts):目标形态白名单 =VariableDeclaration/ReturnStatement/ExportNamedDeclaration(其declaration是变量声明);不在白名单 ⇒ 发一条既有的nudo:directive-syntax(warning 级,不制造假红)且不登记覆盖目标。重钉:无。
文档:
packages/website/docs/concepts/directives.md(§@nudo:as)与 zh-Hans 镜像补两句 —— 解构声明受支持(覆盖施加在初始化表达式上,每个解构名各自绑定推断类型);其它语句形态上不再静默, 而是报nudo:directive-syntax。残留:无。上一版这里写「LSP agent 面采集内联指令时没有诊断通道 ⇒ 新诊断在 IDE 面不可见」—— 实测不成立:
nudo:directive-syntax经check-issues.ts的collectEvalReplacements(source, { diags })→directiveDiagIssues()进CheckIssue,由 LSP 编辑面(validation.ts的collectCheckSupplementIssues→checkIssueToLspDiagnostic,warning 级、source: "nudo-check") 与 agent check 工具(agent-tools.ts的 check 工具)都会发布;只有buildLspInjection()(hover / 补全的注入表装配,不是诊断面)不带 diags 汇。新增回归lsp-bug-080-directive-syntax-ide.test.ts钉住:非法载体(表达式语句 / 函数声明)在编辑面与 推送面各恰好 1 条nudo:directive-syntax(warning、不重复),合法载体(变量声明 /return) 0 条(负控制)。 -
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [0650ef0]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
- @nudojs/core@1.17.2
1.5.5
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
1.5.4
Patch Changes
-
6ebf5a4: Evaluator engine correctness, host transpile cutover, and dedupe.
-
Fix
Object.assignsecond-class calls (const g = Object.assign; g(target, src),.call/.apply) so obj/tuple targets are mutated in place with native alias visibility; direct and builtin paths now share oneperformObjectAssigncore. Frozen targets only reject a real[[Set]](empty/null/undefined sources no longer report a false TypeError; unknown key sets become may-throw), and sealed targets dispatch own accessors through$set(setters still run; getter-only still rejects). -
Fix function-value join/dedupe: branch-dependent expando slots, nested function values, anonymous/named same-shape functions,
optionalParams/ctor/paramTypes/returnTypedifferences no longer fold to a wrong exact value.$copysnapshots fn shapes independently and migrates impl/slot ownership, null-proto, and fresh-instance identity. Alias groups are scoped lexically, so fork snapshots ($copy) no longer breakconst b = aalias identity across nested functions or shadowed blocks. -
Make
renameShape/snapshotAbsstructure-preserving: tupleholes/rest, fnslots/optionalParams/ctor, obj slotsymbolKey/internal/inherited, brand/eff metadata. -
Fix compiled-body lexical scope and strictness: block-scoped
let/const/for/catch/class/static-block bindings no longer hide enclosing closures;strictis threaded from ESM/CJS source through core/service/parser Abs-fn constructors, and class bodies are always strict. An explicit"use strict"directive prologue now marks a CJS script source strict, and CJS class-method bodies compile as strict too. -
Replace the transpile→ESM-text→regex-rewrite round-trip with
transpileModule()metadata + host-target emission (__nudoBindImport/__nudoExport*, no runtime import line, no generated-code re-parse). Analyze-mode top-level stripping now happens during emission. Namespace-onlyimport * as nsnow emits valid ESM. -
Fix
$setfail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of usingundefinedas a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on.shape. -
Fix
$switchimplicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading tounknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-locallet/const/function/class(including nested blocks,forheads andcatchparams) never enter it, so an arm-local name can no longer copy/rebind a same-named outer binding and break its alias identity. -
Fix free-write collection for nested functions: hoisted
var/ function-declaration names of a nested function body now shadow writes inside that body instead of being recorded as free writes of the enclosing unit (previously emitted$copy(<name>)for a binding that does not exist there, yielding a falseReferenceError/neverand an error-levelnudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-blockletno longer drops a legitimate sibling write from the fork set. -
Module top level is now an alias-group scope boundary:
const b = aat module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object. -
Object.assignonto a sealed / non-extensible brand (prototype) target now rejects a new own key with TypeError (native parity) while existing writable keys, own setters and owner-class members still assign. -
Dedupe shared machinery: fork-arm wrapper, structural Abs keys, dependency-aware memo store + module identities, class-instance bridge, numeric bounds, internal-slot visibility, env-skip derivation from
NAMESPACE_GLOBALS, proto walk, path projection, sum-arg dispatch,undefAbs, RegExp brand predicate, export-call exception skeleton. -
BREAKING: Remove the dead public engine symbols instead of deprecating them: the module-level
phistack (currentPhi/pushPhi/popPhi/resetPhi/withPhiConstraint/describePhi),$while/$forIter/$asyncReturn/$staticInit/$thisGet/$thisSet, the HOF promotion helpers (createHofCollectCtx/promoteParamShape/tryPromote*/HofCollectCtx/AstEnv.hofCollect), the dead relation helpersalphaOf/betaOf, andgeneralizeAll.$staticInvokealso leaves the public surface (previously exported from.and./exec): it is now engine-internal, still implemented for thecheck-may-throwclass bridge. Retire dead internallanguage.tsexports (keepgetClassChain/wrapPromise).Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from
@nudojs/core/@nudojs/core/exec;$staticInvokeis no longer reachable from a host. -
Rename
exec/class-regex.tstoexec/regexp-runtime.tsto match its RegExp-brand role.
-
-
Updated dependencies [0438f10]
-
Updated dependencies [6ebf5a4]
- @nudojs/core@1.17.0
1.5.3
Patch Changes
-
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
2d96c29:
@nudojs/service新增公开导出absolutizeEnvSpec(env 规格的绝对化入口) ⇒ 纯增量(additive)⇒ minor。fix: 并发 review 收口的 10 条缺陷(闸门假红/假绿 · IDE/CLI 口径分裂 · 机器面谎报)
上一片(并发 review 收口 25 条 + 族 65/1094 两轮)之后又做了一轮并发 review(5 个分片 × 只读审查 + 逐条代码层复核)⇒ 查出 10 条该轮改动 引入或遗留的缺陷,本片一次性收口。核心仍是闸门可信度:
nudo check是 CI 闸门,假红卡死用户仓库、假绿让门禁空转。本片新增 7 个回归测试文件(全部含「修前红 / 修后绿」实测),另补 1 个 残留洞(指令作用域闸门)。
高危(4 条 · 闸门级)
-
构造器 may-throw 证据被整体丢弃且「归因落点」根本不存在 ⇒ L2 闸门假绿 (
core/algebra/check-may-throw.ts·core/algebra/scan-top-functions.ts·core/algebra/check.ts):实例方法桥把构造器跑在独立 may-throw 会话里 (软效果不进方法域 ⇒ 假红已消除),但硬抛(无条件throw)也被catch {}吞掉;而注释声称"归因给new C()入口"——该入口并不存在 (scan-top-functions.ts只登记Class.method,跳过 ctor)⇒export class A { constructor(x){ throw new TypeError("boom"); } }在 check 闸门与 test 见证面双面零诊断(0 error / 0 warning / exit 0)。 修法:新增类导出入口普查面listClassEntryNames(new C()是真实入口) ⇒ 类入口并入 L2 入口表(check.ts),构造器的硬抛进 throws 域、报在 类声明位置;构造器的软效果(any 补位的强制转换)仍不进 ⇒ 普通类 不触发 error 级nudo:entry-may-throw(假红不回归)。另:类入口的@nudo:throws申报落点 = 构造器 scope(C.constructor)⇒ 用户已申报不再被卡 (declaredThrowsForEntry)。 -
同一「裸实例兜底」在值域通道产出自信的错值 ⇒ 方法签名折
never+ 假红 (core/algebra/generalize.ts):兜底实例的内层是空 obj ⇒ 构造器写过的 字段被建模成「确定不存在」⇒this.v读成确定的undefined、this.v + 1读成确定的NaN;this.v.toFixed(2)在虚构实例上抛 ⇒ 签名never(谎称"该方法必抛、恒返回 never")⇒ 连带 error 级nudo:entry-may-throw。修法:兜底实例内层改 unknown(构造器写过的 字段 = 不可知,不是"缺槽")⇒ 不折确定错值、不在虚构实例上抛 ⇒ 签名落unknown,且方法体照常求值(不退化成整体 opaque)。与上一条同源,两处 就地复刻的孪生实现已互相点名,防止再漂移。 -
Proxy
getOwnPropertyDescriptor不变量新增规则的 3 处阈值错误 ⇒ 假红 (core/algebra/builtins/object/descriptor.ts):上一片新增的enforceProxyGetOwnPropDescInvariant在 Object 面与 Reflect 面同时接线, 三处口径与 node v26.10.0 不符 ⇒ native 不抛、引擎抛 TypeError ⇒ error 级nudo:entry-may-throw⇒ 直接卡 CI:- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
IsCompatiblePropertyDescriptor只在current.[[Configurable]]为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判; frozen被当成enumerable:false⇒Object.freeze只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);- 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒
defineProperty把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落configurable:true⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen不再改 enumerable;靶侧三标志 统一复用同文件currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
-
项目级 env 的「两层基准」只做了一半 ⇒ 分析器通道丢 env 全局 / IDE 与 CLI 结论相反(
service/src/analyzer-orchestrate*.ts·service/evaluator/env-loader.ts·lsp/src/validation.ts·lsp/src/agent-tools.ts):上一片把项目级 env 改为按项目根解析,但只改了预载侧;收集期仍用原始相对名查表, 而相对说明符只有唯一候选(按文件目录解析)⇒ 与预载登记的 key 不匹配 ⇒ 只要被分析文件声明了任何@nudo:env(哪怕是内建名node),项目级 path env 就对它完全不可见 ⇒ 返回面退never+ 假阳nudo:builtin-unknown; 同时 LSP 的env-unresolved诊断按「记录时的 preload 目录」归档 ⇒ 项目级 env 的失败被静默吞掉(IDE 假绿,CLI 同刻仍报)。 修法:绝对化规则收进env-loader.ts的单一 helper(absolutizeEnvSpec), 预载侧 / 收集期 / 缓存键 / LSP 注入 / LSP 诊断五处共用;LSP 诊断按fileEnvBaseDir + projectEnvBaseDir双取合并去重。改后 IDE 与 CLI 对同一 文件结论一致。
中危(4 条)
-
migrate strip --write把「未写盘」的成功行报成wrote(nudojs/src/migrate.ts·nudojs/src/commands/migrate.ts):库面在有失败时整批零写盘(原子性)并给 成功行附注记,命令层却把注记行当普通成功行推入results,人类面用opts.write ? "wrote" : "dry"无条件打wrote⇒ 同一行既说 "wrote" 又说 "not written",而磁盘上根本没有.js;--json侧只有一条自由文本notes能区分 ⇒ 机器消费方极易误判已产出。修法:新增机器可判定的writeStatus("written"/"not-written"/"planned"),人类面按逐行 状态措辞(wrote/not written/dry)。 -
HOF 元组元素域把已知的 null/undefined 压成
any(core/algebra/hof.ts): 引擎把null/undefined建模成unknown形状 + lit 项,而元素域按 shape kind 判"域是否可知" ⇒ 把已知类型误判成"域不可知" ⇒[null]的元素域从null退成any、[1,null]退成any(应为number | null);any是"自信的任意值",参与算术即强制转换 ⇒ 记 may-throw ⇒ L2 假红面。修法:三分类——已知 nullish(不参与异型判定、只贡献 可空性,用仓内既有makeSum表达联合)、真·推断失败(退unknown, 不是any)、其它(同型判定不变,异型仍退any)。 -
文件级指令的作用域闸门未覆盖
ArrayExpression/ObjectPattern/ArrayPattern(parser/src/directives/file-directives.ts·core/algebra/directive-scan.ts): 写在数组字面量 / 解构模式里的@nudo:env被静默提升成整文件生效(零诊断, 越权)。修法:两侧孪生闸门同步扩到三类嵌套体(两通道 23 组样例逐例一致)。 -
引理账本写入是「死写」(
core/algebra/check-return.ts):Φ 侧的消费在 证明段里记进账本,而调用方传入的consumedAssume快照取自调用之前 ⇒ Φ 侧的写入永远读不到 ⇒ 账本与归因两套口径(changeset 宣称的"经noteAssumeConsumed记进账本 ⇒ 归因可见"实际断在取数时序上)。 修法:归因集就地取账本(读在写之后)⇒ 账本是"消费过"的唯一事实源, 调用方快照退化为兜底。
验证
- 全仓
tsc --noEmit(pnpm run lint)0 错误;pnpm run buildexit 0; pnpm run test全量绿(1757+ 文件 / 14500+ 用例,exit 0);- 新增 8 个回归测试文件,全部修前红 / 修后绿实测(红数由回滚修复逐条复核):
core-bug-1095(Proxy 阈值,22 例 · 修前 12 红)、core-bug-1096(构造器 归因,11 例 · 修前 6 红)、core-bug-1097(HOF 元素域,15 例 · 修前 10 红)、core-bug-1102+parser-bug-1101(指令闸门,79 例 · 修前 12 红)、core-bug-1103(引理账本,5 例 · 修前 1 红)、service-bug-1098+lsp-bug-1099+lsp-bug-1104(env 两层基准,11 例 · 修前 6 红)、nudojs-bug-1100(migrate strip 写盘状态,6 例 · 修前 5 红)—— 合计 149 例; - 产品 CLI 面逐条复现核对:
nudo check对"构造器必抛"报 error 级nudo:entry-may-throw(归在类入口)、对"构造器软 throw"零 error; Proxy 三场景(可配置靶异形态 / 冻结靶 / brand 靶)零 error;migrate strip --write失败批输出not written且磁盘零写盘、--json带writeStatus: "not-written";项目级 env + 文件级 env 并存时nudo check得f() => 42(修前为never+ 假阳)。
已知边界 / 未闭合
- Proxy
gOPD仍有 3 处漏抛(靶不可扩展且键不存在时报configurable:true; 靶不可写+不可配置而陷阱省略value;靶为不可配置访问器且 get/set 身份不同)—— 基线同样不抛(非本次回归),新增抛点有制造新假红的风险 ⇒ 已把 node v26.10.0 实测矩阵写进core-bug-1095测试文件注释,留待单独立项。 - 不可配置访问器靶现在也会比对
enumerable(原生确实抛)——属收紧, 若有用例依赖旧的"访问器靶跳过该比对"需按原生重判。 - HOF 异型元素仍退
any([1,"a"])——既有保守口径,本片未窄化成联合。 - 真·未知 ⇒
unknown会让该 α 恰为返回类型时多一条 warning 级nudo:unknown-inference(级别 warning,不影响 L2 闸门)。 - 进程级
lastEnvBaseDir单槽(同步analyzeFile路径下的文件级相对名) 与 Windows 下isPathEnvName只认/均为既有基线,本片未动。 - MCP
nudo check工具面(同步、无 path env 预载)与migrate strip --json顶层形态不统一(成功=裸数组 / 失败=对象信封)仍待单独立项。
-
-
e424592: File-level
@nudo:directives no longer evaporate in silence: the mock-module payload grammar accepts single quotes, the env payload grammar accepts space-separated lists, block-comment@nudo:importis ignored instead of taking effect, and an empty@nudo:importpayload is diagnosed.@nudo:mock-module 'axios' from './mocks/v-axios.js'was silently dropped. The two payload regexes hard-coded double quotes, so a single-quoted payload matched neither and the directive returnedundefined. The mock was never installed, no diagnostic was raised, and the gate stayed green. Single quotes are now accepted (the source and the path may even use different quote kinds), and an unparsable payload now raisesnudo:directive-syntaxinstead of vanishing.@nudo:env node webwas silently dropped. The payload was split on commas only, so a space-separated list became a single token and was filtered out; a bare/// @nudo:envtag did not even match the tag regex. Both forms were discarded with no diagnostic, so no environment was loaded and everything stayedunknown. Commas and whitespace are now both accepted (trailing comments are stripped), and a bare tag raisesnudo:directive-syntax.@nudo:importinside a block comment took effect. The text scanner flattened line comments and block comments into one list and dropped the comment kind, so a block-comment import really loaded its sidecar — the opposite of@nudo:env/@nudo:mock-module, which the AST channel ignores in block comments. Comment kinds are now kept apart: line comments take effect, block comments are ignored and warned about./// @nudo:importwith an empty payload was silently discarded. The payload was dropped before the malformed-import scanner could see it, so the malformed form had no diagnostic while other unrecognised forms of the same directive did. The empty payload is now reported as a malformed import and raisesnudo:contract-syntax.
-
e424592:
@nudo:casewitnesses no longer evaporate in silence: an escaped quote in an argument no longer swallows the whole case, the=> expectedpart is read on CRLF sources, on the next line and behind a!! throwssuffix, redundant brackets around the expectation are stripped, and a glued@nudo:case"name"tag is diagnosed instead of vanishing.@nudo:case "k" ("a\"b") => 3was dropped entirely. The bracket scanner was string-aware but not escape-aware, so the\"inside the string ended the string, the bracket closed early and the whole case was discarded. What remained on screen was a misattributed "unclosed argument list" warning. Balancing now follows JavaScript escape semantics first; a string that never closes (not valid JavaScript) still falls back to the previous lenient reading, so the argument count seen by the check face and bynudo teststays the same.=> expectedwas lost in a CRLF source file. The line was split on\nand the trailing\rstayed in the expectation text, so the expectation failed to parse and was dropped: the case became[unchecked], the assertion never ran,nudo testexited0and nothing was reported. Lines are now split on\r?\n.- A
!! throws [Kind]suffix on the case line was read as the expectation text. With the suffix before=>the expectation disappeared entirely; with the suffix after=>the text1 !! throwswas parsed and rejected. The suffix is now stripped from the expectation expression only — the case line itself is never rewritten, so the function-level!! throwsdeclaration still sees it. => (999)/=> ("a")/=> ({ b: 1 })never parsed, because the expectation kept its outer brackets while the argument side had always stripped them. The expectation now drops its redundant outer brackets, the same way the arguments do. An arrow function ((x) => y) is left alone.- An expectation on the line after
=>was silently discarded, and an expectation that was written but empty was discarded just as silently. The value is now read from the next line, and an empty=>is reported asnudo:directive-syntaxinstead of passing unnoticed. @nudo:case"c1" (1, 2)— no space between the tag and the name — was neither extracted (the extractor requires a space) nor reported (the diagnostic side accepted it). The case vanished with no diagnostic andnudo testran no case at all. Both sides now share one grammar, and the glued form is reported asnudo:directive-syntax, the same way a glued@nudo:mockname is.
-
e424592: Malformed
@nudo:directives are diagnosed instead of evaporating in silence: an empty or glued@nudo:assume/@nudo:invariant/@nudo:contract/@nudo:throwsnow raises a syntax diagnostic, and a!! throwssuffix is only read where it is actually a directive.@nudo:assumewith an empty payload, or@nudo:assumed d <= max(a space missing between the tag and the payload), matched no branch at all: the scanner returned nothing and nothing was reported. The lemma was dropped without a word, so the return contract fell back from "proved" to "unproved" and the only sign was anudo:unproven-returnwhose text blamed inference precision instead of the rejected lemma. An empty or glued@nudo:assume/@nudo:invariantnow produces a bad segment and raisesnudo:assume-invalid/nudo:invariant-invalid; a glued or empty@nudo:contract/@nudo:throwsraisesnudo:contract-syntax/nudo:directive-syntax. The strict grammar is unchanged — a tag still needs a separating space — the loose forms are only reported.!! throwswas matched anywhere in a function's comment block, so a prose line ("this helper uses!! throws") or a case name that happens to contain that text was read as a function-level throw declaration. The declaration then covered every throw,filterGateThrowslet them all through, and thenudo:entry-may-throwgate was silently switched off while the signature still printedthrows TypeError. The suffix is now only read where it is a directive: after the argument list of a@nudo:caseline, or on the continuation line of such a case. The documented case-suffix form (@nudo:case "neg" (0) !! throws) keeps working exactly as before.- The same glue was invisible to the inline directives of the parser package:
@nudo:replaceFoo x number()matched neither the strict nor the loose pattern, so the whole inline directive disappeared. It now raisesnudo:directive-syntax. The@nudo:asside keeps the behaviour already merged for Bug 842: a tag whose name is extended (@nudo:asXYZ) is not an@nudo:asdirective and stays silent.
-
27cc16a:
@nudo:casewitnesses and expected values now follow JavaScript literal semantics, and an unreadable expected value can no longer pass silently.- The numeric branch of the case-argument grammar only recognized a decimal
regex, so every other legal JavaScript number — exponent notation, hex,
binary and modern octal literals, numeric separators, a leading or trailing
dot, a unary sign — was folded into
unknown. Sinceunknownis the top type (leqAbs(actual, unknown)always holds), the witness satisfied any contract and the assertion passed for the wrong reason. Those forms are now parsed with JavaScript literal semantics, so1e3is1000,0x10is16,0b101is5,0o17is15,1_000is1000,.5is0.5and5.is5. - A legacy octal literal was read as decimal (
Number("017")is17), while sloppy-mode JavaScript reads it as octal (017is15). The witness and the expected value were therefore a confident wrong value. A leading zero now means octal (017→15,010→8), and a leading zero with8/9keeps sloppy decimal semantics (08→8). - Expression-shaped literals — a parenthesized value (
(7),-(7)), an unsigned or negative sign (+1,- 7), a template literal without interpolation (`x`) and a bigint (7n) — were also folded intounknownand are now recognized. - An expected value that cannot be parsed was folded into the same
unknownAbs as an explicitunknown, soleqAbs(actual, unknown)always held and the assertion was vacuously true: the report said "1 passed" and the command exited with0. A parse failure is now distinct from an explicitunknown: it is reported through the existingnudo:directive-syntaxchannel and the assertion fails instead of passing. An explicitunknown/anykeeps its meaning of "not constrained".
- The numeric branch of the case-argument grammar only recognized a decimal
regex, so every other legal JavaScript number — exponent notation, hex,
binary and modern octal literals, numeric separators, a leading or trailing
dot, a unary sign — was folded into
-
27cc16a: String literals in
@nudo:case/@nudo:skip/@nudo:mocknow follow JavaScript string semantics, and a text that is not a single string literal is no longer folded into a wrong value.- A string literal was taken by slicing off the first and the last
character, so escape sequences were never interpreted:
"a\tb"became the four-character stringa\tb(with a literal backslash) instead ofa<TAB>b. A witness therefore did not denote the same string as the sidecar contract, which is evaluated as real JavaScript, and the contract gate reportedwitness ⊭ contractfor a witness that was in fact correct. Escapes are now interpreted with JavaScript semantics (\t,\n,\\,\",\uXXXX, …). - The same slice accepted any text that merely started and ended with a
quote, so
"a" + "b"was folded into the stringa" + "b— a value nobody wrote. The expectation of a case, a case witness, the declared return type of@nudo:skipand the payload of@nudo:mockall carried that wrong value, and the reported expectation was unreadable text. A string is now recognised only when the whole text is one string literal; anything else is reported as unrecognized (nudo:directive-syntax) and no longer produces a confident wrong value. - The rule lives in one place (
directives/string-literal.ts), so the case argument, the expectation,@nudo:skipand@nudo:mockshare it.
- A string literal was taken by slicing off the first and the last
character, so escape sequences were never interpreted:
-
27cc16a:
@nudo:case/@nudo:mockpayloads no longer lose structure or optionality.- The object / array literal branch of the case-argument grammar only checked
the first and the last character of the text, so trailing text was folded
into the value:
[1][0]became the tuple[unknown]and{ a: 1 } + { b: 2 }became{ a: unknown }. The engine then reported a confident wrong value and the assertion failed even though the expected value was plain JavaScript. The whole text is now validated as exactly one literal; anything else is treated as "not recognized" (unknown) and is reported through the existingnudo:directive-syntaxchannel. - An object literal property without a top-level colon (a getter, a method
shorthand or a shorthand property) was silently dropped, so a
@nudo:mockpayload lost that property without a word and the mock value became a confident wrong value. Such a literal is now rejected as "not recognized" and the offending property is named in anudo:directive-syntaxdiagnostic. - The
optionalflag of ashape({ … .optional() })field was dropped when the expected value was projected into an Abs, so an optional field became mandatory and a legal actual value failed the assertion, and the reportedexpectedtext did not show?. The flag is now projected into the slot, matching the contract (sidecar) face of the same grammar.
- The object / array literal branch of the case-argument grammar only checked
the first and the last character of the text, so trailing text was folded
into the value:
-
27cc16a: Directive parsing no longer loses or over-applies directives: malformed mock tags are reported instead of evaporating, file-level directives only apply where they are written, and a case expectation is no longer voided by a trailing comment.
- A file-level
/// @nudo:mock-module "fs" from "./mock-fs.js"was caught by the function-level@nudo:mocktag pattern, so a correct file produced a fabricatednudo:directive-syntaxwarning ("Malformed @nudo:mock …"). The mock tag now requires a name boundary that excludes the-suffix of the file-level family. @nudo:mockwith an empty payload (@nudo:mock fetch =,@nudo:mock g from) matched neither strict grammar, so the directive evaporated silently — no mock, no diagnostic, and the analysis ran against the real API. The three mock grammars are now closed: a tag that matches the lenient pattern but neither strict one is reported throughnudo:directive-syntax.@nudo:skip=> number()(no space between the tag and the payload) dropped the whole payload, so the declared return type never took effect and the signature degraded fromf() => numbertof() => any— ananyleak into the product surface. The separating whitespace is no longer part of the required structure.@nudo:mockfetch = …(no space between the tag and the name) did not even match the lenient tag pattern, so the whole mock was invisible to the scanner: zero diagnostics and the analysis ran against the real implementation. The lenient pattern now sees the glued spelling and reports that a space is required.- A
@nudo:caseexpectation with a trailing comment (=> string() // the result is a number) failed to parse and fell back to an explicitunknown, which satisfies every expectation — the assertion was silently voided and the command reported "1 passed" with exit code0. The trailing comment is now stripped before the expectation is parsed. - A malformed
@nudo:casedid not register an argument-region mask, so@nudo:mock/@nudo:skipwritten inside its arguments leaked out as real directives (false positives, methods dropped from the emitted declaration). Malformed cases now mask their argument region as well; the malformed-name diagnostic is unchanged. - A file-level
@nudo:env/@nudo:mock-modulewritten inside a function body was promoted to whole-file scope: the environment or the module replacement applied to the entire file, with zero diagnostics. File-level directives are now position-gated — a line comment inside a function body is ignored and reported throughnudo:directive-syntax, while top-level positions (file header,exportline, between statements) keep working. The same gate is applied to the text-level extraction used by@nudo:import, so the three file-level families now behave alike.
- A file-level
-
27cc16a: Inline directives and mock payloads keep their meaning: an
@nudo:aspayload is no longer dropped when it is written without a separating space, a trailing comment no longer turns a valid type intounknown, an inline mock keeps itsasyncflag and its parameter bindings, and two identical malformed directives in one file are no longer collapsed into a single diagnostic.@nudo:as(string())(no space between the tag and the payload) matched neither the "payload" pattern (which required whitespace) nor the "bare tag" pattern (which only accepted@nudo:ason its own), so the whole directive evaporated with zero diagnostics and the type override never took effect. The separating whitespace is now optional, an outer pair of balanced parentheses is unwrapped (@nudo:as(string())is@nudo:as string()), a tag whose name continues with an identifier character (@nudo:assume,@nudo:ascii) is still not an@nudo:asdirective, and an empty payload is reported explicitly.- A trailing comment without a preceding space (
@nudo:as string()// why) was merged into the type expression, so a valid type was judged "unsafe" and degraded tounknown— the type override silently stopped applying. Trailing comments are now detected by lexical boundary; a//that follows a numeric literal and a digit is still read as a division, and comment markers inside a string literal are still ignored. @nudo:mock f = async (x) => x + 1lost itsasyncflag during parsing, so the mock was modelled as a synchronous function and the call sitef(1).then(…)was reported as "method 'then' missing on number receiver" — an error-level false positive (native returns a promise). The scan result now carries theasyncflag.- The parameters of an inline mock payload had no binding semantics: a
destructuring parameter was replaced by a placeholder name, a default-value
parameter was dropped entirely, and a rest parameter kept its literal
.... The mock body therefore read undeclared globals (ReferenceError) and the emitted declaration saidnever. The parameter list now keeps the source form, the parameter ASTs and the bound names, all aligned one-to-one. - The deduplication identity of a directive diagnostic was the code plus the message text, with no position, so two word-for-word identical malformed directives in one file collapsed into a single diagnostic and the second occurrence was completely invisible. A diagnostic now carries the position of the offending directive and the identity includes it: the same problem at the same place is still reported once, while the same text at two different places is reported twice.
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [7fea13a]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
- @nudojs/core@1.16.0
1.5.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
1.5.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
1.5.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- Updated dependencies [aae0f96]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
1.4.24
Patch Changes
-
c19bd48: Misplaced file-level directives now warn instead of being silently ignored, and
nudo.analysis.excludesupports real globs (fix-12 batch).- parser: file-level directives (
@nudo:env/@nudo:mock-module) written inside JSDoc blocks emitnudo:directive-syntaxwith the correct///form instead of being dropped silently. - service:
nudo.analysis.excludeaccepts glob patterns (sharedcompilePattern, extracted from vite-plugin as the single source; plain substrings still work, defaults always stack). - vite-plugin: pattern matching cut over to the shared
compilePattern— behavior unchanged, one implementation.
- parser: file-level directives (
-
Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
1.4.23
Patch Changes
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
1.4.22
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
1.4.21
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
1.4.20
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
1.4.19
Patch Changes
- Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
1.4.18
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
1.4.17
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
1.4.16
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
1.4.15
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
1.4.14
Patch Changes
- Updated dependencies [334b914]
- Updated dependencies [94197eb]
- Updated dependencies [b8db17b]
- Updated dependencies [5e275df]
- @nudojs/core@1.10.0
1.4.13
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
1.4.12
Patch Changes
- Updated dependencies [b6495c6]
- Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
1.4.11
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
1.4.10
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
1.4.9
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
1.4.8
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
1.4.7
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
1.4.6
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
1.4.5
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
1.4.4
Patch Changes
- Updated dependencies [d6fa067]
- Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
1.4.3
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
1.4.2
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
1.4.1
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
1.4.0
Minor Changes
-
50e50f1: feat(parser): 指令文法诊断通道收敛为显式 sink
原变更曾以 major(2.0.0)形式发布后被整班撤回;现按团队决定以 1.4.0 minor 落地。内容含删除模块级 side-channel 旧 API(
takeDirectiveDiags/takeDirectiveDiagsSince/directiveDiagCount/setDirectiveDiagCollector)——仓库内全部消费方(service / lsp / nudojs / harvester)已随本班车迁移显式通道,外部如有直接使用这些旧 API 的集成请按下述迁移。extractDirectives(ast, { diags })/extractInlineDirectives(node, { diags }):诊断同步落调用方数组,单次调用内同文案去重;不传diags为纯查询形态(诊断丢弃,等价extractDirectivesQuiet)- 新增
runWithDirectiveDiags(diags, fn):把「extract + 复解析」(如 nudo check D1 段的@nudo:mock表达式种子复解析)包进同一去重域 - 删除模块级缓冲与上述旧 API。迁移路径:
directiveDiagCount()+takeDirectiveDiagsSince(since)锚点对 →extractDirectives(ast, { diags })直接落袋(或runWithDirectiveDiags包住 extract+复解析窗口);takeDirectiveDiags()整批排干 → 显式diags数组 collectEvalReplacements(source, { diags })(@nudojs/service,additive):行内@nudo:as/@nudo:replace文法诊断显式落袋,nudojs check 的 D1 并入面行为零变更(issue code / 合并顺序 / 去重口径保持)- 删除动因:模块级缓冲曾引发两轮跨消费方偷诊断事故(R2B-003:全量 take 在 await 窗口偷走在途诊断);service analyzer 与 LSP validateText 此前已迁移显式通道
Patch Changes
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
1.3.2
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
1.3.1
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
1.3.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
1.2.1
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
1.2.0
Minor Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
Patch Changes
- Updated dependencies [f10066d]
- @nudojs/core@1.4.0
1.1.9
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
1.1.8
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
1.1.7
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
1.1.6
Patch Changes
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/core@1.2.1
1.1.5
Patch Changes
- Updated dependencies [5ff4202]
- Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
1.1.4
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
1.1.3
Patch Changes
-
3bf9997: fix(core): JS semantics soundness — ToString args, compare undefined, NaN identity, JSON.stringify
B-path Abs folding corrections so concrete results match native JS:
- string/parse methods (
startsWith/endsWith/includes/split/replace/indexOf/parseInt/parseFloat) honor ToString and missing-arg defaults;splitkeeps the ES special case that an undefined separator returns[ToString(O)]without splitting - relational compare of
lit(undefined)folds via ToNumber (all relations false) - same-var
===is not exacttruewhen the value may be NaN JSON.stringifyof top-level function/symbol returns the JSundefinedvalue- NaN literal identity uses SameValue (assignment/
leq), not=== - drop unsound
x*0=0/x+0=xalgebra identities (NaN/-0/string domain) n % 0folds to NaN;x % kbounds only for finite dividends0nis falsy;Number.is*fold non-number lits to false; globalisNaNcoerces- string index methods (
charAt/slice/…) honor ToNumber and default args - unary minus and
parseInt/parseFloathonor ToNumber/ToInt32 - Math.* folds ToNumber lits (own numeric methods only — no
constructor/toString) - tuple index reads use canonical array index (
a["0"] === a[0]) - call-spread placeholder is
unknown, notundefinedlit
fix(parser): directive scanners (splitTopLevelArgs/ colon / arrow / balanced parens) respect string literals.Review follow-ups folded in:
split(undefined)special case,indexOfreturns number shape on abstract receivers, Math method allowlist. - string/parse methods (
-
Updated dependencies [3bf9997]
- @nudojs/core@1.1.3
1.1.2
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
1.1.1
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
1.1.0-beta.0
Minor Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
Patch Changes
- Updated dependencies [22baf33]
- Updated dependencies [0e1432a]
- Updated dependencies [3c3f9d2]
- Updated dependencies
- Updated dependencies [279d73a]
- @nudojs/core@3.0.0-beta.0
1.0.0
Major Changes
-
69ebbf6: Align product surface with interface-first design:
@nudo:caseis debug /nudo testonly, and theT.*directive grammar is removed.- Directive type expressions accept constraint builders (
number(),lit(),shape(),union(),array(),any(), …) and concrete literals only. BareT.*parses as unknown;parseTypeValueExpris no longer exported — useparseCaseArgExpr. serializeCaseArg/--emit-casesemit builders (number(),union(…)) instead ofT.*.- LSP
typeExprToDirectiveemits builders (number(),union(…),any()). - CLI
inferreports call-site facts (call@L…) anddebug "name"witnesses withObserved:joins — notCase "…"/Combined:as the type product. Contracts stay on*.nudo.js/@nudo:refine. - Constraint builders accept concrete nested literals so directive grammar round-trips.
- Directive type expressions accept constraint builders (
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/core@2.1.0
0.5.1
Patch Changes
- Updated dependencies [9731238]
- @nudojs/core@2.0.1
0.5.0
Minor Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
0.4.2
Patch Changes
- Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
0.4.1
Patch Changes
- Updated dependencies [0fd253f]
- Updated dependencies [a2aac9e]
- Updated dependencies [0f0b7d5]
- Updated dependencies [de47d84]
- Updated dependencies [78f6752]
- @nudojs/core@1.0.0
0.4.0
Minor Changes
- 1d6bb01:
getFunctionName对export const f = …(ExportNamedDeclaration + VariableDeclaration)返回<anonymous>——现在递归进入声明节点,导出箭头函数获得真实函数名,case 求值可达。
Patch Changes
- Updated dependencies [1d6bb01]
- Updated dependencies [1d233a7]
- @nudojs/core@0.4.0
0.3.1
Patch Changes
- bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
0.3.0
Minor Changes
-
5786fa5: Improve
@nudo:mockparsing for sinon-style stubs and share parse/strip with core.- Support
stub().onFirstCall(),stub().callsFake(fn), andsinon.-prefixed chains as the same MockHelper shape TypeValue/Abs already consume. - Drop the unused
ReturnsDirective/@nudo:returnsdirective type (contracts use@nudo:refine). parse()now strips types unconditionally via coreparseSource(shared AST cache).
- Support
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version
Patch Changes
- Updated dependencies [6c38283]
- Updated dependencies [9f7f819]
- Updated dependencies [c175f71]
- @nudojs/core@0.2.0
0.1.0
Minor Changes
- Conceptual design and basic implementation.
Patch Changes
- Updated dependencies
- @nudojs/core@0.1.0
@nudojs/lsp 1.10.3
1.10.3
Patch Changes
-
795e322: Close the 34 bugs from the ABS-15 audit, grouped by root cause rather than patched one at a time.
check— one judgment per decision, so the faces cannot disagree:- a
.tsconstructor annotation (including parameter properties) is now the instance field's domain, soconstructor(private size: number)+area() { return this.size * this.size }reportsnumberinstead of anany-arithmeticnudo:entry-may-throwerror while the dts face already saidnumber; - definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero,
inon a primitive right-hand side, and calling a member an object literal does not have; - the call-site local binding table records every declaration shape (parameters,
catch,for-of/in,let/var, destructuring) as an explicit "no information" entry, so shadowing no longer reads the module-levelconst(false red) and destructured declarations reach the obligation check (false green); - a classic
for (const i = 0; …; i++)head is aconstagain, so the always-throwing step is reported instead of staying green; nudo:capability-deniedjoins the check-face diagnostic whitelist, sonudo checkcan report the cause ofunknownlikenudo test— gated on the report actually showing an inference failure (nudo:unknown-inference), so a plainmodule.exports = …file does not grow a warning about themoduleglobal while the same exports written asexports.xreport nothing.- cross-file evidence from
--fromnow resolves the default export name on both sides, so a renamed default import,import { default as g }andns.default(...)are no longer silently dropped.
nudo export— the publish gate is a semantic judgment (degraded evidence on the published surface AND a declared contract) instead of a three-code whitelist, with declaration truth taken fromeffectiveContract's own resolution. Contract-face diagnostics always block; general degradation (nudo:internal/nudo:unknown-inference) blocks only when it is attributed to an entry that declared a contract (or carries no function, i.e. is module-level). Compatibility: a module whose contract fails to parse (nudo:contract-syntax) now blocks the export (exit 1, no artifacts, diagnostics surfaced) instead of publishing an "accepts everything" validator with exit 0; unannotated modules — and unannotated sibling entries — keep publishing and only see the degradation surfaced.dts projection — one resolvability predicate for type names (TS tokens, runtime globals, local classes, mirrored
interface/type, imported names) plus the missing branches it exposed:export =for single-value CJS modules, member-wise types forexport default {…}and arrays, real re-export statements for imported bindings,extends/type-parameter clauses on namespace members, and destructured parameters that render as a pattern the source can actually write. Compatibility:<fn>Inputkeys a destructured parameter by its field names rather than the internal_p0placeholder, which is not a public name and made the published validator reject the only legal call shape. Two boundaries are pinned: a module that exports a type (export interface/export type) alongsidemodule.exports = valuekeeps the named-export projection (TS forbidsexport =next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than onereturnprojectsunknowninstead of the first return's type (a single-return pick would be narrower than the runtime value).LSP — completion decides the lexical context with a per-character scanner (line and block comments, quotes, templates with
${}nesting, regex bodies and character classes), so a continuation line inside a multi-line template or comment no longer offers rewrites of the literal; member completion merges the instance/static class member table from core's single class-body scan.The
checkentry census behind these runs on the semantic binding index (ADR 0001 stage 1), and stage 1 slice 4.3 replaces the publish gate's shadow comparison with the semantic verdict it was measuring. The public.export surface is unchanged. - a
-
Updated dependencies [795e322]
-
Updated dependencies [161d156]
- @nudojs/core@1.20.1
- @nudojs/service@1.12.3
- @nudojs/parser@1.5.11
Version history (65)
1.10.2
Patch Changes
- Updated dependencies [c93a32d]
- Updated dependencies [190761e]
- Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
- @nudojs/parser@1.5.10
- @nudojs/service@1.12.2
1.10.1
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
- @nudojs/parser@1.5.9
- @nudojs/service@1.12.1
1.10.0
Minor Changes
-
4fc7e19: Rename the remaining Nudo
interfaceterminology tocontractend to end.- Core:
effectiveInterface→effectiveContract,InterfaceSource→ContractSource,InterfaceTierInfo→ContractTierInfo,interfaceTierOf→contractTierOf,takeInterfaceDiags*→takeContractDiags*, and thealgebra/interface/directory →algebra/contract/. - Service:
emitInterface/draftInterface/interfaceSurface→emitContract/draftContract/contractSurface;interface-*.tsfiles →contract-*.ts;ifaceCacheKey→contractCacheKeyand the disk-cache namespaceiface→contract. - Diagnostics:
nudo:interface-*→nudo:contract-*(no alias layer). - CLI/LSP: CodeLens titles
⚡ persist contract/↻ update contract/⚡ draft contract; agent messagesno contract found/no contract changes;CheckIssueactions and hover/inlay fields usecontractSource/contractDisplay/contractActive. - Docs, examples (
contract-derivation/,contract-draft/), API snapshots, and website references updated.
TypeScript's
interfacekeyword, Babel ASTTSInterface*, and historical release notes are intentionally unchanged. - Core:
-
7152d84: Feat: LSP rename scope-conflict detection + inlay any/unknown responsibility split.
- rename: the new name now goes through a scope-conflict check (
renameNameConflictsinsymbols.ts) on top of the existing syntax-level validation (Bug 750). A rename is rejected (null, no edits) when the new name would break the source: duplicate declaration in the target scope, outer capture (renamingxto an outer name referenced inside the target scope), inner-scope capture (a target reference sits inside a scope that declares the new name), duplicate member key within the same class/object owner, duplicate#privatename, or duplicate export name. Plain cross-scope shadowing stays allowed. Cross-file renames re-run the check in the defining file's scope (import / re-export scenarios). Same philosophy as ambiguous-receiver rejection (Bug 712): refuse rather than break. - inlay: return-position hints that render exactly
unknown(= inference failure, engine debt) now carry a⚠label prefix and a tooltip naming the failure and the fix channels (@nudo:mock/@nudo:env/@nudo:contract);any(unconstrained param — developer responsibility) never gets the warning prefix, and itswhere any()tooltip gains a responsibility note while preserving the existing predicate expansion. The display contract is unchanged: unconstrained params still renderany, neverunknown.
- rename: the new name now goes through a scope-conflict check (
Patch Changes
-
38eedd0: Fix the macOS
/var→/private/varpath-space mismatch behind the 9 long-standing LSP/CLI baseline failures, and remove watch FSEvents noise.On macOS
os.tmpdir()returns/var/folders/..., a symlink to/private/var/folders/.... The kernel givesprocess.cwd()/realpathSync()the realpath form, while user arguments and test fixtures keep the/var/...literal. Two product faces mixed those spaces:- LSP emit boundary (
agent-tools.ts):assertEmitTargetAllowed/resolvedWorkspaceRoots/derivedSidecarAllowedrealpathed only existing paths. A not-yet-written source file or downstream sidecar fell back to the/var/...literal and was compared against a/private/...root, so legitimate writes were rejected as "outside allowed roots" (Bug 762 derived emit, Bug 765 unsaved-buffer guard). All three now use the sharednormalizeRealPathfrom@nudojs/service, which falls back torealpath(dirname) + basenamefor missing targets. Real symlink-escape protection is unchanged (Bug 766's escape case still fails closed). - CLI relative display:
relative(process.cwd(), resolve(userArg))produced../../../../../../../var/.../syn.js, polluting the JSONfilefield and human-facing text (Bug 661 / 663 / 664 / 63b). NewrelFromCwd()normalizes the target into the cwd's realpath space before subtracting; the contract command family (print / draft / emit / from-dts) and watch error lines now use it.displayPathOfis deliberately untouched, so the check/test/health baselines stay byte-identical. On non-symlink hosts and in-repo paths output is byte-identical.
The same watch loop also stops swallowing edits: fingerprint baselines are recorded when a round's changed paths are accepted, before analysis (and dropped for deleted files), not after the incremental round resolves. The old ordering re-baselined any write that landed while the round was running, so
filterUnchangedWatchPathssaw it as unchanged and the edit was silently skipped until the next save.startWatchnow filters FSEvents noise: macOS directory watchers report untouched files from the same batch, so changinga.jscould also re-runsub/b.jsand made the Bug 684/685 "re-run exactly the changed file" assertions flaky (~1/3 of runs). The debounce window keeps only paths whose(size, mtimeMs)fingerprint actually changed; deletions, new files and non-tracked paths (config / sidecar / env templates) always pass through. Extracted as testablewatchPathVersion/filterUnchangedWatchPaths, covered bycli-watch-noise-filter.test.ts(7 cases). Reverting the filter reproduces the flake; with it, 8/8 repeated runs and all 12 watch test files / 33 cases pass. The lose-an-edit race has no deterministic e2e fixture yet (it needs a controllably slow analysis); the pure filter plus the existing watch suites are the regression surface. - LSP emit boundary (
-
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [1a4cabd]
-
Updated dependencies [b57d1d2]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [4361e2e]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [1aab8ff]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [a9638c2]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [b060986]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
- @nudojs/service@1.12.0
- @nudojs/parser@1.5.8
1.9.0
Minor Changes
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
-
5cd4106: Dedup batch 2 (jscpd + hand-sync-comment audit): single-source the remaining cross-file / cross-package copies that were pinned together by comments or mirror tests instead of code.
- String-aware scanners (
splitTopLevelArgs/findTopLevelColon/stripJsdocContinuation→ newcore/algebra/text-scan.ts, exported via@nudojs/core/internal): the check face (case-arg split) and the parser directive face each kept verbatim copies — Bug 1009 was exactly this pair drifting (check face treated\as an escape ⇒ one arg fewer ⇒ L2 witness silently skipped).scanWithStringswas dead after the move and is gone. - bigint operand predicates (
isNullishLitOperand/isKnownNonBigintNumeric/isMaybeBigintOperand):surface.tscarried a forked copy ofarithmetic/coerce.ts— itsisMaybeBigintOperandlacked the Bug 946arr/tuplearms and only stayed sound by accident of the catch-all throw. Single source in coerce;foldNumericBinOpnow mirrors foldBigintBinOp's explicit arr/tuple hard-throw so1n & []still throws deterministically. - Bug 946 member-level fix (behavior):
isMaybeCoercionThrowOperandnow recurses intosummembers and skipsarr/tuplemembers —x & 1/1 - xwithx: number | []no longer records a false TypeError may-throw (native never throws; the old member scan dragged arr members into the may-throw channel ⇒ potential L2 false red). Regression-pinned in the Bug 946 suite, including the sound positive control (1n + xon the same union still records may-throw: the number member genuinely throws). collectNestedBodyRangeswiring completed: core exported it via@nudojs/core/internaland its comment claimed parser reuse, but parser still ran a full local copy.file-directives.tsnow consumes the single source.parseIgnoreThrows/configIgnoreThrows: service is the declared single implementation (CLI / LSP / vite-plugin); the CLI kept its own verbatim copy and the LSP test suite used that copy as a mirror oracle. nudojs now re-exports from@nudojs/service; the tautological mirror assertion is replaced by direct-value assertions.absShapeForTsTypeTextvia@nudojs/core/internal: service'stsAnnotationShapewas a hand-synced table replica ("勿单边扩表") with a drift-gate test holding the two copies together; both the replica body and the drift-gate file are gone.- emit section extraction:
interface-derivation-emit.tsandinterface-emitter.tsduplicated the export-statement →{names, bindings}extraction (31 lines) andstripSections(14 lines); both now shareservice/emit/export-section-scan.ts. ScanLiteralCallsOptions: the thin shell's inline opts literal type was a documented structural mirror of the named interface; the shell now consumes the interface directly.
- String-aware scanners (
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
7d7abe4: Dedup batch 4 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the three remaining comment-pinned manual-sync pairs and the largest in-file twins. Pure refactor — outputs byte-identical (vitest --changed 15548 passed, verify:examples 251 checks, public-api freeze 9/9).Comment-confessed sync pairs now single-sourced:
- lsp hover
formatEntryParamShapeLike→ coreformatEntryParamShapevia@nudojs/core/internal(the old comment claimed "core adds no export"; the internal face is the sanctioned route). - lsp
server-code-actionsnorm/resolveRelcopy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) →@nudojs/service/emitexportsnormPosixPath/resolveRelativeSpec; the lsp-only extensions stay at the call site. - standard-schema brand ctor list:
GLOBAL_BRAND_CTOR_NAMESlocal array + Set → schema-generatorRUNTIME_GLOBAL_CTOR_NAME_LIST(single array source; Set +isRuntimeGlobalCtorNamepredicate derive from it; the embedded validator serializes the same array, byte-identical).
In-file twins single-sourced:
- core
hof.ts:predUsesMappedVars/mapHasShapeOnlyVar→ parameterizedpredAnyVarwalker. - core
scan/literal-shapes.ts: 21 structurally identicalconstraintViolatedissue pushes →pushPrecondIssue(message/suggestion templates byte-identical). - core
builtins/promise.ts: then/catch rejected-arm microtask twins →definiteRecoveryPromise/unsettledRecoveryPromise; then-microtask dual reject arms →joinRejectedArm;Promise.alldual reject faces →allRejectFace. - core
check.ts: handwritten return-contract recording block (skip branch + main branch) →recordReturnContract. - core
leq.ts/postcondition.ts: duplicateprimOfsingle-sourced in leq. - core
builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) →taOwnKeysTuple; gOPD class/Error/.prototypeslot→descriptor arms →ownSlotDescriptor; 8 identical nullish-receiver guards →throwIfNullishRecv. - core
builtins/array.ts+template.ts: tuple join folding loops →tupleJoinParts(recv, onSymbol)(symbol element: throw vs abstract — the real semantic fork, parameterized). - core exec runtime:
$whileSeq/$forOfapplyExitJoinclosures → new pureloop-exit-join.tsapplyLoopExitJoin(the discoveredexhausted && widengate difference is an explicit parameter;$forOfpassesexhausted: true, provably equivalent). - core
directive-scan.ts↔ parserfn-directives.ts:CASE_TAG_REGEXscan loop → coreiterCaseTags(text, caseArgSpans)via@nudojs/core/internal(Bug 978 diagnostic actions and downstream regexes stay consumer-side). - service
dts-generator.ts:DtsClassMemberSurfacebase interface —scanClassSurfacereturn type no longer re-declares the member fields (BUG-168/151 docs live once). - lsp:
replay.tsasync env-preload twins sharepreloadEnvsThen, function scope walkers sharewalkFnScope;server-navigation.tsreferences/rename share the gate+parse prologue;hover.tsgeneralize blocks sharetryGeneralizeEnclosing.
Skipped as intentional parallel data or non-identical semantics: env node/web table clones (MessagePort ports, dual Storage, exec options), dts obj-slot widen pair (Bug 240 selective flags vs whole-slot spread), object methods string char-tuple pair (values vs entries elements).
- lsp hover
-
5769211: Dedup batch 5 (jscpd
--min-tokens 70audit of code-level clones; website EN↔zh mirrors and CHANGELOGs excluded as mechanism products): close the four remaining comment-pinned manual-sync obligations and the seven whole-function twins. Pure refactor — outputs byte-identical (vitest --changed 16815 passed, verify:examples 251 checks, lint + lint:tests clean).Comment-confessed sync pairs now single-sourced:
- transpile
stmt/statement.tsyield try-context bits (raw1|4|8/& 2/~(16|32|64)literals pinned by a "钉死同步" comment to runtimecontrol.tsYIELD_* constants) → new zero-dependency leafexec/yield-bits.ts; runtime (control.tsre-export removed,async.ts) and transpile (statement.ts) both import the named constants. - parser
case-arg.tsTYPE_EXPR_CHAIN_METHODShand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exportsCONSTRAINT_CHAIN_METHOD_NAMES(public barrel, next toCONSTRAINT_BUILDER_NAMES); parity pinned byconstraint-chain-methods.test.ts(method-face drift ⇒ CI red). - service
builtin-prototype.tsBUILTIN_ERROR_CLASSESverbatim 8-name copy of coreERROR_CTOR_NAMES→ imported via@nudojs/core/internal(the dead module-level re-export is removed; no public face change). - core
promise.tsaggregateErrorAbslocal error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated ineval-bug-293-promise-combinator-settle.test.ts(slot-key set / non-enumerable flags / inherited name vserrorBrandAbs).
Whole-function twins single-sourced:
- core
builtins/error/binary.tsmakeArrayBufferAbs/makeSharedArrayBufferAbs→ parameterizedmakeBufferAbs(brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved). - core
transpile/member-path.tsmemberWriteIfe/memberWriteRootIfe→ sharedmemberWriteIfeImpl(only real difference: return written value vs new root). - nudojs
version.tsthree walk-up-to-package.json loops →findPkgDirUpwards+readVersionAt. - nudojs
migrate.tsplanWorkflowRewrites→ delegates toplanWorkflowRewritesIn(findWorkflowDir(from));readPackageJsonDetailed/readMarkerFile→ sharedreadJsonObjectDetailed(path, label)(missing / invalid / unreadable / ok grading unchanged). - service
emit/quickfix-edits.tssidecarClearsEntryThrow/sidecarClearsConstraintViolation→ sharedsidecarClearsDiags(input, codes)(Bug 556 dual-code gate preserved). - core
generalize.tsctorParamCountOf/ctorFormalsOftwin class-ctor walkers → singlectorParamNodesOfwalker (Bug 1031 null-declaration skip lives once; count still raw param length, formals stillformalParamsFromNodes— thethis-param skip semantics unchanged). - lsp
server-commands.tshandleSelectCase/handleSelectContract~20-line resolve→read→caseTargets→knownFunctionNames preamble →resolveCaseTarget(error strings byte-identical).
- transpile
-
01a550b: Dedup batch 6 (same-file fragment twins from the jscpd
--min-tokens 70audit; batch 5 closed the cross-file sync obligations and whole-function twins). Pure refactor — outputs byte-identical (vitest --changed green, verify:examples 251 checks, lint + lint:tests clean, defineEnv deep structural dump parity vs HEAD for the env change).- transpile
expr/optional-chain.ts:invoke/invokeKeyhop arms share the emission tail (contOf IIFE wrap, fnOptional double fork with Bug 187 whole-chain short-circuit + BUG-216 single-Get preRead, recvOptional short-circuit, bare tail) — extractedemitInvokeTail; the two arms now only definecallOf($invokevs$invokeKey) and the method-value read ($getvs$idx). Emitted code text unchanged. algebra/term.ts:surviveMulOne/surviveSubZeroverbatim-twin closures → sharedtoNumberDomainTerm(Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).algebra/check.ts: assume / invariant segment processing sharesanchorSurfaceOf(#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) sharepushEntryMayThrowIssue— only theactualline differs.- transpile
stmt/statement.ts: for-loop fallback path and init-declaration path share the body-prep block (forBodyPrep: body local decls → body opts with alias filtering → body statements → loop-carried assignment names); paths inject constScope shadowing and the initName exclusion. Emitted code text unchanged. builtins/json.ts: tuple and arrayView branches of the stringify walker sharemapElements(index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).builtins/object/methods.ts:Object.keys/Object.entriesstring- literal receiver arms sharestringIndexTupleAbs(code-unit indexing, exact conf; element construction injected).algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk sharewalkChildren.arithmetic/muldiv.ts:div/modshare the numeric leading (divModLead: builtin-brand ToPrimitive re-entry, Symbol TypeError, bigint fold + abstract-bigint domain with 0n RangeError per Bug 106); 0-divisor semantics after the leading remain per-op.env/src/node.ts: the three verbatim MessagePort slot tables (MessageChannel.port1 / port2 / standalone MessagePort brand) single- sourced asmessagePortSlots(same cross-brand sharing pattern as the existingstreamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.lsp/src/symbols.ts:FunctionDeclaration/FunctionExpressionvisitor bodies merged into a single"FunctionDeclaration|FunctionExpression"visitor key (babel traverse alias syntax), bodies were verbatim twins.
- transpile
-
fd0fb09: Dedup batch 7 (jscpd
--min-tokens 70re-audit after batch 6: residual same-file fragment twins + one drifted manual-sync pair). Pure refactor — defineEnv deep structural dump (sorted + insertion-order preserving) byte-identical vs HEAD, verify:examples 251 checks green, lint + lint:tests clean.- env
node.ts: Storage slot table ×3 (ctor brand + localStorage + sessionStorage) → singlestorageObjconst (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → sharedexecSyncOptions; Request / Response body-mixin slots (clone/arrayBuffer/blob/formData/json/text, clone returns the respective brand) →bodyMixinSlots(self)factory; EventEmitter core on/once/off/emit →emitterCoreSlotsshared by the EventEmitter brand and theprocessglobal object. - env
node.tspath family — the drifted manual-sync pair: the top-levelpathModuleinlined the whole member table next to theplatformPathMethods(posix/win32)factory and had already drifted (join.requiredonly on the top-level copy).pathModulenow consumes the factory; member order canonicalized to the top-level key order;join's required-arity enforcement is now identical across path/posix/win32 (Bug 877 case 6's claimed parity now real). - env
web.ts: URL.searchParamsslot table and the global URLSearchParams constructor sharesearchParamsCoreSlots(toString / iterator face / size stay per-site; insertion order preserved). - core
builtins/error/binary.ts: DataView ctor andmakeTypedArrayFromBuffersharebufferByteLengthLiteral(brand→inner obj→byteLength slot fold);TypedArray.of's inlined copy of the number-domain item enforcement now callsenforceTaItem(the.ofcause variant is unified into the shared text — no pins). - core
builtins/object/methods.ts:getOwnPropertySymbolsobj arm and brand-inner arm share theownSymbolsTupletail (open/index → undefined, closed → counted tuple). - core
exec/transpile/helpers.ts: the MemberExpression root-identifier walk (assignment / update / stateful-call faces, ×3) →markFreeMemberRoot. - core
scan-call-graph.ts: dynamic-import and require ObjectPattern destructure binding loops →bindPatternImports; top-level class scans (findClassDecl+ module-frame class bindings) shareunwrapExportDecl. - harvester
harvest-dts.ts:resolveIfaceDeclsinner-first relative namespace resolution loop (qualified arm + short-name arm) →addRelativeNsHit;absExtends' twoes.k === "sum"member folds →foldSumFlags(thecs.k === "sum"fold is intentionally different and untouched). - service
analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) shareactualSlotTable(obj direct / brand inner-obj unwrap). - lsp
server-navigation.ts:onDefinitionnow uses the sharednavigationIdentAtpreamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept. - lsp
agent-tools.ts:suggestCase/traceshare theanalyzeToolFilepreamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
- env
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
- @nudojs/parser@1.5.7
- @nudojs/service@1.11.0
1.8.3
Patch Changes
-
9ff1709: Fix bug-report category 14 (LSP IDE surface) — BUG-140.
- BUG-140:
nudo:internal(analysis failed ⇒ the gate cannot decide the file) is now published on the LSP diagnostic face too, so the IDE no longer shows a file that the CLI rejects with exit 1 as completely clean. The diagnostic is emitted from the shared analysis path, so every consumer (CLI, LSP, vite-plugin) sees the same source, and the CLI's ownnudo:internaloutput is unchanged (no duplicate).
The service-side emit of the diagnostic landed with the vite-plugin category commit (
packages/service/src/analyzer-orchestrate.ts); this changeset covers the LSP-facing behaviour and its regression test.Regression test:
lsp-bug-140-internal-diagnostic.test.ts.追加:本轮 IDE / CLI 面修复
tmp/verify-bug.sh直接验证(exit 1 = 不再复现):BUG-185、BUG-186、BUG-187、BUG-188、 BUG-201、BUG-202、BUG-227、BUG-235、BUG-236、BUG-237、BUG-262、BUG-263、BUG-274。 带新回归测试:BUG-024、BUG-034、BUG-071、BUG-090、BUG-091、BUG-104、BUG-105、BUG-133、 BUG-134、BUG-136、BUG-146、BUG-014、BUG-019、BUG-044、BUG-074(16 个新测试文件 / 44 例)。口径变更(不是放宽断言):
- BUG-133:数值 case 只改
u自己的槽位并能清掉诊断;shape 形参那组 fixture 改为撤回该 action —— 唯一可用的文本改写会命中返回槽,且可证明无法清除诊断, 与其改错槽位,不如不给这个 action。 - BUG-019 残留(语义未变):首次
--freeze(新增模式)写出的见证名仍是插入前 坐标;--freeze=update是修复路径(现已按最终文件坐标重算、保留已正确项、幂等)。
未修复(同一子系统,已定位):
- BUG-247 inlay 侧:
packages/core/src/algebra/inlay.ts:304的generalizeFromAst跑在 invariant 公理播种之外,@nudo:invariant对 inlay 文本无效(公理与对照都打印: number)。播种入口invariantSpecsOf/assumePremisesPhiOf私有于core/algebra/check.ts:672,831,withInvariantSpecs在core/algebra/exec/runtime/state.ts:134且未从core/index.ts/core/internal.ts导出。hover 侧已修(=> 0 | number)。 - BUG-140 回归测试重基线:
const x = undefinedGlobalAtTopLevel在 BUG-073 之后归 类为module-throw(不再走internal回落),测试改为断言「错误级诊断必须发布」 的同一契约(细节见 cat-03 追加)。
既有测试更新(均为口径跟随,未删断言):
lsp-bug-463-484-signature-param-names(detail 改为 BUG-091 声明的格式、签名标签解析出真实返回类型)、lsp-bug-711-nested-call-signature(标签unknown→ 推断出的真实返回)、cli-bug-63b-path-errors-face(干净test --json基线新增 BUG-014 要求的"errors": 0/"ok": true)。追加:三条回归的收口(env 诊断去重、调用点插入位、两条负控重钉)
validation.ts:checkToLspDiagnostics里collectCheckSupplementIssues会把 service 的envUnresolvedIssues也发一遍,而 editor 面已有专属 env 通道(validateText与 pull 两处显式调envUnresolvedDiags)⇒ 同一事实两条通道各发一次(重复诊断 1 → 2 条); 且 check 通道那份对「按名字记录」的条目(e.path是名字本身、非绝对路径)不按本文件 env 名单过滤 ⇒ 同目录别的文件的无 path 诊断被误吸。修:check 通道跳过DIAG.envUnresolved,事实归属交给 live 通道(它按本文件 env 名单/路径双向收窄,且缓存 命中轮仍发布)。解锁env-unresolved-diag(4 条)与lsp-bug-470-937第 2 条。server-code-actions.ts:BUG-263 的形参身份把「形参位实参不是对象字面量」一律判为不可 插入,而该实参若是原始值字面量(string/number/bool/null/bigint/template),运行时不 可能是对象 ⇒ 形参身份自相矛盾、回落「唯一对象字面量实参」口径(多个仍不猜;表达式仍 不下发,保住「绝不猜位置」)。解锁lsp-bug-737(2 条)。- 两条 signatureHelp 负控钉的
(a: any, b: any) => unknown正是 BUG-104 判红的症状 (声明空壳 label 与同面 hover / CLI 互斥);空壳不采纳后给精确签名(a: any, b: any) => number | string(a + b两侧any⇒ JS+的 ToPrimitive 并集) ⇒ 按 BUG-104 声明的正确行为重钉 label,parameters长度/参数名断言原样保留。
追加:BUG-135 与 BUG-247 收口(relax 真写推断面;inlay 内部 id 不外泄)
- BUG-135:动作标题与 CLI 机器面都承诺「放宽到推断面」,但唯一实现只做
stripNumericPreds⇒ 落盘number()(基类型),既不是推断面、也消不掉诊断 (any ⊭ number()),且没有落盘后验证门。修:lsp/src/a6-relax.ts新增relaxSidecarReturnToSurface()(把fn(…, <返回槽>)的第二个顶层实参整体改写为给定推断面 文本,含括号 / 字符串 / 注释感知的实参切分);server-code-actions.ts取 check 同源推断面 (checkSource→NudoSig.abs,与 CLI 签名行 / hover 同源)渲染为侧车文本(精确投影 ⇒lit(0)/number().gt(40)/union(lit…);any⇒any();widened/partial prim ⇒ 基类型), 并加落盘后验证门(sidecarRelaxClearsTarget增codes参数,重跑 check;诊断残留或界面 装载失败 ⇒ 不下发,与 BUG-134「不给消不掉诊断的假修复」同例)。 - BUG-247(inlay 侧):
entrySeedsOfFn的播种本身是对的(inlay 已随@nudo:invariant变0 | number);残留真缺陷在渲染——invariant-apply.ts铸造的内部 idinv#N只在成员 顶层var处被拦,循环值参与算术时(inv#2 + 1是 app 项)漏网 ⇒ IDE 印: inv#2 + 1 | NaN,而 check / hover 印number | NaN(内部 id 上屏 + 两面互斥)。修:core/algebra/inlay.ts新增hasInternalInvId()走整棵 term 树,命中即退形状 (formatShape),与 check 面同一位置渲染同源。回归含真 LSP server 的 hover / inlay 逐字对拍。
追加:BUG-196(add 面)—— add 模式新建的直写段也要带
// derived-from:溯源行症状:
nudo.contract.emit的 add 模式下,本轮直写分支新建的段永远不带溯源行。 根因是两步顺序的合成:① 直写分支(dry-run)把新段追加进基底 D;② 派生分支以 D 为基底时findGeneratedSectionText在 D 里找到了这个刚建的段 ⇒ 命中 add 面「既有段不可动 ⇒no-change」跳过 ⇒ 标签行被丢弃。后果:add 面与 update 面对同一份输入收敛出不同字节, 且下游「靠derived-from反查根」失去锚点。修法(不改 add 面「既有内容不动」的契约,只区分「本轮新建」与「此前既有」):
packages/service/src/emit/interface-derivation-emit.ts:emitDerivedFromRoot新增可选directCreatedSections(= 本轮直写分支新建的段名)。add 面只在 「直写负责(directSections)+ 本轮新建(directCreatedSections)」时允许把标签行并进去; 此前既有的段仍走原no-change跳过。合并后与既有段逐字相同 ⇒ 仍按no-change(不空转 rewrite)。- 组装面:这类段已在基底里 ⇒ add 面必须就地替换(新增
replaceSectionsInPlace(), 段边界同collectGeneratedSectionsRaw:@generated头 → export 语句末,段外字节与段序逐字保留); 旧实现只做「追加」,会把同一导出名写成两段(非法 ESM ⇒ 整份侧车装载失败)。既有新段的追加路径不变。 packages/lsp/src/agent-tools.ts:serializedEmit在mode === "add"时传directCreatedSections: new Set(direct.written)(add 面written恰好 = 本轮新建段;update 面 无此语义,不传)。CLI 不受影响(contract-emit.ts的派生分支恒为mode: "update")。
回归:
lsp-bug-196-single-writer-sidecar.test.ts的 add 用例扩为断言 「直写正文 +// derived-from: lib.js:tag+ 同一段只有一份 + 收敛态逐字节(与 update 面相同)+ 根侧车只写一次」;新增 add 幂等用例(第二跑逐字不变、不写盘、不报Updated)。 - BUG-140:
-
37e9aa0: Fix bug-report category 17 (vite-plugin gate surface).
- BUG-110: the plugin's report face and gate face agree on
ignoreThrows, so the same project no longer yields contradictory verdicts between the two faces. - BUG-111: project-level env is resolved from the project root rather than the importing
file's directory, and env-module exports are merged with
mergeHarvestUnderEnvinstead of object spread — so adding an unrelated@nudo:envline no longer flips the gate from green to red, and harvest-only exports are no longer dropped. - BUG-221: project-level env resolves against the project base dir, so the plugin gate matches the evaluator.
- BUG-222: a project-level env load failure is no longer silent in the plugin; it reports
nudo:env-unresolvedlike the CLI and LSP instead of a false green.
Regression tests:
vite-bug-110-*,vite-bug-111-*,vite-bug-221-*,vite-bug-222-*.Note: BUG-140 (listed in this category file but whose defect is the LSP diagnostic face missing
nudo:internal) is NOT covered here; it belongs to category 14. - BUG-110: the plugin's report face and gate face agree on
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [206713f]
-
Updated dependencies [0650ef0]
-
Updated dependencies [fe03e18]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
-
Updated dependencies [9ff1709]
-
Updated dependencies [37e9aa0]
- @nudojs/core@1.17.2
- @nudojs/service@1.10.3
- @nudojs/parser@1.5.6
1.8.2
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
- @nudojs/service@1.10.2
- @nudojs/parser@1.5.5
1.8.1
Patch Changes
-
0438f10: Fix evaluator correctness and remove duplicated machinery:
- Respect user bindings named
undefined/NaN/Infinity(module bindings, parameters) instead of unconditionally folding them; keep exact literal folding for unshadowed reads, suppress undefined-literal narrowing facts when the name is bound, and honor the same bindings in callee position (NaN(1)) and at the expression entry (declarations inside the expression itself). - Separate private top-level functions from the module export surface:
export *precedence is restored, private named imports now reportnudo:missing-export,transpileSourceno longer emitsexportfor private functions, and analysis keeps a non-enumerable local-function table (so same-name re-exports/CJS exports do not shadow analyzed locals). - Make the generated runtime import list a single source of truth (it is now self-consistent with
@nudojs/core/exec), dedupeRUNTIME_IMPORT_RE, and share thenew Functioncompile scaffold. - Dedupe the A/B call budgets and the two
@nudo:purememo caches behind shared factories; either public clear API now invalidates both. - Single-pass, memoized function facet analysis; dedupe Error/mutator/class-chain/nullish tables; remove dead service evaluator modules.
- Split the evaluator's largest dispatch functions (
$invokeInner,$get/$set,invokeArrMethod,transpileStatement) and move narrowing ops out ofruntime/async.ts.
- Respect user bindings named
-
Updated dependencies [0438f10]
-
Updated dependencies [6ebf5a4]
- @nudojs/core@1.17.0
- @nudojs/service@1.10.1
- @nudojs/parser@1.5.4
1.8.0
Minor Changes
-
e6c4586: agent 工具面的载荷新增了
assertions段 /pathErrors[]段与新诊断码 (nudo:path-not-found/nudo:path-not-target);@nudojs/service新增了 一批公开导出(mergeCheckIssues/directiveDiagIssues/mockFromErrorIssues/envUnresolvedIssues/collectCheckSupplementIssues/buildTestReport/pathNotFoundError/targetPathError/formatPathErrorText等)⇒ 纯增量 (additive)⇒ minor。LSP agent 工具面(
nudo/check/nudo/test)与 CLI 的通道对齐:补回 check 的补充诊断通道、test 的断言汇总、imported 段、路径错误信封与 「分析目标」闸门。nudo/check此前只跑裸checkSource,CLI 侧并入 check 报告的三条补充 通道(指令文法nudo:directive-syntax、mock 装载失败nudo:module-missing、path env 未解析nudo:env-unresolved)一条都没接 ⇒ 同一文件 CLI / LSP 编辑器面 / agent 面给出三份 issue 集(agent 面把 「指令写错了」整条吞掉,mock 文件缺失判绿)。并入逻辑下沉到@nudojs/service(mergeCheckIssues/directiveDiagIssues/mockFromErrorIssues/collectCheckSupplementIssues),三面共用同一份。nudo/test此前没有assertions段 ⇒ 消费方分不出「见证通过」与「见证 失败」。现在并入与 CLInudo test --json同口径的assertions(passed / failed / unchecked,service 的buildTestReport)。nudo/test的文本面此前不渲染 imported(外部)函数 ⇒ CLI 有的(imported)段在 IDE 面整段消失,而头部计数仍把外部 case 算进去 (「3 case」只印 2 条)。现在按来源模块分组渲染,段头--- <mod> (imported) ---。nudo/test的functions过滤只重算本地 case 数 ⇒summary.cases与自身 payload 矛盾(summary 说 1、payload 躺着 2)。外部函数不在过滤 范围内,其 case 仍留在 payload 里 ⇒ 计数改为与 payload 同源。nudo/check/nudo/test此前没有「分析目标」闸门 ⇒ 对侧车契约文件报 「0 fn / 0 error」判绿(CLI 对同一文件 exit 1「Not an analysis target」),nudo/test还把契约 DSL 构造器(fn(...)/shape(...)) 当成真实调用点报成 case。入口现在复用与 CLI 同一份目标判定 (isNudoTargetPath+ 侧车 /.d.ts/ JSX 排除),非分析目标返回nudo:path-not-target。nudo/check/nudo/test此前对不存在的文件只返回裸ENOENT文本 (format:"json"也不返回 JSON)。现在走结构化路径错误通道 (pathErrors[]+nudo:path-not-found+ suggestion),与 CLIcheck --json/test --json同构。nudo/test的functions入参此前零校验:传字符串被逐字符建集合(函数 全被滤掉 ⇒ 全空报告的假空结论),传数字 / 对象时过滤被整体跳过(静默 失效)。畸形入参现在一律工具错误(isError: true)。
-
e6c4586: 三个 contract 工具新增入参
from?: string[](--from等价通道),@nudojs/service新增公开导出collectCallsiteRecords(+ 类型CallsiteRecords)⇒ 纯增量 (additive)⇒ minor。fix(lsp,service): 族 25 A2 —— 契约面四条缺陷(762 / 765 / 766 / 994)
- 762
nudo.contract.emit现在与 CLInudo contract --emit同序同口径: 先emitDerivedFromRoot(root 驱动下行推导),再emitInterface(本地侧车)。 此前工具从不调派生步 ⇒ CLI 写得出的下游侧车(add.nudo.js)在 IDE 面 永远不产生,且结果文本把「引擎没做的那一步」说成「name-clash」——误导性诊断。 下游侧车的写盘边界与本地侧车同口径(必须落在 workspace roots 内)。 - 765 源文件 open buffer 与磁盘文本不一致时拒绝写盘(可诊断错误: save or discard before emit)——此前只挡了侧车自己的脏 buffer,源文件的脏 buffer 会把未保存的代码形状写进侧车,磁盘源码却一个字节没变。
- 766 emit 写盘边界改按路径分量判定逃逸(
..或..+ 分隔符), 不再误杀..dotted.js/...triple.js/..cfg/x.js这类合法路径名; root 外的文件与指向 root 外的符号链接仍然拒绝。 - 994 三个 contract 工具(
nudo/contract/nudo/contract.draft/nudo/contract.emit)新增from?: string[](--from等价通道):跨文件 调用点证据参与契约求解,接口面/草稿/落盘与 CLInudo contract --from同口径。 证据采集下沉到 service:新增导出collectCallsiteRecords(+ 类型CallsiteRecords)。
- 762
-
e6c4586: BREAKING: 既有
nudo/…请求的响应信封变了。nudo/trace/nudo/suggestCase的失败路径此前不带isError: true(失败被当成成功,客户端只能从正文分辨)⇒ 现在失败路径返回isError: true(MCP 风格)⇒ 按「有没有isError」分支的客户端行为变了;nudo/hover现在校验位置参数:非整数line/column此前被原样回显 且所有分析字段为null(与「此处无 hover」不可区分),现在答工具错误;column缺省为0⇒{ file, line, column, … }的载荷形状恒成立。
谁会坏:把失败响应当成功处理的客户端(
nudo/trace/nudo/suggestCase的失败 现在带isError: true);以及用非整数column调nudo/hover探测「此处有没有 东西」的客户端(现在拿到的是工具错误而不是一个全null的载荷)。怎么迁移:客户端按
isError分支处理失败;nudo/hover只传整数line/column(column缺省即 0)。Fix agent-tool (LSP) defects found by the族 25 audit:
- 767 —
nudo/trace/nudo/suggestCasefailure paths now returnisError: true(MCP-style), so a failed call is distinguishable from a successful one at the protocol level instead of only in the text. - 768 —
nudo/hovervalidates its position arguments: a non-integerline/columnis a tool error (previously the value was echoed back with every analysis fieldnull, so "no hover here" and "my argument was the wrong type" were indistinguishable), andcolumnnow defaults to0so the documented{ file, line, column, … }payload shape always holds. - 961 —
nudo/whatIfvalidates its arguments: a missingtargetis a tool error (previously a fake success reportingType of "undefined": unknown), a non-arraybindingsis a diagnosable tool error (previously a rawbindings.map is not a function), and a binding withoutnameis rejected instead of silently doing nothing.injectBindingsin@nudojs/servicegained the matching shape guard and names the offending entry (<missing name>). - 993 — the observing agent tools (
nudo/whatIf,nudo/suggestCase,nudo/trace) now analyse through the asynchronous entry point, which preloads path-based@nudo:envmodules. Their output no longer depends on whether the file happens to be open in the editor (previously the same file and tool could answernever/unknownor99depending on call order, together with a misleading "Built-in API is not covered" diagnostic). The analysis caches additionally key on the env preload state so a synchronous analysis taken before the preload can no longer feed a stale "no env" result to later calls. - 955 (shared entry) —
normalizeFilePathnow rejects a non-string / empty / missingfilewith a diagnosablefile is required …tool error instead of leaking a rawfile.startsWith is not a functionTypeError (or silently falling back to the server's working directory). Every agent tool goes through this shared entry point.
-
e6c4586: BREAKING: LSP 协议契约变了(
packages/lsp/PUBLIC_API.md这份冻结清单 本版本同步更新)。nudo.selectCase/nudo.selectContract的失败面此前是{"success": true}(对不存在的函数、对空调用都答成功)⇒ 现在答{ success: false, error, isError: true };workspace/executeCommand上的未知命令名此前答result: null(与 「命令跑了但没产出」不可区分)⇒ 现在答协议级MethodNotFound错误。
谁会坏:按
success分支处理nudo.selectCase/nudo.selectContract的客户端 (失败路径的success现在是false);以及靠result === null判「命令不存在」 的客户端(现在收到的是 JSON-RPC 错误)。怎么迁移:客户端按
{ success: false, error, isError: true }处理失败;用 JSON-RPC 错误码判「命令不存在」(MethodNotFound)。The LSP editor commands now tell the truth: a selection that did not happen is reported as a failure, and the mirrors a selection touches are refreshed together.
nudo.selectCasevalidates its arguments before touching the active-case table. AcaseIndexoutside the function's@nudo:caselist used to be accepted:-1crashed the analysis (Cannot read properties of undefined (reading 'argsAbs')in the diagnostics) and99silently replaced the observation slot. AfunctionNamethat is not a function of the target file used to be stored as-is, sonudo.getActiveCasesreported ghost entries such as{"":0}. Both now return a structured error and leave the table untouched.nudo.selectContractvalidates that the target function exists in the file. It used to answer{"success":true}for a function that was never there (and for a call without any arguments at all), so the client could not tell a real switch from a no-op.- A selection refreshes the inlay hints and the pull diagnostics as well as the code lenses. Only the code lenses were refreshed, so a client without code lens support kept showing the previous case, and a pull-diagnostics client never saw the diagnostics of the newly selected case.
file/uriarguments must be non-empty strings. A non-stringfileused to escape as a bareTypeError(file.startsWith is not a function), which reached the client as a JSON-RPC protocol error instead of a tool error carryingisError: true; a missingfilesilently fell back to the server's working directory.- An unknown command name on
workspace/executeCommandnow fails with the protocol-levelMethodNotFounderror instead of answering with anullresult, which was indistinguishable from "the command ran and produced nothing".
-
e6c4586: BREAKING: LSP 协议契约变了(
packages/lsp/PUBLIC_API.md这份冻结清单 本版本同步更新)——- 失败面统一成
{ success: false, error, isError: true }:nudo/selectCase/nudo/selectContract/nudo/getActiveCases此前对 非法入参答{"success": true}(或幽灵条目),现在答结构化错误信封 ⇒ 客户端按success分支的代码路径变了; AGENT_TOOL_SOURCES的值同步为新的共享数据源(analyzeFile→analyzeFileAsync;check→checkSource + mergeCheckIssues + serializeCheckJson;test→analyzeFileAsync + buildTestReport + serializeCaseJson)⇒ 依赖这张表反推「命令 ↔ 数据源」的客户端读到不同的值。
谁会坏:把
nudo/selectCase/nudo/selectContract的失败当成功处理的 客户端(此前恒success:true,现在会拿到success:false+isError:true); 以及读AGENT_TOOL_SOURCES做能力判断的客户端。怎么迁移:客户端按
{ success: false, error, isError: true }分支处理失败 (packages/lsp/PUBLIC_API.md与两份 API 文档已同步);不要再按AGENT_TOOL_SOURCES的字面判能力,改按命令名判断。@nudojs/service侧新增公开导出pathEnvPreloadFingerprint⇒ 纯增量 (additive)⇒ minor。族 25 收口接线(6 项):把跨片耦合的缺口补上,并让文档与工具面说同一件事。
testTool改异步入口(Bug 993):A4 把whatIf/suggestCase/trace改成了analyzeFileAsync(path 型 env 只能异步预载),但testTool属另一片 的函数级边界 ⇒ 冷进程nudo/test首调仍是 env-less("unknown"+ 1 条误导 诊断)。⇒ 改async+analyzeFileAsync(签名变更:AgentToolResult→Promise<AgentToolResult>),同步调用点与既有测试。AGENT_TOOL_SOURCES值同步:工具面真换了数据源,表与文档要跟着走 ——check→checkSource + mergeCheckIssues + serializeCheckJson、test→analyzeFileAsync + buildTestReport + serializeCaseJson;同步packages/lsp/PUBLIC_API.md§5、packages/website/docs/api/agent.md与AGENT_TOOL_SOURCES的值钉。nudo/contract.emit转发from(Bug 994):三个 contract 工具已支持--from等价通道,但协议入口makeHandleContractEmit只构造{file, functionName, mode, dryRun?}⇒from到不了 emit 工具 ⇒ 补 入参类型 + 透传。- CJS 导出的 hover 面(Bug 998):
findFunctionNameAtPosition没有MemberExpressionproperty 分支 ⇒module.exports.alpha = function () {}的 hover 回退成无名(x) => ?(诊断面认得它、hover 面不认 ⇒ IDE 内部 自相矛盾)⇒ 补分支(祖父节点走path.parentPath.parent—— Babel 的node.parent不存在)。 - 失败面文档同步:
selectCase/selectContract/getActiveCases的失败 面统一为{ success: false, error, isError: true }⇒ 两份 API 文档的返回面 记载同步;nudo/contract.emit的from?: string[]参数也补进文档。 pathEnvPreloadFingerprint的瞬时 ReferenceError:族内 build 前dist落后于src造成的一次性混用 ⇒ 随本族 build 消失(已连跑 5 次 复现不出)。
- 失败面统一成
Patch Changes
-
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
2d96c29:
@nudojs/service新增公开导出absolutizeEnvSpec(env 规格的绝对化入口) ⇒ 纯增量(additive)⇒ minor。fix: 并发 review 收口的 10 条缺陷(闸门假红/假绿 · IDE/CLI 口径分裂 · 机器面谎报)
上一片(并发 review 收口 25 条 + 族 65/1094 两轮)之后又做了一轮并发 review(5 个分片 × 只读审查 + 逐条代码层复核)⇒ 查出 10 条该轮改动 引入或遗留的缺陷,本片一次性收口。核心仍是闸门可信度:
nudo check是 CI 闸门,假红卡死用户仓库、假绿让门禁空转。本片新增 7 个回归测试文件(全部含「修前红 / 修后绿」实测),另补 1 个 残留洞(指令作用域闸门)。
高危(4 条 · 闸门级)
-
构造器 may-throw 证据被整体丢弃且「归因落点」根本不存在 ⇒ L2 闸门假绿 (
core/algebra/check-may-throw.ts·core/algebra/scan-top-functions.ts·core/algebra/check.ts):实例方法桥把构造器跑在独立 may-throw 会话里 (软效果不进方法域 ⇒ 假红已消除),但硬抛(无条件throw)也被catch {}吞掉;而注释声称"归因给new C()入口"——该入口并不存在 (scan-top-functions.ts只登记Class.method,跳过 ctor)⇒export class A { constructor(x){ throw new TypeError("boom"); } }在 check 闸门与 test 见证面双面零诊断(0 error / 0 warning / exit 0)。 修法:新增类导出入口普查面listClassEntryNames(new C()是真实入口) ⇒ 类入口并入 L2 入口表(check.ts),构造器的硬抛进 throws 域、报在 类声明位置;构造器的软效果(any 补位的强制转换)仍不进 ⇒ 普通类 不触发 error 级nudo:entry-may-throw(假红不回归)。另:类入口的@nudo:throws申报落点 = 构造器 scope(C.constructor)⇒ 用户已申报不再被卡 (declaredThrowsForEntry)。 -
同一「裸实例兜底」在值域通道产出自信的错值 ⇒ 方法签名折
never+ 假红 (core/algebra/generalize.ts):兜底实例的内层是空 obj ⇒ 构造器写过的 字段被建模成「确定不存在」⇒this.v读成确定的undefined、this.v + 1读成确定的NaN;this.v.toFixed(2)在虚构实例上抛 ⇒ 签名never(谎称"该方法必抛、恒返回 never")⇒ 连带 error 级nudo:entry-may-throw。修法:兜底实例内层改 unknown(构造器写过的 字段 = 不可知,不是"缺槽")⇒ 不折确定错值、不在虚构实例上抛 ⇒ 签名落unknown,且方法体照常求值(不退化成整体 opaque)。与上一条同源,两处 就地复刻的孪生实现已互相点名,防止再漂移。 -
Proxy
getOwnPropertyDescriptor不变量新增规则的 3 处阈值错误 ⇒ 假红 (core/algebra/builtins/object/descriptor.ts):上一片新增的enforceProxyGetOwnPropDescInvariant在 Object 面与 Reflect 面同时接线, 三处口径与 node v26.10.0 不符 ⇒ native 不抛、引擎抛 TypeError ⇒ error 级nudo:entry-may-throw⇒ 直接卡 CI:- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
IsCompatiblePropertyDescriptor只在current.[[Configurable]]为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判; frozen被当成enumerable:false⇒Object.freeze只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);- 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒
defineProperty把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落configurable:true⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen不再改 enumerable;靶侧三标志 统一复用同文件currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
- 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024
-
项目级 env 的「两层基准」只做了一半 ⇒ 分析器通道丢 env 全局 / IDE 与 CLI 结论相反(
service/src/analyzer-orchestrate*.ts·service/evaluator/env-loader.ts·lsp/src/validation.ts·lsp/src/agent-tools.ts):上一片把项目级 env 改为按项目根解析,但只改了预载侧;收集期仍用原始相对名查表, 而相对说明符只有唯一候选(按文件目录解析)⇒ 与预载登记的 key 不匹配 ⇒ 只要被分析文件声明了任何@nudo:env(哪怕是内建名node),项目级 path env 就对它完全不可见 ⇒ 返回面退never+ 假阳nudo:builtin-unknown; 同时 LSP 的env-unresolved诊断按「记录时的 preload 目录」归档 ⇒ 项目级 env 的失败被静默吞掉(IDE 假绿,CLI 同刻仍报)。 修法:绝对化规则收进env-loader.ts的单一 helper(absolutizeEnvSpec), 预载侧 / 收集期 / 缓存键 / LSP 注入 / LSP 诊断五处共用;LSP 诊断按fileEnvBaseDir + projectEnvBaseDir双取合并去重。改后 IDE 与 CLI 对同一 文件结论一致。
中危(4 条)
-
migrate strip --write把「未写盘」的成功行报成wrote(nudojs/src/migrate.ts·nudojs/src/commands/migrate.ts):库面在有失败时整批零写盘(原子性)并给 成功行附注记,命令层却把注记行当普通成功行推入results,人类面用opts.write ? "wrote" : "dry"无条件打wrote⇒ 同一行既说 "wrote" 又说 "not written",而磁盘上根本没有.js;--json侧只有一条自由文本notes能区分 ⇒ 机器消费方极易误判已产出。修法:新增机器可判定的writeStatus("written"/"not-written"/"planned"),人类面按逐行 状态措辞(wrote/not written/dry)。 -
HOF 元组元素域把已知的 null/undefined 压成
any(core/algebra/hof.ts): 引擎把null/undefined建模成unknown形状 + lit 项,而元素域按 shape kind 判"域是否可知" ⇒ 把已知类型误判成"域不可知" ⇒[null]的元素域从null退成any、[1,null]退成any(应为number | null);any是"自信的任意值",参与算术即强制转换 ⇒ 记 may-throw ⇒ L2 假红面。修法:三分类——已知 nullish(不参与异型判定、只贡献 可空性,用仓内既有makeSum表达联合)、真·推断失败(退unknown, 不是any)、其它(同型判定不变,异型仍退any)。 -
文件级指令的作用域闸门未覆盖
ArrayExpression/ObjectPattern/ArrayPattern(parser/src/directives/file-directives.ts·core/algebra/directive-scan.ts): 写在数组字面量 / 解构模式里的@nudo:env被静默提升成整文件生效(零诊断, 越权)。修法:两侧孪生闸门同步扩到三类嵌套体(两通道 23 组样例逐例一致)。 -
引理账本写入是「死写」(
core/algebra/check-return.ts):Φ 侧的消费在 证明段里记进账本,而调用方传入的consumedAssume快照取自调用之前 ⇒ Φ 侧的写入永远读不到 ⇒ 账本与归因两套口径(changeset 宣称的"经noteAssumeConsumed记进账本 ⇒ 归因可见"实际断在取数时序上)。 修法:归因集就地取账本(读在写之后)⇒ 账本是"消费过"的唯一事实源, 调用方快照退化为兜底。
验证
- 全仓
tsc --noEmit(pnpm run lint)0 错误;pnpm run buildexit 0; pnpm run test全量绿(1757+ 文件 / 14500+ 用例,exit 0);- 新增 8 个回归测试文件,全部修前红 / 修后绿实测(红数由回滚修复逐条复核):
core-bug-1095(Proxy 阈值,22 例 · 修前 12 红)、core-bug-1096(构造器 归因,11 例 · 修前 6 红)、core-bug-1097(HOF 元素域,15 例 · 修前 10 红)、core-bug-1102+parser-bug-1101(指令闸门,79 例 · 修前 12 红)、core-bug-1103(引理账本,5 例 · 修前 1 红)、service-bug-1098+lsp-bug-1099+lsp-bug-1104(env 两层基准,11 例 · 修前 6 红)、nudojs-bug-1100(migrate strip 写盘状态,6 例 · 修前 5 红)—— 合计 149 例; - 产品 CLI 面逐条复现核对:
nudo check对"构造器必抛"报 error 级nudo:entry-may-throw(归在类入口)、对"构造器软 throw"零 error; Proxy 三场景(可配置靶异形态 / 冻结靶 / brand 靶)零 error;migrate strip --write失败批输出not written且磁盘零写盘、--json带writeStatus: "not-written";项目级 env + 文件级 env 并存时nudo check得f() => 42(修前为never+ 假阳)。
已知边界 / 未闭合
- Proxy
gOPD仍有 3 处漏抛(靶不可扩展且键不存在时报configurable:true; 靶不可写+不可配置而陷阱省略value;靶为不可配置访问器且 get/set 身份不同)—— 基线同样不抛(非本次回归),新增抛点有制造新假红的风险 ⇒ 已把 node v26.10.0 实测矩阵写进core-bug-1095测试文件注释,留待单独立项。 - 不可配置访问器靶现在也会比对
enumerable(原生确实抛)——属收紧, 若有用例依赖旧的"访问器靶跳过该比对"需按原生重判。 - HOF 异型元素仍退
any([1,"a"])——既有保守口径,本片未窄化成联合。 - 真·未知 ⇒
unknown会让该 α 恰为返回类型时多一条 warning 级nudo:unknown-inference(级别 warning,不影响 L2 闸门)。 - 进程级
lastEnvBaseDir单槽(同步analyzeFile路径下的文件级相对名) 与 Windows 下isPathEnvName只认/均为既有基线,本片未动。 - MCP
nudo check工具面(同步、无 path env 预载)与migrate strip --json顶层形态不统一(成功=裸数组 / 失败=对象信封)仍待单独立项。
-
-
2af2bae: Return-contract diagnostics now carry the position of the function they belong to, name the constraint source they really came from, and only claim that a proof relied on a user lemma when the proof actually consumed it.
- Position.
checkSourcebuilt its return-contract issues without aline/column, so every consumer fell back to the top of the file: the LSP drew the diagnostic at line 1 column 0,nudo check --ghaannotatedline=1,col=1, GitLab Code Quality reportedlines.begin: 1, and--jsonemitted no position at all — even when the offending function was declared on line 10. The issues are now built with the declaration position of the function, so the LSP, the CI annotations and the JSON machine contract all point at the real line. - Constraint source. The message of a violated return contract always
said
@nudo:contract return <name>, even when the constraint came from the return slot of a sidecarfn({...}, <ret>)binding — a directive that does not exist in the source file. The message now names the real source:@nudo:contract return <name>for a source directive,sidecar fn() return slot (...)for a sidecar return slot. - Lemma attribution. The
nudo:assume-reliedaudit note claimed that a proof relied on a user lemma whenever the function declared one and the return contract happened to be provable — even when the lemma took no part in the proof (return 0is provable regardless of@nudo:assume d <= max). The engine now records which lemmas a proof actually consumed and attributes the note to those, so an unused lemma no longer produces a false "proved via @nudo:assume" claim. The proof result itself is unchanged: the note is an audit annotation, not a gate.
- Position.
-
c325a10: fix(lsp):
refactor.extract的多 edit 合成统一坐标口径(Bug 450)- 根因:
packages/lsp/src/extract-function.ts的applyEdits排序用原source的坐标、应用时却用posToOffset(out, …)在已被前面的 edit 改写过的out上求坐标 ⇒ 两个区间相互包含(插入点落在替换范围内部)时, 后应用的 edit 落点按陈旧坐标漂移 ⇒ 源文件被搅成垃圾 ("AAAA BBBB CCCC"+ 替换 [5,9) + 插入 @6 ⇒ 改前"AAAA REPLBBB CCCC")。 - 修法:统一坐标口径 —— 全部 edit 的偏移都在原 source 上算好,再
从后往前(起点倒序)应用;区间嵌套(插入点落在替换范围内部,LSP 规范下
属非法重叠 edit)按「插入文本并入该替换范围、紧贴替换文本之前」
确定性合成 ⇒ 改后
"AAAA INSREPL CCCC"(插入内容不丢、源码不被搅乱)。 - 替换范围之间真的重叠(部分重叠 / 交叉)无法确定性合成 ⇒ fail-closed:
抛
RangeError(server-code-actions.ts的refactor.extract是 best-effort ⇒ 抛错即「不出 action」,绝不产出非法 WorkspaceEdit)。 - 影响面:
applyEdits的两个调用点(表达式提取路径 / 语句序列路径) 同时受益;不相交 edit 的既有行为逐字不变。 - 未变:公共 API 冻结面零变更(
packages/lsp/src/public-api.ts四张表不动、 零新增导出)。
- 根因:
-
e6c4586: LSP 符号 / 观察面与导出面对齐:默认导出、导出类实例方法、CJS 成员导出不再 整段消失,跨模块调用点补上
call@观察透镜(Bug 753 / 769 / 998 / 1034)。export default function此前只存在于 hover / 大纲面,CodeLens 与 inlayHint 的 interface 档(● contract / imp/⚡ persist interface/⚡ draft interface)整段缺失。默认导出现在与具名导出同形。- 导出类的实例方法(
Counter.inc)此前只在 hover 面可见:CodeLens 没有 interface 档,inlayHint 也没有返回 inlay。类方法现在以Class.method为契约键进入两面,与顶层导出函数同形。 - CJS 成员导出(
exports.f = fn/module.exports.f = fn)此前在 documentSymbol / workspace symbol / inlayHint / semanticTokens 四个面 全部不可见,CodeLens 也没有 interface 档——而诊断面却点名该导出。 四面现在与 ESM 具名导出同形(导出键带 function 档 + interface 档 modifier)。 - 跨模块调用点(
import { add } from "./lib.js"后调用add(x, 2))此前 不在调用方文件的 CodeLens 上投影——CLInudo test已经打印该事实。 调用方文件现在出现与 CLI 同形的call@L4lens;被导入函数的 entry@ 仍属被导入模块,不在调用方落镜。
core 侧只改了内部未导出函数
listFunctions的函数体(导出类实例方法与 CJS 成员导出的枚举),未新增任何导出名。 -
f87c9f9: fix(lsp): 成员补全引擎的接收者解析与内建原型投影(Bug 771 / 772 / 782 / 787 / 788)
- 771 union 接收者的补全不再跳过「零成员」的那一支:sum 交集计算区分
「该臂成员集为空」(原始值臂 ⇒ 交集必空)与「该臂补全信息不可得」
(unknown / any / never ⇒ 可跳过)⇒
{x,y} | 5的u.不再给出x/y(取属性在原始值臂上是 TypeError)。 - 772 成员补全的接收者按整条成员访问链解析(
a.b.c⇒ 接收者是a.b), 不再取最后一段标识符 ⇒a.b.不再给出同名顶层绑定的成员。 - 782 接收者识别与源码消毒的标识符捕获组改为 Unicode 感知
(JS IdentifierStart/Continue +
$)⇒ 非 ASCII 接收者(对象.)给出该对象的 成员,不再回落成顶层变量表。 - 787 字面量 / 括号 / 字符串接收者(
(42)./(true)./"abc".)走内建 原型表(Number / Boolean / String);认不出接收者时给空,绝不回落成顶层 变量表(那份表与「成员」意图无关)。 - 788 prim 分支按类型分派到对应的内建原型表 (number → Number / boolean → Boolean / bigint → BigInt / symbol → Symbol), 品牌名命中内建类时同样投影该类成员 ⇒ number / boolean 接收者不再是零候选。
新增
getCompletionsAtPosition的上下文入参(CompletionContext)与completionBranchAt补全面分支判定入口,供调用方(IDE 入口)按光标词法上下文 与作用域决定成员面 / 变量面。 - 771 union 接收者的补全不再跳过「零成员」的那一支:sum 交集计算区分
「该臂成员集为空」(原始值臂 ⇒ 交集必空)与「该臂补全信息不可得」
(unknown / any / never ⇒ 可跳过)⇒
-
f87c9f9: fix(lsp): 补全面的绑定下沉 + 词法上下文闸(Bug 789 / 952)
- 789:成员补全解析接收者 Abs 时不再只查模块级
bindings表(该表由 service 的collectBindings只遍历顶层语句填充 ⇒ 函数体内的局部量 / 形参不在表里)⇒ 函数内接收者一律零候选(连string局部量也是 0 项)。 新增replay.ts的lookupScopedBinding(作用域感知的绑定查询): 局部量走引擎节点级 Abs 重放(recordPositions插桩在声明位记录初始化 求值态 Abs——与模块级绑定面同口径),形参走契约种子(generalizeFromAst的entryShapes,与 hover 的「A 参数面」同源);server-ide.ts的补全入口把 它挂到CompletionContext.lookupBinding上(作用域面优先,作用域里没有才 回落模块级绑定面)⇒ 同一份代码只改「接收者声明的位置」,成员候选集完全 一致。 - 952:补全入口单次计算光标的词法上下文(code / comment / string),
指令面 / 成员面 / 变量面共用同一份 ⇒ 光标落在字符串 / 模板字面量内部或
注释里时不再弹出候选(接受任一项即把标识符写进字面量内部 ⇒ 静默改写运行时
值);代码位与注释里的
@nudo:指令面行为不变。
- 789:成员补全解析接收者 Abs 时不再只查模块级
-
f87c9f9: Hover now agrees with
nudo checkon what a parameter's type is, and an early-return guard no longer narrows away anullthat is still reachable.- Bug 773 — The flow facts treated
if (!p) { return 0; } else { … }as an early-return guard and stripped thenullable(…)wrapper frompfor the rest of the function. Theelsebranch falls through to the code below theif, sopcan still be nullish there; the hover showed a type that does not hold. The guard now only narrows when there is noelsebranch, or when theelsebranch also ends inreturn/throw. - Bug 774 — A parameter of a function without a contract produced an
empty hover, even though the signature block of the very same hover
showed
x: any. The parameter projection now falls back to the "unconstrained ⇒any" rule (design §2); identifiers that are not parameters still report no information. - Bug 775 — For contract parameters the hover showed the sidecar
expression text (
x: number().gt(0)) whilenudo checkshowed the inferred type (x: number), so one function had two different parameter types depending on the surface. Non-union contract parameters now use the same inferred shape as the check signature line. Union parameters keep their declared form: a discriminated union expands to tens of thousands of characters and its arms are identified only by the user's own type names. - Bug 786 (hover half) — The hover surface never forwarded the
injectbundle, so inline directives (@nudo:mock/@nudo:as/@nudo:replace, environment globals) were missing and the derivation collapsed tounknown("inference failed") while the CLI gate showed the real type.HoverInterfaceOptsnow carriesinjectand passes it to everygeneralizeFromAstcall of the hover surface.
- Bug 773 — The flow facts treated
-
f87c9f9: fix(lsp): server 骨架 8 条——重复诊断推送 / 配置深合并 / trace 位置参数桥 / 工作区根 / 畸形 URI / inlay 开关同口径 / pull 诊断 env 通道(Bug 776 / 777 / 780 / 783 / 784 / 790 / 781 / 992)
- Bug 776(重复推送):
vscode-languageserver的TextDocuments.listen()在didOpen时同时 fireonDidOpen与onDidChangeContent⇒ 打开即 验证路径与编辑防抖路径对同一内容各跑一遍完整校验、各 publish 一次 (同 version 同内容发两次)。server.ts记文档指纹(version + 内容), 防抖路径遇到同一指纹即认定 didOpen 回声并跳过;publish 面再加内容去重 (同 uri + 同 version + 同诊断内容只发一次,同版本但内容变了仍照发)。 - Bug 777(配置深合并):
workspace/didChangeConfiguration的载荷只带 变更部分(或与 nudo 无关的整棵树),server 却把它当整棵子树读 ⇒ 未提及的键被抹成undefined⇒ 一次无关的设置变更就把宿主的nudo.analysis.mode默认值清掉(分析范围静默收缩、hover 变 null)。 宿主设置改为累积合并树:出现的键覆盖、未出现的键保留、null= 显式 重置;扁平键("nudo.analysis.mode")按点号展开成嵌套路径,与嵌套形态 等价。 - Bug 780(命令桥 · server 侧):
nudo.trace没有位置参数桥 (nudo.contract*有)⇒ IDE 观察透镜的[uri, fn]落到兜底分支、把 uri 字符串当参数对象传下去 ⇒ 工具 100% 失败。补上与nudo.contract*同款的 位置参数桥(复用 agent 侧tracePositionalArgs),并把兜底分支改成 「参数不是对象 ⇒ 协议层InvalidParams」,不再把字符串当对象传下去。 - Bug 783(工作区根):
workspaceRoots的写入点全在onInitialize里 ⇒ 之后永不更新;server 也从不订阅workspace/didChangeWorkspaceFolders,且 capabilities 未声明workspace.workspaceFolders.changeNotifications⇒ 客户端根本不会发这条 通知。现在声明该能力 + 订阅通知(增删根、realpath 归一)+ 根集合变化后 清nudoFileCache、重检已打开文档、广播workspace/diagnostic/refresh(新纳入的目录不再被写盘边界误拒,已移出的目录不再保留过期授权)。 - Bug 784(畸形 URI):
onInitialize对每个 workspace folder 的uriToFilePath没有兜底 ⇒ 一个百分号转义非法的 URI 抛URIError⇒ initialize 整个失败 ⇒ 客户端拿不到 capabilities ⇒ 整个语言服务器会话 起不来。改为逐个 folder 兜底:跳过畸形项 + 记可读告警,其余照常。 - Bug 790(inlay 开关同口径):项目侧
nudo.inlayHints.parameters原样返回原始值,宿主侧走parseInlayParams⇒ 同一个键两套规则 (项目写字符串"false"反而开启参数 inlay,宿主同一个值关闭)。 项目侧改用同一个归一化函数:非 boolean 一律回落默认(关)+ 一条 可读告警。 - Bug 781 / 992(诊断面同形):push 面(
validateText)会发nudo:env-unresolved,pull 面(textDocument/diagnostic)完全没有 env 通道 ⇒ 同一文件两个诊断面互相打脸(IDE 与 CI 结论不一致)。pull 通道 补上 env 通道——与 push 同源同档(envUnresolvedDiags+filterCheckLspByLevel+ 同一 level + 同一去重键空间)。
冻结面:
packages/lsp/src/public-api.ts四张表本族零变更。workspace能力键已由 server 声明,但未写进NUDO_INITIALIZE_CAPABILITIES(属于「stable 键集变更」,待 owner 拍板后统一补表 + 补PUBLIC_API.md)。 - Bug 776(重复推送):
-
f87c9f9: fix(lsp): 诊断 range 夹到行尾 + check 通道保留 info 级(Bug 778 / 779 LSP 半)
- Bug 778:service 的
column: 999「整行」哨兵被原样写进 LSPend.character⇒ 协议层 range 越界(push / pull 两条通道都越界)。诊断 range 的唯一计算点lspDiagnosticRange(validation.ts):行号 1 基 → 0 基、列号夹到该行长度以内、同 line 时 end ≥ start;行长表由本轮源码 逐行算出(会话条目缓存 ⇒ pull 通道无源码参数时同样夹取)。 - Bug 779(LSP 半):
checkToLspDiagnostics在转换前就把 info 级砍掉 ⇒ 下游档位过滤器永远看不到 info ⇒nudo.analysis.diagnostics: "verbose"对 check 诊断是空操作(nudo:assume-relied/nudo:invariant-relied/nudo:opaque-result永不上屏,与 CLInudo check两侧集合不一致)。转换点 改为保留三档,档位取舍只由filterCheckLspByLevel决定(verbose 放行 info;default / errors / off 不放行,off的门禁码可见性不变)。 - env 通道同档同 range:
nudo:env-unresolved改走与 check 主通道同一个 转换点(checkIssueToLspDiagnostic)⇒ severity 与 range 与主通道同口径。 - 对外交付两个前置件:
envUnresolvedDiags改为 export(供 pull 诊断面 消费);handleNudoDepFileChanged排除变更文件自身(防自激重检)。
- Bug 778:service 的
-
f87c9f9: fix(lsp/core): IDE 面与 CLI 同源装配注入 + info 级 check 诊断不再被提前砍掉(Bug 785 / 786 / 780 / 779 vite 半)
- Bug 785(注入装配):LSP 侧从不采集行内指令(
@nudo:as/@nudo:replace)⇒ CLI 与 IDE 对同一份文件给出相反的门禁结论与签名 (IDE 假红:用户声明过raw是 number,IDE 仍按 string 判raw.toFixed不存在并报nudo:entry-may-throw)。新增 LSP 侧注入装配器buildLspInjection(packages/lsp/src/agent-tools.ts)—— 与 CLIbuildCheckInjection同口径(@nudo:as/@nudo:replace/@nudo:mock/ env 全局 / 模块图),不从 lsp 反向 import nudojs, 零新增 core / service 导出;agent check 工具面把它交给checkSource({ inject })⇒nudo/check由ok=false · 1 error · unknown #partial变为ok=true · 0 error · string(与 CLI 同款结论)。 - Bug 786(注入传递协议 + inlay 半):
CollectAbsInlaysOpts新增inject字段并透传给generalizeFromAst(core 侧只改内部函数体、 零新增 core 导出 ⇒ 不破 core 冻结面)⇒ inlay 面不再把「行内指令缺席」 显示成unknown(Nudo 词汇里 = 「推断失败」)。对外交付注入传递协议:buildLspInjection(filePath, source, { loadModule?, modules? }) → RunTranspiledOptions,消费方统一走checkSource({ inject })/generalizeFromAst({ inject })/collectAbsInlays({ inject })。 - Bug 780(agent 侧):
nudo.trace此前只读params.file⇒ LSP 自产的file://…uri 形态与executeCommand位置参数形态都让params.file变undefined⇒ 观察透镜 100% 抛 TypeError。现在FunctionToolParams收uri键(与file二选一,缺省时报共用入口闸的file is required …而不是裸 TypeError),并导出位置参数桥tracePositionalArgs([uri, fn])(形态不合法 ⇒undefined,由命令桥报协议层参数形态错误)。 - Bug 779(vite 半):
checkIssuesToDiagnostics在转成 vite Diagnostic 之前就把 info 级砍掉 ⇒ 下游档位过滤器永远看不到 info ⇒nudo.analysis.diagnostics: "verbose"对 check 诊断是空操作 (nudo:assume-relied/nudo:invariant-relied/nudo:opaque-result永不上屏)。转换点改为保留三档,档位取舍只由filterDiagnosticsByLevel决定;info 级走 vite 的 info 通道 (不混进 warn 流),warning 计数不含 info。
- Bug 785(注入装配):LSP 侧从不采集行内指令(
-
27a795e: 族 22 修复 D1:Bug 699 / 702 / 709 / 714 / 715 —— 符号表按作用域存绑定、引用集合只收标识符、rename 编辑协议合法。
- 699:babel 把
ExportNamedDeclaration语句节点放进导出绑定的referencePaths,改名时它变成一个「宽于单个标识符」的编辑目标 ⇒rename一个导出绑定会把整条export function …声明替换成一个标识符,且与声明位 的编辑重叠(LSP 不允许同一份 edit 列表里 range 重叠)。引用集合现在只收Identifier节点;改名编辑另外加两道兜底:宽于一个标识符的编辑挡掉、互相 重叠的编辑只留窄的一条。 - 702:
references把声明位点返回两次(符号表里的声明位 + 引用集合里 的声明位),还混着上面那条语句级伪引用。引用集合按 (uri, 位置) 去重,语句级 目标不再进集合。 - 709:符号表按名字索引 ⇒ 遮蔽的同名局部变量上 F12 / Find-references 会落到另一个作用域的声明。定义现在按作用域路径存(同名 绑定在不同作用域各存一条),查定义时按光标所在作用域取最内层的那条。
- 714:
references的context.includeDeclaration: false仍返回声明位点 —— 该开关只关掉了「另一处」的声明。引用收集现在接受includeDeclaration入参并 由 references 通道透传。 - 715:改名遇到对象字面量简写属性(
{ x })时,key 与 value 是同一段 源码 ⇒ 整段替换会把 key 也改掉(对象的形状被静默改掉)。这类位置现在生成x: <新名>(保留 key、只换 value);解构模式(function f({ x }))同理。
- 699:babel 把
-
27a795e: 族 22 修复 D2:Bug 704 705 706 712 719 —— 大纲面与「方法引用 / 改名」面对齐真实符号。
- 大纲里所有变量绑定都写成
const:let mutable = 1与var x = 1的 detail 都是const(导出时是export const)——文案只按「是否导出」二分, 完全不看声明种类。现在按const/let/var如实输出(导出时前缀export)。 - 大纲漏掉整个默认导出:
export default (x) => x与匿名export default function () {}一条都不出(顶层语句循环只认函数 / 类 / 变量声明;无名函数又被「没有 id 就丢弃」的守卫挡掉)。默认导出现在一定在 大纲里:表达式型给一个名为default的符号,函数型即便匿名也出项 (无名时名字取default,有名时取函数名)。 - 大纲漏掉解构绑定:
const { p, q } = …/const [first, second] = …里的每个绑定都不出(取 id 的辅助函数只认普通标识符 ⇒ 整条声明被跳过)。 解构模式现在逐个绑定展开,每个绑定各出一个变量项。 - 类方法的 references / definition 一律返回空:类方法键不是绑定标识符,
绑定面找不到绑定目标就直接返回空,而已经写好的方法面没有被这两个请求接入。
两个请求现在改走方法面(方法键 + 同源成员访问):在类方法上查引用能看到
调用点,在
k.m(…)上按 F12 能跳回类里的方法键。 - 方法改名越过无关对象、且漏掉对象字面量的同名 key:改
K.m会把o.m(另一个对象的成员)一起改掉,改坏调用点;而对象字面量里的{ m() {} }/{ m: fn }的 key 又不在收集范围 ⇒ 定义位点与使用位点口径 不一致。方法引用现在以「归属」为界:类方法归类、对象字面量方法归对象, 成员访问只在接收者归属与该方法定义同源时计入;同名但不同类 / 不同 对象的方法不合并(跨文件扫描同样按归属收敛)。
- 大纲里所有变量绑定都写成
-
27a795e: Cross-file navigation follows the module graph the editor actually shows.
- A default export had no cross-file references:
export default function greet()in one file andimport greet from "./a.js"in another — the definition jumped across files, but the references of that definition were empty. The export name of a symbol is now resolved before the importers are matched, sodefaultis a first-class export name and the importing file shows up in the references. - A namespace import was read as if it named a single export:
import * as ns from "./def.js"made every occurrence ofnsa reference to every export of the imported file, including the ones the file never mentions. A namespace import now contributes only its member accesses (ns.beta), and a barensis not a reference. - Renaming an exported symbol across files edited the wrong side of an
aliased import:
import { oldName as alias }becameimport { oldName as newName }— the imported name was left behind, so the import no longer resolved and the module failed to load — while the alias, which is a separate local binding, was renamed. The imported side of the import specifier is edited now, the alias and its call sites are left alone, and renaming the alias itself no longer reaches into the imported module. - The fallback that jumps to a same-named export in the workspace fired
on member accesses:
o.helperjumped to an unrelatedexport function helperin another file. The fallback applies to plain identifiers only. - Cross-file definition, references and rename read the file from disk instead of the editor buffer, so an unsaved edit was invisible and the positions were off by the number of unsaved lines. The open document is the source of truth now, and the disk is only a fallback.
- A re-export was invisible to references and rename:
export { a } from "./m.js"established no edge, so renamingainm.jsleft the re-export untouched and broke the module. The re-export edge is followed now, in both directions: the references of a re-export cover the target module, and renaming either side keeps the two in sync. - The sidecar contract lookup pointed at bindings the engine never
consumes. Only an exported
fn({ … }, …)binding is a contract (a value template such asnumber().gt(0)is reported asnot fn() formand has no effect), so go-to-definition no longer sends the user to a binding that cannot take effect.
- A default export had no cross-file references:
-
27a795e: 族 22 修复 D4:Bug 698 700 701 708 717 721 723 —— 补全面与语义 token 面对齐真实语义。
- 尾随点号时补全整面清零:用户刚敲下
obj.的那一刻 buffer 文本语法非法, 而解析不容错 ⇒ 分析直接抛 ⇒ 补全返回空并在 console 报错——恰在最需要补全的 时刻失效。分析输入与绑定解析输入现在共用同一个消毒器(把尾随x.改写成x._),尾随点号与已敲出部分成员名给出同样的成员列表。缓存键仍按真实源码 计算:消毒文本只喂给一次性分析,不写回分析缓存,缓存与真实源码不会串味。 - 指令补全在乘号之后也弹
@nudo:指令:判定是「前面出现过*或nudo」的 子串匹配(@?n?u?d?o?:?整段可选),于是x *之后、字符串字面量里的@nudo:都算命中。指令面现在先算光标的词法上下文(注释 / 字符串 / 代码), 只在光标确实落在注释里时才出;注释里(含跨行 JSDoc)照旧出。 @nudo:sample的补全项吹着「Control loop iteration sampling」,但该指令只被 解析、不被消费;而且插入文本缺 count,接受补全就产生诊断。说明改成如实描述 (reserved / no-op),插入文本带上 count 占位。- 模块级函数的补全项被标成「方法」:顶层
function/ 箭头函数绑定不是任何对象 的成员,IDE 会把它渲染成方法。补全项新增function档(成员函数仍是method,非函数绑定仍是variable)。 - 语义 token 面漏标:类名、类方法、类字段、方法形参、数组解构元素全部不上色, 对象解构的绑定被上成属性。类名 → class 档(图例末尾追加,老索引不变)、类 方法键 → method、类字段键 → property、方法形参 → parameter、解构绑定 → variable。
- 对象字面量里的简写
{ x }是对变量的引用,却被当成属性定义(property 档 且带 declaration 标记)。简写现在是 variable 档且不带 declaration 标记。 - 标识符 token 的长度按解码后的名字算:
const abc = 1里名字是abc(3), 但源码写法是转义序列(8)⇒ token 只盖住转义序列前半截,客户端高亮错位。长度 改用源码跨度(位置口径仍是 UTF-16 code unit)。
- 尾随点号时补全整面清零:用户刚敲下
-
27a795e: 族 22 修复 D5:Bug 711 718 720 985 986 —— 签名帮助面对齐「正在被编辑的那个调用」。
- 嵌套调用弹外层函数的签名:光标在内层实参里时,弹出的却是外层函数的
签名(内层调用完全不参与)。命中第一个(外层)
CallExpression就停 +path.skip()⇒ 内层CallExpression永不被访问。现在在所有命中里保留 最内层者(被调者起点更靠后 / 终点更靠前者更内层),嵌套调用的签名帮助 指向内层被调者。 activeParameter越界:2 参签名在第 2 个实参之后报下标 2(协议规定下标 须落在签名参数表内,越界值客户端只能回落 0 ⇒ 高亮错误的参数)。下标现在按 签名参数表夹住(min(active, params-1)),参数表为空时省略该字段 (不是填 0)。- 方法调用(
obj.method(…))整面无响应:被调者是接收者的槽位, 不是模块级绑定 ⇒ 绑定面必然 miss。签名面现在沿 Abs 形状逐段下钻 (obj→obj.method),与成员补全面同一条下钻口径。 - 默认导出的 callee(
export default function defFn(…))整面无响应: 分析结果的绑定表只收具名导出,默认导出连default键都没有 ⇒ 绑定面 必然 miss。签名面落到 AST 定位回落(与 hover 面同源的generalizeFromAst)⇒ 按声明找被调者,与绑定表的键口径无关。 - 函数体内的局部 callee(局部函数声明 / 局部箭头常量)整面无响应: 局部绑定不在模块级绑定表里。同一套 AST 定位回落覆盖这一形态。
- 查表与 AST 定位都 miss 时,返回可观测的降级结果(被调者标识符 + 空
参数表)而不是
null—— 「没有签名」与「Nudo 不知道」必须可区分。
- 嵌套调用弹外层函数的签名:光标在内层实参里时,弹出的却是外层函数的
签名(内层调用完全不参与)。命中第一个(外层)
-
27a795e: 族 22 修复 D6:Bug 716 722 724 725 911 951 —— hover / CodeLens / inlay hint 面与
nudo check对齐。- inlay hint 面无视请求区间:
textDocument/inlayHint的range是必填且表示 「只请求该区间」,但服务端从不读它 ⇒ 两个不相交的区间返回逐字节相同的 整文件 hint 集,客户端的局部刷新被无视、无关区段的 hint 反复重绘。现在 返回的 hint 落在请求区间内(区间缺省时仍给整文件集,不丢内容)。 - CRLF 源文件上的 inlay hint 位置越界 1 列:服务端按
\n切行,行尾的\r被算进行长 ⇒ end-of-line hint 的character比客户端算出的可见行长多 1 (LSP 里行终止符不属于该行)。切行改成 CRLF 感知,服务端行长与客户端的 可见行长一致。 - hover 首行的契约档位恒为「激活」:hover 渲染
● contract / …时没把观察 选择器的状态带上(默认值就是激活),而同一文件的 CodeLens 在选中 case 后 已翻成○ contract / …⇒ 同一个 IDE 里两个面互相打脸。现在 hover 与 CodeLens 同源:选中 case 时契约档两处一起翻○。 - 观察透镜是死链:服务端 CodeLens 把
entry@/call@透镜交给客户端执行nudo.trace,但 VS Code 扩展从未注册这个命令 ⇒ 点了报「command 'nudo.trace' not found」,观察透镜 100% 不可用。扩展补注册该命令(转发到 服务端的nudo/trace),manifest 的contributes.commands一并登记。 - hover 签名块整段丢掉
throws通道:Abs 的四槽(shape × term × pred × conf)没有 throws 槽 ⇒ IDE 里显示「不会抛」,而nudo check同一函数判nudo:entry-may-throw(error)⇒ 跨产品面自相矛盾,并违反api/lsp.md明写的「check-identical signature」承诺。签名块现在按 check 签名行的同款格式带上throws <Type>(见证面证据;无证据时省略,不写throws never;非导出函数不带——CLI 的 L2 throws 只对 entry 生效)。 - hover 签名块的返回类型按
maxDepth: 4截断:同一份源码、同一函数、同一次 分析下,nudo check签名行 / 同文档的 inlayHint /nudo.hover载荷给出 三个互不相同的类型(越深的结构,hover 给的信息越少——深度 8 与深度 4 的 hover 输出逐字节相同)。返回类型改走共享投影预算(与 check 同口径)。
- inlay hint 面无视请求区间:
-
b37321b: The editor shows what the command line shows, at a position the editor can use.
- A file that only contains
@nudo:assume,@nudo:invariant,@nudo:throwsor@nudo:budgetwas skipped as "not a Nudo file", so those directives were never analyzed and the file looked clean. Those files are analyzed now. - A
nudo:directive-syntaxdiagnostic was published twice, and one copy carried line-1— not a valid position in the protocol. It is published once, at a valid position. - The placeholder position used for
nudo:module-missingandnudo:mock-invalidwas converted to line-1. Those two error diagnostics now land on a valid line. - An env diagnostic that names the env rather than a file was filtered out because the filter only matched file paths. The unknown-env-name and the env-contract diagnostics are visible now.
- The project configuration fingerprint read the raw
autoBindvalue while the analysis read the normalized one, so a configuration written as a non-boolean looked like a different configuration on every keystroke. The fingerprint uses the normalized value. - A path env whose load failed was reported by the service analysis before the check ran, and the check's own copy of the diagnostic could be lost. The diagnostic reaches the editor in both paths.
- A file that only contains
-
63b12c1: LSP IDE 面 8 处用户看得见的缺口(族 53):语义高亮不再整面消失、指令补全 不再子串误命中、类方法跳转与跨文件引用可解析、
executeCommand接位置参数、ignoreThrows与 CLI 同口径、env 模板变更触发依赖文件复分析、扩展命令面板 补齐nudo.selectContract。- 语义 token 面在语法非法 buffer 上整面清零(
semantic-tokens.ts):buildSemanticTokens遇parse抛就return []⇒ 用户改到一半(括号没 闭合 / 半个表达式)整个文件的高亮瞬间消失。现在解析失败走词法降级: 把注释 / 字符串内容挖空(长度与换行不变 ⇒ 坐标不变)后按关键字 (function/class/const/let/var)取紧随其后的标识符 ⇒ 仍有部分 token。取舍:降级档只给声明位上色(成员访问 / 参数 / 引用位静态不可知 ⇒ 不猜,宁可少上色不可错上色),且不缓存上次成功结果 (旧坐标比清零更坏)。 - 指令补全的前缀过滤是子串匹配(
server-ide.ts):过滤收敛为纯前缀 匹配(label.startsWith(typed)),语义写死在matchesDirectivePrefix的注释里。⚠ 前缀语义:@nudo:ca只命中@nudo:case(@nudo:contract的前缀是@nudo:co);@nudo:c命中所有以@nudo:c开头的指令 (@nudo:case与@nudo:contract都真前缀于它)——被排除的是「不是 typed 前缀」的 label(子串语义才会把@nudo:mock/@nudo:replace这类 含c的项误纳进来)。 - 方法面未下沉到符号层(
symbols.ts):类 / 对象方法的方法键不是绑定 (绑定表不收它)⇒ 纯函数面resolveDefinitionLocations/resolveReferences直接调用时认不出方法(此前只有协议通道内联了一份 方法判据 ⇒ 纯函数面与协议面口径分裂)。方法面现在下沉到符号层 (methodTargetAt),协议通道改为委托符号层 ⇒ 两面同一口径。 - 跨文件方法 references 未接:references 通道对方法只扫当前文件
⇒ 跨文件的
Alpha.run调用点不在结果里,而改名面已经会带上它们 ⇒ 用户 「查引用看不到、一改名却跨文件被改」。方法面现在跨文件扫描 (collectMethodReferencesAcrossFiles:extraFiles+ 打开文档 buffer 覆盖层),归属(owner)由光标所在文件显式给出 ⇒ 同名不同类(Beta.run) 仍不合并。 executeCommand缺位置参数 → 对象桥(server.ts):IDE 侧历史上用 位置参数发命令([uri, …]),而 executeCommand 通道只认对象参数 ⇒ 位置形态落到兜底分支 ⇒ 协议层 InvalidParams ⇒ 命令 100% 失败(扩展侧 只能绕道 slash 请求)。agent-tools.ts的positionalCommandParams统一桥nudo.check/nudo.hover/nudo.test/nudo.whatIf/nudo.suggestCase/nudo.getActiveCases。对象形态行为不变;位置形态 缺必填项仍报协议层参数形态错误。- LSP 侧
ignoreThrows口径与 CLI 分裂(gate-config.ts):service 的checkConfig只认严格string[]⇒ 配置写成"TypeError"(裸字符串) 或["TypeError,RangeError"](数组元素内含逗号)时被静默丢成空表 ⇒ IDE 仍报nudo:entry-may-throw(假红),而 CLI 认这两种写法 ⇒ 同一份package.jsonCLI 绿 / IDE 红。LSP 侧改为按同一语义解析(裸字符串 / 字符串数组都接受;数组元素内部也按逗号切分;trim 后丢空;非字符串元素忽略), 并把 CLI 的解析器作为测试 oracle 逐值比对。⚠ 根因在 service / core 的 配置解析层 ⇒ 本次只修 IDE 面(service 层未动)。 - LSP 的 env 模板无反向边(
validation.ts):watched-files 只按 LSP 自己 的nudoDepParents定向重检 ⇒ path 型@nudo:env模板改了不一定触发 依赖源文件复分析(CLI watch 走 service 的 env 反向边表 ⇒ 两面口径分裂)。 现在 LSP 直接消费 service 的同一张表(envPathDependents——解析口径 同源,不另写一份)⇒ IDE 与 CLI 同口径。 - manifest 漏登记
nudo.selectContract(packages/vscode/package.json): 扩展的 handler 认这个命令(languageclient 自动注册 ⇒ CodeLens 可用), 但contributes.commands没有它 ⇒ 命令面板里搜不到。现在登记进 manifest (标题与兄弟命令同款风格)。
- 语义 token 面在语法非法 buffer 上整面清零(
-
a6e9fa2: LSP navigation now agrees with itself: method and
catchparameters have a definition, private class members keep their own identity, and renaming an aliased export renames the export instead of the local binding.textDocument/definitionreturnednullfor a class method parameter, an object method parameter, and acatchparameter, whiletextDocument/referencesat the very same position returned the declaration. The symbol table only visited the parameters of three kinds of function, so those parameters never became definitions and the definition lookup fell through to a workspace fallback that found nothing. The symbol table now visits class methods, object methods, private methods, private fields, andcatchclauses; acatchparameter is scoped to thecatchclause itself.- A private class member (
#name) was resolved as if it were the ordinary identifiername, sodefinition,references, andrenameall landed on an unrelated binding with the same name — renaming a private method rewrote an unrelated exported symbol and its importers across files, breaking the module graph. A private member now has its own identity (#name), scoped to the class that declares it;prepareRenamereports the placeholder with the#, and the edited range still covers only the identifier so the#is kept. - An aliased export (
export { a as b }) packed two identities into one specifier: the local nameaand the exported nameb. Renaming through an importer collected the edit set by the local name, so it rewrote the local declaration and the local side of the export specifier while the importers were renamed to a name the module no longer exported — the module graph broke even though both files stayed syntactically valid. The local name and the exported name are now separate identities: renaming the exported name edits the exported side of the specifier together with theimportedside of every importer, and never the local declaration; renaming the local name edits the local declaration and the local side of the specifier only. The exported-name position is no longer a dead end:definition,references,prepareRename, andrenameall answer there.
-
a6e9fa2: LSP: make the navigation face answer per the client's capabilities, encode URIs correctly, validate rename targets, and give every navigation request the same file gate.
- Bug 745 —
workspace/symbolnever returned class members. The handler only walked the top level ofdocumentSymbols, while class methods and class properties live in a symbol'schildren⇒ they could never appear in a workspace search. The handler now walks the tree recursively and flattens it intoSymbolInformation[], expressing the hierarchy throughcontainerName(which is what the flat LSP protocol expects). - Bug 748 —
filePathToUrianduriToFilePathwere not inverses of each other. The encoding side concatenatedfile://with the raw path (so%,#,?and spaces were never escaped) ⇒ the server produced URIs that were not valid URIs; the decoding side ran a baredecodeURIComponent⇒ a malformed percent escape threw an uncaughtURIErrorand aborteddidOpen/didChange/didClose, leaving that document with zero diagnostics. The encoding side now uses Node'spathToFileURLand the decoding side usesfileURLToPathwith atry/catchfallback (malformed input degrades to the undecoded text and never throws), so the two are exact inverses;cacheKeybenefits as well. URIs for non-file:schemes (untitled:…) are still returned verbatim. - Bug 749 —
textDocument/documentSymbolignored the client's capabilities. The server never keptparams.capabilities, so it always answered with the hierarchical shape and the fullSymbolKindrange even when the client declaredhierarchicalDocumentSymbolSupport: falseor a restrictedsymbolKind.valueSet(both are protocol violations). The navigation handlers now consume the client capabilities thatinitializecaptured: a client without hierarchical support receives a flatSymbolInformation[](locationinstead ofrange/selectionRange/children), and a kind outside the client'svalueSetis clamped to a safe value inside that set (with a note indetail). When the client sends no capability section at all the default answer is kept — hierarchical shape, fullSymbolKindrange. - Bug 750 —
textDocument/renamenever validated the new name. The request'snewNamewas used as the replacement text verbatim ⇒ a single rename could turn the source into invalid JavaScript (an invalid identifier, an empty name or a reserved word) andnode --checkwould fail with aSyntaxError. The new name is now checked at the syntax level — it must be a legal JavaScript identifier, non-empty and not a reserved word — and an invalid name produces no edits at all. - Bug 751 — the navigation requests each had their own file gate. The
sidecar contract file (
*.nudo.js) was let through bydefinitiononly, was rejected by the other four navigation requests, and was listed byworkspace/symbol, which had no gate at all ⇒ one coordinate, three different answers (the server contradicted itself).definitionno longer has its sidecar escape hatch andworkspace/symbolnow uses the same path-level gate, so sidecar contract files are invisible to every navigation request. (The cost is that a source symbol can no longer jump into its sidecar contract; that capability needs the symbol table to model sidecar bindings and is tracked separately.)
- Bug 745 —
-
a6e9fa2: LSP: capture the client's capabilities at
initialize, and give the navigation/IDE file gate a single source of truth.- Bug 749 — the server never kept
params.capabilities.onInitializeonly echoed the server's own capability declaration, so no handler could answer according to what the client asked for:textDocument/documentSymbolalways answered with the hierarchical shape and the fullSymbolKindrange, even when the client declaredhierarchicalDocumentSymbolSupport: falseor a restrictedsymbolKind.valueSet. The client capabilities are now captured duringinitializeand handed to the navigation handlers through the existingdepsobject (no new package export). When the client sends no capability section at all the value staysundefinedand the handlers keep the default answer (hierarchical shape, fullSymbolKindrange) — an old client must not degrade the server's output. Theinitializeresult itself is unchanged, so the declared server capability inventory is untouched. - Bug 751 — every request had its own file gate. The sidecar contract
file (
*.nudo.js) was let through bydefinitiononly, was rejected by the other navigation requests and by all six IDE requests, and was listed byworkspace/symbol, which had no gate at all — one coordinate, three different answers. The gate now has a single source of truth (server.ts'sisNudoFile, which explicitly excludes sidecar contract files) and the same predicate instance is injected into the navigation and the IDE handlers, so both sides answer alike. Sidecar exclusion is also spelled out in the predicate itself, so it survives a future drift of the path-level suffix table.
- Bug 749 — the server never kept
-
a6e9fa2: LSP: three reverse guard tests for the navigation findings that no longer reproduce.
This slice changes no implementation code — it only adds three regression tests that pin the already fixed behaviour of the navigation face. The symptoms described in the bug report do not reproduce on
HEAD: they were covered by an earlier family, and the tests below are the guard rails that keep them from coming back (they are expected to pass onHEAD).- Bug 746 — renaming a local alias must not drag the exported symbol and
the other importers along. Renaming the local alias of
import { oldName as alias } from "./xf-def.js"now edits only the local side of the import specifier and its call site; the defining module and the other importer stay untouched. The opposite direction is pinned as well: renaming the exported name from the defining module edits that module and the imported side of every importer, and leaves the alias alone. (Covered by the Bug 710 fix of the earlier signature family.) - Bug 747 — renaming a parameter must not drag the shadowing top-level
variable along. With
const x = 1;next toexport function f(x), both directions are pinned: renaming the parameter edits only the parameter declaration and its use, renaming the top-level variable edits only that one place.definitionandreferencesstay scope-aware as well. (Covered by the Bug 709 fix of the earlier signature family.) - Bug 1025 — the imported side of an aliased import resolves to the
module it really imports. With two files exporting the same name, the
definitionof the imported side lands in the imported module instead of the unrelated same-named export, and itsreferencesare not the empty array the report saw — they are the same set the non-aliased form returns. The underlying key space of the import binding table (it is still keyed by the local name alone) is tracked as a residual item; the position-aware lookup currently covers it.
- Bug 746 — renaming a local alias must not drag the exported symbol and
the other importers along. Renaming the local alias of
-
a6e9fa2: LSP: the workspace-folder subscription must never take the server down.
connection.workspace.onDidChangeWorkspaceFoldersis a getter invscode-languageserver@10.1.2that throws (Client doesn't support sending workspace folder change events.) unless the client declaredcapabilities.workspace.workspaceFolders— and it only becomes usable afterinitialize, when the library has processed the client's capabilities. The server read that getter while it was still being constructed, i.e. before any client had spoken, so the getter threw for every client and the language server died on startup withError: Client doesn't support sending workspace folder change events.at get onDidChangeWorkspaceFolders (…/vscode-languageserver/lib/common/workspaceFolder.js:38:23)at createNudoServer (…/packages/lsp/src/server.ts:374:3)The optional chaining (
?.) did not help: it only guardsnull/undefined, not a thrown exception.The value is now read inside a
try/catch; a client that does not support the notification face makes the server skip the subscription silently and start normally, andinitializestill answers with the unchanged server capabilities. The subscription itself is kept: it is taken once at construction (in-memory connections) and, for a real transport, once more right afterinitialize— where the getter is finally ready — so the workspace-folder change handling (the authorization boundary follows the added/removed folders) keeps working instead of being silently dropped by the guard. -
e2d4688: The code-action face of the language server no longer crashes and no longer writes broken code into the user's sources.
- The language server captured the agent-tool dependencies before the server
had finished initializing, so every
textDocument/codeActionrequest threw and the whole face was unavailable. The dependencies are now read on demand. - The quick fix for a missing call-site field wrote the literal
undefinedinto the source, which then failed the very check it was meant to fix. The placeholder is nownull, and the violation is still reported afterwards. - The quick fix that adds a field to a contract inserted it into the parameter list instead of the parameter's shape, producing a sidecar that no longer parsed. The insertion point is now located through the syntax tree, and a field that is already declared is not offered at all.
- The quick fix that inserts a call-site field used a textual heuristic that could land inside a string literal. The insertion point is now located through the syntax tree, and the fix is not offered when there is no object argument.
- The quick fix that writes a sidecar inserted the new declaration at the top of the file, which left the previous contents in place and produced a file with a duplicate export. The edit now covers the existing sidecar, and a plan that would duplicate an export is not offered.
- The language server captured the agent-tool dependencies before the server
had finished initializing, so every
-
e2d4688: The "inline variable" refactoring of the language server now refuses to inline a value it cannot prove is safe.
- A variable was inlined even when it was reassigned or captured by a closure, which changed the program's behaviour. The refactoring now only offers an inline action when the variable is provably single-assignment and not captured.
- A variable was inlined across an export boundary, so the module's public API changed silently. Exports are now detected and left alone.
- The refactoring was offered for a binding that the selected range does not actually cover, and it sometimes inlined the wrong occurrence of a shadowed name.
-
e2d4688: fix(lsp): Extract to function 的插入点 / 语句切分 / 取名收口(族 23 片 C:Bug 732 / 734 / 736 / 740 / 742 / 971)
- Bug 732:
Extract to function不再把原函数的export关键字偷给新函数 —— 插入点改用语句起点(export的列)而不是function关键字的列 ⇒ 模块公开 API 不再从['f']静默变成['extracted']。 - Bug 734:被抽出的若是赋值表达式(
x = compute();),调用点生成赋值表达式 (x = extracted(...))而不是硬编码的const x = ...⇒ 不再与外层let x重复声明 (文件曾彻底不可解析)。原本就是声明时还原同种声明(const/let/var)。 - Bug 736:新函数只插在语句位置 ⇒ 箭头初始化式 / 对象字面量方法 / class 方法 三种宿主不再产出不可解析的文件。
- Bug 740:选区含
break/continue时拒绝抽取(不再产出SyntaxError: Illegal break statement);选区末条是return时把返回值接回调用点 (return extracted();)⇒ 外层返回值不再被静默丢掉。 - Bug 742:顶层选区的插入点跳过文件前导区(hashbang / 指令 / 前导注释)⇒ 新函数不再
落到
#!/usr/bin/env node之前(文件曾整体不可解析)。 - Bug 971:新函数名做占用检查(在
extract-function.ts内部,调用方零改动)⇒ 撞名时自动改名(extracted→extracted1)⇒ 不再出现SyntaxError: Identifier 'extracted' has already been declared。 - 抽取产物新增「仍可解析」自检:坏产物一律不出 edit。
- Bug 732:
-
27a795e: 族 22 收口接线:方法改名在归属歧义时拒绝执行,而不是改出自相矛盾的代码。
- 改一个类方法时,如果文件里同时存在「接收者归属解析不出来」的成员访问
(形参、外部对象)和另一个同名但不同归属的成员,那么这个成员访问
可能指目标方法、也可能指那个别的归属——静态上不可判定。此时改名只有
两种自洽结果:全改(可能改到无关对象,运行时读到
undefined)或全不改 (定义改了、调用点没改,同样读到undefined)。两者都会改坏代码, 所以现在拒绝这次改名:不产出任何编辑,编辑器显示该符号不可改名。 准备改名的提示与真正的改名请求同口径,不会先让用户改、改的时候又拒绝。 - 之前把「改定义、不改歧义调用点」当成安全的做法,实际它同样改坏代码; 这一条修掉之后,改名要么覆盖全部可能的调用点,要么明确拒绝。
- 改一个类方法时,如果文件里同时存在「接收者归属解析不出来」的成员访问
(形参、外部对象)和另一个同名但不同归属的成员,那么这个成员访问
可能指目标方法、也可能指那个别的归属——静态上不可判定。此时改名只有
两种自洽结果:全改(可能改到无关对象,运行时读到
-
169ed52: The disk cache, the LSP and the Vite plugin now agree with the CLI about environments, budgets and injected modules.
- The cache key did not contain the effective fork budget, so changing
NUDO_MAX_FORKSstill served the previous run's result. The effective value (environment variable, thenpackage.json, then the default) is now part of the key. - An invalid
nudo.check.entryThrowsvalue was reported once per checked file. The warning is now printed once per distinct invalid value. @nudo:asdid not apply to an exported binding, so the tool still reported "bindings applied" while the type stayed unchanged. The override now matches the exported declaration as well.--what-ifattached an assumption to the wrong variable when a line ended with a comment, and it reported a made-up reason when two declarations shared a line. Assumptions are now anchored by statement identity.- The LSP and the Vite plugin never applied
@nudo:mock, so a project that checked cleanly in the CLI reported a spurious "may throw" in the editor and in the build. Both now assemble the same injection channel the CLI uses.
- The cache key did not contain the effective fork budget, so changing
-
3432d8c:
nudo/suggestCase(LSP agent 工具)给出的见证建议不再落进引擎的「合成 / 固化」 名字空间,并带上可判定的期望。- 改前:工具把合成 case 的原名(
call@L<n>)原样写进建议文本 (* @nudo:case "call@L4" ("bob"))。该名字属于合成 / 固化见证的名字空间 (call@=nudo test --freeze固化的见证,entry@= 入口兜底见证)⇒ 用户照建议原样贴回源码后,同一个调用点会留下两条见证(工具建议的call@L4+ 固化出来的call@L7)。 - 改后:建议里的名字是手写见证名
witness@<n>(与call@/entry@不相交;名字只含字母 /@/ 数字 ⇒ 指令文法承载得了;同一份源码每次建议 同名 ⇒ 可重复贴回),并且每条建议都带上=> expected(观测值,用--freeze同一个序列化器产出 ⇒ 往返保真)⇒ 贴回后真的产生断言 (进断言面、计入passed),而不是一条没有期望的unchecked见证。
引擎推不出结果(
unknown/any/opaque)、调用抛错(never)或结果 无法用指令文法表达时,不给期望(并在建议末尾说明条数)——宁可留一条诚实的 无期望见证,也不写一条注定判红的期望。工具名 / 协议面不变(
nudo.suggestCase/nudo/suggestCase/suggestCase三处表项未动)。 - 改前:工具把合成 case 的原名(
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [cc9b638]
-
Updated dependencies [2688251]
-
Updated dependencies [7fea13a]
-
Updated dependencies [1caec28]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [27a795e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [02aa122]
-
Updated dependencies [3432d8c]
-
Updated dependencies [3432d8c]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [aa23265]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [106ad1d]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
-
Updated dependencies [8542f44]
- @nudojs/core@1.16.0
- @nudojs/service@1.10.0
- @nudojs/parser@1.5.3
1.7.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
- @nudojs/parser@1.5.2
- @nudojs/service@1.9.2
1.7.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
- @nudojs/parser@1.5.1
- @nudojs/service@1.9.1
1.7.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every
existsSync(p) && statSync(p)double call (TOCTOU race + errno swallowing) with a singlestatSync(p, { throwIfNoEntry: false })per the repo's load-module convention: ENOENT stays a silent miss, EACCES/EIO surface via the site's error channel (top-level catch,reports.push({error}), exit-1 message, or a logged warning) instead of masquerading as "file absent". Read-failure catches now branch one.code: sidecar contracts unreadable for reasons other than ENOENT print awarning: cannot read sidecar contract …incheck/check --fix(no more silent contract-blind green runs);@nudo:mockseed evaluation failures warn inexportbefore degrading;pnpm-workspace.yamlread failures other than ENOENT abortmigrate(a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read reportread-failedwith the errno instead of the misleading "Mock file not found"; npm entry probes and LSP module-candidate stats log persistent failures instead of degrading a package's export face to unknown or silently breaking go-to-definition;contract --from-dtspath-like arguments that don't exist now error aspath not foundinstead of being treated as npm package names ending in a misleadingno .d.ts files found. - 9a3d6e7: Stop silently swallowing business-Promise failures.
nudo check/test --watchincremental rounds died silently when the round body threw outside the per-file try (buildModuleGraph/evictForDependents/topoSortDirty) — the screen just froze on the previous round's results; the error is now printed (nudo <label> incremental failed: …), mirroring the existing first-round BUG-023 handling. In the LSP server,validateDocument(didOpen / didChange debounce) andhandleNudoDepFileChanged(didOpen / didChange / watched-files) rejections were discarded with an empty catch — a file throwing in the analyzer produced no diagnostics and no trace, forever; failures are now logged to stderr as[nudo-lsp] …lines. Best-effort client capability requests (DiagnosticRefresh/CodeLensRefresh/ inlay-hint refresh) keep their intentional silent catch. - Updated dependencies [aae0f96]
- Updated dependencies [52de5ca]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
- @nudojs/service@1.9.0
- @nudojs/parser@1.5.0
1.6.10
Patch Changes
- Updated dependencies [c19bd48]
- Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
- @nudojs/parser@1.4.24
- @nudojs/service@1.8.0
1.6.9
Patch Changes
- Updated dependencies [0d9e7de]
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
- @nudojs/service@1.7.0
- @nudojs/parser@1.4.23
1.6.8
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
- @nudojs/parser@1.4.22
- @nudojs/service@1.6.25
1.6.7
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
- @nudojs/parser@1.4.21
- @nudojs/service@1.6.24
1.6.6
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
- @nudojs/parser@1.4.20
- @nudojs/service@1.6.23
1.6.5
Patch Changes
-
82eaae8: Fix
nudo:recursion-truncatedmisattributing call-cycle truncation to "depth/size budget", and makenudo check --jsonbudget stats see the B-path ($callNamed) truncation (issue #158):enterCall/evalEnterCallnow attribute a truncation reason —cycle(same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers orgrow-style recursion) vsdepth/calls(real budget exhaustion). The check diagnostic message, suggestion, structured action, and a newreasonfield on the issue (cycle|depth|calls|budget) split accordingly: cycle says "budget cannot lift this" and never points at@nudo:budget; depth/calls name the exact raisable dimension (@nudo:budget depth=…/calls=…).- The
check --json/ health budget block no longer reportstruncated:falsealongside anudo:recursion-truncatedinfo: B-path counters are latched across execution sessions within one host entry and surfaced asevalCalls/maxEvalCalls/evalCallTruncated, pluscycleTruncatedand a sortedreasons[]set (single-file and multi-file envelopes, and the disk-cache round trip). Fork counters/truncation flags are latched per host entry too (the last-session snapshot could previously erase an already-reportednudo:fork-truncated). - The
@nudo:budgetquickfix (nudo check --fix/ LSP code action) is no longer offered when the truncation reason iscycle; thereasonis plumbed throughcheck --json, the disk cache, LSP diagnostic data, andmaterializeAction. - Raising
@nudo:budgeton a same-args recursion could never lift the truncation — the old message misled real budget investigations into "directive ignored" hypotheses. - Loop-iteration truncation (
#loop-iterations) no longer masquerades as recursion: it now emits its ownnudo:loop-truncatedinfo with an honest message and suggestion (the call-budget knobs cannot lift a loop budget —@nudo:budget calls=/depth=does not apply), gets aloopTruncatedflag in thecheck --json/ health budget block (single-file and multi-file envelopes), and no longer offers the misleading@nudo:budgetquickfix it used to inherit from the recursion branch.
-
Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
- @nudojs/service@1.6.22
- @nudojs/parser@1.4.19
1.6.4
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
- @nudojs/parser@1.4.18
- @nudojs/service@1.6.21
1.6.3
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
- @nudojs/parser@1.4.17
- @nudojs/service@1.6.20
1.6.2
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
- @nudojs/parser@1.4.16
- @nudojs/service@1.6.19
1.6.1
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
- @nudojs/parser@1.4.15
- @nudojs/service@1.6.18
1.6.0
Minor Changes
-
b8db17b: 参数契约折叠展示(inlay + hover + 签名):
- inlay:侧车
fn()形参表达式原文(如where nullable(astNode))或@nudo:contract指令约束名替代谓词无损展开(lazy 判别联合展开可达数万字符),完整谓词经 LSP inlay tooltip 展示。侧车 ∧ 指令并存时展示expr ∧ name(任一文本缺席则整体回落谓词全展);整表达式别名(import { astNode as N }的裸N)规范化为导入名;派生形参(spread / computed)无静态文本,回落谓词全展。 - hover:参数声明位 hover 折叠为声明形态(
node: nullable(astNode)),函数名 hover 签名的契约参数同口径折叠;函数名 hover 的契约面 display 同步折叠。体内引用位经求值器重放直读引擎求值态 Abs(核心变更):transpilerecordPositions插桩($nodoPos——标识符值读 / 静态成员属性位 / 可选链成员跳属性位,计算成员记表达式起始位;记录并原样返回,语义恒等)+runTranspiled符号执行导出函数(入口 Φ 种子 + 契约参数 Abs),位置直读求值态 Abs——流敏感窄化为引擎求值语义(早退守卫 nullish 剥离 / 判别等值窄化 /!==对偶 / typeof 守卫 /&&/||链,Φ-native$fork臂内withExecPhi+$narrowMemberEq剪影),非 LSP 层近似。显示阶梯:求值态与入口 Abs 等价(leqAbs 双向)或仅剥 nullish 的位置(声明位 / 检查点 / 成员访问对象 / 落回位)→ 折叠声明形态 + 类型值变量链接;窄化位(守卫 then 分支 / 成员读槽位 / 局部量)→ 求值态展示(node: { type: lit("StringLiteral"), value: string } | { type: string }——showLits渲染 lit 判别值与侧车文法同形;开放尾臂按 may 态保守保留——其type: string()值域与 lit 判别重叠,成员读槽位在尾臂缺席 →string | undefinedsound)。重放 fail-closed(求值失败 / 预算超限 / 无契约 / 非导出 / 解构形参)→ 回落声明形态面:||组 then 分支(引擎 phi 合取不能表达析取事实)LSP 层按匹配臂联合源文本窄化(sound);else 分支否定形态有界跳过。折叠面中的类型值变量包为链接([astNode](file://<依赖侧车>#L<定义行>)——经侧车 import 表 / 本地顶层声明 / re-export 一级解析;渲染为 plain markdown——代码块内链接不渲染),替代原独立"契约原文"行;无引用变量的契约回落契约原文行。 - core API:
formatShape(a, { maxDepth, showLits })——showLits把eq(self, lit(v))pred(槽位为get(p, k)字段项、顶层为参数项)渲染为lit(v)(默认 false——既有全部展示面口径不变)。 - 修复:exec 缓存命中(同内容侧车在不同路径——复制的契约)时不重跑
execSidecar,参数折叠文本注册表按路径键在命中路径补登记;此前第二个同内容侧车路径查不到折叠文本、回落谓词全展。
- inlay:侧车
-
fa52735: 参数契约 inlay hints(形参后
where …)默认关闭:显式契约(递归 AST 节点联合等)行内展开可达数万字符。新增nudo.inlayHints.parameters(boolean,默认false)三级配置——项目package.json#nudo.inlayHints.parameters显式值赢,宿主设置(VS Codenudo.inlayHints.parameters/ Zedlanguage-servers.nudo.initialization_options.inlayHints.parameters)只在项目未设置时作默认;workspace/didChangeConfiguration实时生效并触发inlayHint/refresh。返回类型 inlay(: …)、case hints 与 interface 档 inlay 不受影响;hover 仍展示完整契约。
Patch Changes
-
334b914: Discriminant narrowing visible in slot display; mid-token hover resolution
$narrowMemberEqkeep-arm refinement: surviving union members with a compatible discriminant slot now carry theeq(slotTerm, lit)fact on that slot (conjoined with any existing pred).formatShape(showLits)renders it vialitPredValue, so the open-tail arm displays{ type: lit("TemplateLiteral") }afternode.type === 'TemplateLiteral'instead of the unrefined{ type: string };memberEqClassupgrades those members toonly, improving chained discriminant narrowing and complement-arm pruning.any/unknownslots stay untouched (fail-closed markers).litPredValuenow readseq(self, lit)facts throughand-conjunctions, not only top-level eq preds.- LSP A0 hover replay resolves mid-token cursor positions: record keys are Babel start positions (
$nodoPosusesloc.start), so a cursor anywhere inside an identifier span now resolves to that identifier's record instead of falling back to the declared-form fold (previously only the first column hit).
-
f89677d: Hover 无响应排查修复:A0 重放缓存 LRU 化 + 进程级异常兜底
absNodeReplayCache(64 条上限)从「超限全清」改为 LRU 滚动淘汰(命中刷新新端、超限删最旧)。此前多文件浏览填满缓存后一次清空,后续 hover 全部触发冷重放(大文件同步重放数百 ms),与编辑防抖/诊断/inlay 同一事件循环排队,客户端感知 hover 卡死且无日志;LRU 后热条目(当前文件/最近浏览)在缓存压力下持续命中(实测雪崩 70 key 后原条目 12ms)。- server bin 入口注册
unhandledRejection/uncaughtException兜底:默认行为下未捕获异步异常会静默终止进程(客户端只见 "server shut down"、无 stderr 留痕),现在记录后继续运行,把静默死亡变成可排查的日志事件。
-
94197eb: hover 弹窗可读性与 return 表达式推导:
- pretty 缩进展示:
formatShape(a, { pretty: true })(opts 挂ProjectionBudget.pretty,与showLits同先例)——object 每槽一行 + 尾逗号 + 2 空格缩进递增;union 仅当至少一臂是复合 shape(object/array/map/set/fn 或渲染含{)时按臂断行(|前缀换行),纯 prim/lit 联合保持单行(string | null | undefined不断);截断标记…/…cycle原样内联。默认(不传 pretty)输出字节不变——check 签名 / dts / inlay / 语义 token 面不受影响。应用点仅 hover 面:标识符 hover(identHover / A0 求值态)与 return 表达式 hover;gSig签名、paramDisplayOf声明形态折叠面保持单行。 - 删除「契约原文」链接行:hover 弹窗不再推送
[契约原文](file://…#L<n>)链接(linkedText变量链接面保留);HoverInfo.sidecarPath/sidecarLine字段随唯一消费方一并删除。 - return 表达式推导 hover:transpile
ReturnStatement在recordPositions时把返回值包$nodoPos(src, line, column)记录到return关键字起始位(argument 起始位与内部根标识符读记录同键 first-wins 丢失;emitRet单一 choke point 覆盖 asVar/try/loop/mutator 全路径;裸return;不记录)。LSPabsNodeAtPosition词中回落从 Identifier 泛化为任意带 loc 节点(候选仅当起始键已有记录,取最小 span——词中标识符行为不变);新增无 ident 分支——hoverreturn关键字或表达式内非标识符位(?.[、[0]、.)直接显示推导类型(无 ident 前缀,pretty 渲染)。
- pretty 缩进展示:
-
35ce944: Fix recursive-fn local hover poisoning and arity-only fn hover display
$nodoPosposition records and call/assign records now carry the caller-frame depth; hover replay surfaces (absNodeAtPosition,collectEnclosingFnLocals) only read outermost-frame records. Recursive functions on self-referential contracts (lazy(() => astNode)) no longer bind cycle-truncatedopaque unknowninto local-variable hovers (objnow shows the computednull | string | undefined).const x = <non-call init>declarations record the bound Abs at the declarator-id position during hover replay (recordPositionsonly) — ternary/optional-chain/literal-initialized locals are hoverable (prop,q).callTranspiledExportFullInnerrefines the called fn AbsreturnTypeslot after a successful call (same policy as class method slots, display-only).- LSP hover: an arity-only fn Abs (empty
returnTypeslot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature(node: nullable(astNode)) => null | string | undefinedinstead of(arg0) => ?.
-
5e275df: fix: review hardening — Map.groupBy empty-reduce crash, Bug 1 early-exit relational narrowing, fs-error graph-edge degradation, agent tool module graph, brand presence for URLSearchParams/TextDecoder/Intl, generator side-table $copy migration
Map.groupBy/Object.groupBy: shadow-domain join no longer bare-reduces an empty unkeyed list (raw hostTypeError: Reduce of empty array with no initial valueescaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades tounknown.- Early-exit lift path (if-return followed by non-tail statements) now applies the same relational-arm narrowing as the regular IfStatement path (
narrowRelArmThunk), fixing false positives likeif (x >= 0) return x; console.log(x); return 1;under@nudo:contract return nonNeg. extractImportEdgesskips import edges whose target resolution throwsModuleReadError(EACCES/ESTALE, #135) instead of crashing module-graph construction (CLI watch start, incremental rebuild false-green rounds, LSP validation).new Function(...)/new Function("a", "b", ...)validate every argument for the L2 may-throw gate, not just the first.- Brand presence tables: URLSearchParams (methods +
size), TextDecoder (decode+ accessors), Intl.NumberFormat/DateTimeFormat (format/formatRange/parts/resolvedOptions); URLSearchParams joins ITERABLE_BRANDS (@@iterator → function). $copysnapshots migrate generator/match side tables (genDeferred throws, genIter/matchAll elements), so fork/switch-arm rebinding no longer silently drops deferred generator throws.- LSP agent tools (check/hover) build the module graph like the CLI and LSP validation do, fixing cross-module unknown collapse (E5 parity).
-
Updated dependencies [334b914]
-
Updated dependencies [94197eb]
-
Updated dependencies [b8db17b]
-
Updated dependencies [fa52735]
-
Updated dependencies [35ce944]
-
Updated dependencies [5e275df]
- @nudojs/core@1.10.0
- @nudojs/service@1.6.17
- @nudojs/parser@1.4.14
1.5.1
Patch Changes
-
71fd9fc: fix(lsp): 参数 hover——形参(含解构属性)从 PolyFn 面投影,不再空白
- 根因:hover 的标识符解析只有模块级 import 绑定面(bindings / collectAbsBindingsFromGraph),形参从不入绑定表;带
@nudo:case的函数体内更被整体短路(旧理由“保护 case 重放”,但重放面已删成恒 null)——decide({ grade, findings })的参数声明与体内引用 hover 全空。 - 修复:
getHoverAtPosition末段新增参数投影——traverse 直查光标最内层 enclosing 函数(不依赖指令存在,extractDirectivesQuiet只返回带指令的函数),generalizeFromAst(与函数名 hover 同源:契约种子 refine + 模块图)后从PolyFn.entryShapes + formals解析:- 直接形参(id/default)→
entryShapes[name];rest 同理; - 解构形参(pattern)→
bound名经propKey投影到 placeholder 对象 slot(rename{a: b}时契约可写 a 或 b,Abs 对象只有 slot a,语义正确)。
- 直接形参(id/default)→
- fail-closed 不变:无契约/无提升的参数与体内局部变量保持空(诚实 unknown,不冒充 any);非 case 函数体内的 import 引用仍走绑定面。
- 验证:npm-safe
decide.js(手写侧车)——grade→string / term: grade #path,findings→{ ruleId: string, severity: string, veto?: boolean }[],声明处与体内引用一致;函数名 hover 无回归;单测覆盖侧车解构投影、提升形参、fail-closed 三态。
follow-up(同 patch):
- 标识符 hover 单行化:参数/局部/绑定引用不再展开
term/pred/conf多行内涵(那是函数名 hover 契约面的职责),单行外延grade: string/vetos: { ruleId: string, … }[]。 - 体内局部 hover:
const vetos = vetoFindings(findings)这类调用初始化局部,经 entry 实参(契约种子)驱动一次 enclosing 调用,从EvalCallRecord.result(callLoc 对位)投影;let再赋值经$assignRecord范围内 join。结果按 (file, fn, 源指纹) 缓存,hover 连续触发不重跑。非调用/非赋值初始化保持 fail-closed。 - case 函数体内的模块级引用:绑定面不再被
insideCaseFn整体短路(原理由"保护 case 重放"已随重放删除失效)——vetoFindings等导入/同文件顶层引用恢复 hover;导入函数 callee(本文件无声明、intension 面缺失)同样放行到绑定面。 - 验证:stdio 实测 npm-safe
decide.js——grade(声明/引用)单行grade: string;vetos→{ ruleId: string, severity: string, veto?: boolean }[](filter 后元素形状保持);vetoFindings→ fn Abs;函数名 hover(● contract / hw+ 契约)无回归。
follow-up 2(同 patch):函数名 hover 弹层格式化——档线 + check 同口径签名单块
- 旧弹层四块近重复:builder 语法契约模板 + symbolic 多行(shape +
conf:)+_p0占位符 display 签名 +ext:对照。现在:● contract / hw+ 一个代码块,内容与nudo check签名逐字同口径(formalParamSignatureNames+formatShape同公式,解构参数名还原为源码名;throws 归 check 门禁面)。 - 面的归属:签名面只在声明名位置(函数声明 id /
const f =/ 方法键),调用 callee 保持调用点面 + intension;标识符保持单行外延。无损面(builder 模板 / absMultiline / intension)保留在nudo.hoverslash payload,仅 IDE 弹层去重。 - 验证:stdio 实测 npm-safe
decide.js——fn 名弹层 = 档线 +decide({ grade, findings }: { grade: string, findings: { ruleId: string, severity: string, veto?: boolean }[] }) => { … },与nudo check输出逐字一致;grade/ callee hover 无回归;新增 attachHover markdown 组装用例(此前弹层组装零覆盖)。
- 根因:hover 的标识符解析只有模块级 import 绑定面(bindings / collectAbsBindingsFromGraph),形参从不入绑定表;带
-
Updated dependencies [2af4016]
-
Updated dependencies [2af4016]
- @nudojs/core@1.9.4
- @nudojs/parser@1.4.13
- @nudojs/service@1.6.16
1.5.0
Minor Changes
-
04a6d1d: fix(lsp): IDE 面(hover/inlay/check 诊断)接入模块图——跨模块 import 塌缩 unknown 的假空与假红
- 根因:CLI
nudo check经buildCheckInjection把evalAbsModuleGraph模块图传给checkSource/generalizeFromAst,而 LSP 侧同族调用(hover intension、collectAbsInlays、checkToLspDiagnostics)不带图——跨模块 import 不可解析,函数体求值 fail-closed。表现:函数名 hover 显示(_p0: A1) => unknown / conf: opaque(参数无侧车种子 + 返回 unknown),Abs inlay 为空/unknown,且nudo:unproven-return假红(CLI 同文件全绿)。求值引擎本身精确(entry@/combinedAbs 无误),仅 host 装配缺口。 validation.ts新增evalAnalysisModules(filePath, source):evalAbsModuleGraph组装(abs-modules-graph 内容缓存,重复调用廉价;cycle 不注入,与 CLI hasCycle 分支同语义 fail-closed)。lsp-surface.ts函数名 hover 的generalizeFromAst补refine(fromFile/loadModule/autoBind——此前连 refine 都没传,参数丢契约种子成 A1)与modules(经SurfaceReuse.modules)。core/algebra/inlay.tsCollectAbsInlaysOpts增加modules透传给 generalize;server-ide.tshover/inlay 处理器组装并传入图。- 验证(npm-safe scanner decide.js,手写侧车 + 跨模块调用链):修复后 hover = 契约 +
{confidence: 1|0.9|0.7|0.95, grade: "F"|string, …},inlay 三函数全精确,假红诊断 0;全套 vitest 1841 通过。
feat(lsp): 观察选择器——contract 成为与各 case 并排的 ●/○ 选项 + 档线改名
● contract / hw|gen|imp- 档线改名:CodeLens / hover 首行 / inlay 档投影的
● interface / handwritten|generated|implicit统一改为● contract / hw|gen|imp(formatInterfaceTierLine单源,新增INTERFACE_SOURCE_ABBR导出)。 - contract 是观察选择器的一项,与各 case 互斥(IDE 内点 ●/○ 切换,非配置开关):
- 默认
● contract / hw|gen|imp、全部 case○——与分析器默认(无激活 case 不跑 case 种子)一致(此前 case 0 默认显示 ● 与实际观察态不符); - 点击 case(
nudo.selectCase,已有)→ 该 case●、契约转○;点击契约选项(新增nudo.selectContract,executeCommand +nudo/selectContract请求别名,位置参数[uri, fn])→ 取消激活 case(幂等); - inlay 档投影镜像激活态(
●/○ contract / …);persist/draft 动作与call@/entry@观察层不受选择影响。
- 默认
- hover 与 Abs inlay(参数约束/返回 term/pred)不参与选择器(推导面)。
- 根因:CLI
Patch Changes
-
b6495c6: fix(service): check 结果对瞬时/持久 fs 故障确定性化(#135 少集模式)
resolveModuleFile改单次 statSync(消灭 existsSync+statSync TOCTOU 双调用):ENOENT/ENOTDIR/EISDIR 按候选 miss;其余 errno(EACCES/EIO/ESTALE/EMFILE…)抛 ModuleReadError,不再被 existsSync 吞成「无此文件」。- 持久 fs 故障:侧车 ambient 绑定显式报 error 级
nudo:interface-load(带路径+errno)且 check exit 1——修复前同一故障静默丢整族契约诊断(constraint-violated/unproven-return 整体消失、无任何诊断、exit 0 假绿,且跨版本逐字节相同)。 - 瞬态故障自愈:checkSource per-call loadModule 缓存对「抛错」不缓存、下一探测重试——单次 stat 抖动不再钉死整场 miss。
LoadDepsFingerprint.readError(readerr:前缀,trunc:优先):读错误轮指纹键不可信,check 整文件 memo / generalize L0 / evaluator memo / analysisFileCacheKey / LSP 校验指纹一律 fail-closed 不读不写,杜绝错误轮与 miss 轮互为跨次陈旧命中。findProjectConfigstat 错误分类:非 ENOENT 的 package.json stat 故障 stderr 告警 + 子树 fail-closed(不静默继承/丢失 profile、env 名单),修复 severity 漂移(adoption 丢失导致 entry-may-throw error↔warning 摆动)。
-
Updated dependencies [b6495c6]
-
Updated dependencies [b6495c6]
-
Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
- @nudojs/service@1.6.15
- @nudojs/parser@1.4.12
1.4.12
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
- @nudojs/parser@1.4.11
- @nudojs/service@1.6.14
1.4.11
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
- @nudojs/parser@1.4.10
- @nudojs/service@1.6.13
1.4.10
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
- @nudojs/parser@1.4.9
- @nudojs/service@1.6.12
1.4.9
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
- @nudojs/parser@1.4.8
- @nudojs/service@1.6.11
1.4.8
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
- @nudojs/parser@1.4.7
- @nudojs/service@1.6.10
1.4.7
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
- @nudojs/parser@1.4.6
- @nudojs/service@1.6.9
1.4.6
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
- @nudojs/parser@1.4.5
- @nudojs/service@1.6.8
1.4.5
Patch Changes
- Updated dependencies [d6fa067]
- Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
- @nudojs/parser@1.4.4
- @nudojs/service@1.6.7
1.4.4
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
- @nudojs/parser@1.4.3
- @nudojs/service@1.6.6
1.4.3
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
- @nudojs/parser@1.4.2
- @nudojs/service@1.6.5
1.4.2
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
- @nudojs/parser@1.4.1
- @nudojs/service@1.6.4
1.4.1
Patch Changes
-
50e50f1: fix(core): filter 元组投影保真 + assign 拓宽补全数组 sum(OSS semver L1 FP)
filter空元组结果从unknown[](无界长度)改为[];不确定谓词对 ≤3 元组 枚举精确子序列和(长度有界——filter 不增元素),更大元组保持无界 arr(sound 旧口径)widenForAssign补全数组 sum 分支:全 tuple/arr 成员的 sum 按 tuple 分支同口径 拓宽为单 arr(可变绑定持数组后赋任意数组是合法 JS);混入 obj/prim 的 sum 仍精确对账- 复合效果:循环 push-join 绑定(
[] | [unknown])重赋map(...).filter(...)不再 假报nudo:assign-mismatch(benchmark/oss 语料 semver/bin/semver.js L109,#91 循环 pack 健全化暴露的既有失真);元素改型等真违例仍报 - lsp:补全面放行 path-conf 元组(filter 子集和臂成员的 length 是诚实字面量), sum 臂 detail 渲染去重
-
Updated dependencies [50e50f1]
-
Updated dependencies [50e50f1]
-
Updated dependencies [50e50f1]
-
Updated dependencies [50e50f1]
-
Updated dependencies [50e50f1]
-
Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
- @nudojs/service@1.6.3
- @nudojs/parser@1.4.0
1.4.0
Minor Changes
- 446914f: feat(lsp): server 端接收宿主 analysis.mode 默认值——initialize 的
initializationOptions.analysis.mode与workspace/didChangeConfiguration的settings.nudo.analysis.mode在项目 package.json#nudo.analysis.mode 未显式设置时作为默认 gate 档(项目显式值优先),变更时重检打开文档(新纳入出诊断、新排除清诊断)。VS Code 扩展侧此前声明的nudo.analysis.mode设置由此真正生效。
Patch Changes
-
39332ca: fix(core): filter 元组投影保真 + assign 拓宽补全数组 sum(OSS semver L1 FP)
filter空元组结果从unknown[](无界长度)改为[];不确定谓词对 ≤3 元组 枚举精确子序列和(长度有界——filter 不增元素),更大元组保持无界 arr(sound 旧口径)widenForAssign补全数组 sum 分支:全 tuple/arr 成员的 sum 按 tuple 分支同口径 拓宽为单 arr(可变绑定持数组后赋任意数组是合法 JS);混入 obj/prim 的 sum 仍精确对账- 复合效果:循环 push-join 绑定(
[] | [unknown])重赋map(...).filter(...)不再 假报nudo:assign-mismatch(benchmark/oss 语料 semver/bin/semver.js L109,#91 循环 pack 健全化暴露的既有失真);元素改型等真违例仍报 - lsp:补全面放行 path-conf 元组(filter 子集和臂成员的 length 是诚实字面量), sum 臂 detail 渲染去重
-
446914f: fix(lsp): 高频 IDE 入口零缓存与会话 Map 无界增长修复。hover / completion / signatureHelp 现先过
getCachedOrAnalyze(同一未变文件连续触发只跑一次全量分析),lsp-surface 复用传入的result.bindings+ 条目 AST(cachedAstFor,随条目同指纹失效)——不再每次 transpile + new Function 整文件求值,getHoverAtPosition内部重复 parse(自身一次 +file ?? parse(source)兜底)删除。Abs-check 主通道诊断挂进 analysisCache 条目(getCachedCheckDiags;source/deps/cfg 指纹同键,与 evaluator 诊断同口径失效),push 防抖与 pull 诊断不再每次全量 checkSource + extractDirectives。depsFingerprint从「只 hash 自身侧车」改走 coreloadModuleDepsFingerprint(覆盖@nudo:import全部 .nudo.js / require / 动态 import / 侧车闭包)——被 import 侧车内容变更(无 watcher 事件)不再命中陈旧缓存;截断走 fail-visible 唯一指纹。analysisCache / knownFiles / nudoDepParents 套与 servicegetSessionCacheLimits同源的 LRU 上限(maxFiles / 4×maxFiles,0 = 关闭该层)。IDE 处理器(hover/completion/codeLens/inlayHint/semanticTokens/signatureHelp)catch 不再静默——统一connection.console.error留痕,返回语义不变。signatureHelp 的findEnclosingCall手写递归 visitor 改 @babel/traverse:区间判定含列(旧实现只比行号),参数下标按完整区间计算(跨行参数不再被「start 在前 → +1」误判,尾逗号 → arity)。 -
Updated dependencies [446914f]
-
Updated dependencies [446914f]
-
Updated dependencies [a00bccc]
-
Updated dependencies [446914f]
-
Updated dependencies [39332ca]
-
Updated dependencies [446914f]
-
Updated dependencies [446914f]
-
Updated dependencies [446914f]
-
Updated dependencies [89358f2]
-
Updated dependencies [89358f2]
-
Updated dependencies [89358f2]
-
Updated dependencies [446914f]
- @nudojs/core@1.7.2
- @nudojs/service@1.6.2
- @nudojs/parser@2.0.0
1.3.2
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
- @nudojs/parser@1.3.2
- @nudojs/service@1.6.1
1.3.1
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
- @nudojs/service@1.6.0
- @nudojs/parser@1.3.1
1.3.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
- @nudojs/service@1.5.0
- @nudojs/parser@1.3.0
1.2.0
Minor Changes
-
64ca356: feat: clamp bounds + scalar-over-sum + action-map quickfixes (#68 #69)
#68 inference
Math.min/Math.max/Math.round(and floor/ceil/trunc) propagate operand numeric bounds:max(0, min(100, n))derives[0, 100].- NaN is explicit (option 1): a possibly-NaN operand yields
NaN | number@bounds, so clamp contracts stay honest;if (Number.isNaN(n)) return …narrows the false arm (ne(n, NaN)) and the guarded clamp is provable. - Scalar return contracts now distribute over sum arms like shape/array
(
nullable(c)+ multi-returnnull | numberis provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings tounproven-returnwarnings instead of errors.
#69 DX
actionsForIssuekinds are materialized as LSP quickfixes with[fix]/[silence]/[review]/[adjust]/[scaffold]titles.nudo check --fix [--only <code>] [--write]reuses the same edit layer (default dry-run prints unified diffs).- Body-read fields auto-fill types from usage (
node.type === "x"→string(), arith →number(), no evidence →any()); never emit emptyshape({}). - L2
entry-may-throwsuggestions include a copyable sidecar clause.
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
- @nudojs/service@1.4.0
- @nudojs/parser@1.2.1
1.1.10
Patch Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
-
Updated dependencies [f10066d]
- @nudojs/core@1.4.0
- @nudojs/parser@1.2.0
- @nudojs/service@1.3.0
1.1.9
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
- @nudojs/parser@1.1.9
- @nudojs/service@1.2.4
1.1.8
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
- @nudojs/parser@1.1.8
- @nudojs/service@1.2.3
1.1.7
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
- @nudojs/parser@1.1.7
- @nudojs/service@1.2.2
1.1.6
Patch Changes
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/core@1.2.1
- @nudojs/service@1.2.1
- @nudojs/parser@1.1.6
1.1.5
Patch Changes
-
5ff4202: refactor!: rename B-path / BPath engine identifiers to eval / evaluator
The AST-walk interpreter is long gone, so the dual-engine campaign name "B-path" no longer means anything and forced a glossary entry just to explain itself. The single production evaluation engine is now simply the evaluator (mechanism: transpile →
new Functionon Abs).Renamed B-path engine to evaluator/eval — see the @nudojs/core table above.
-
Updated dependencies [5ff4202]
-
Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
- @nudojs/service@1.2.0
- @nudojs/parser@1.1.5
1.1.4
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
- @nudojs/parser@1.1.4
- @nudojs/service@1.1.4
1.1.3
Patch Changes
- Updated dependencies [3bf9997]
- Updated dependencies [43fb345]
- @nudojs/core@1.1.3
- @nudojs/parser@1.1.3
- @nudojs/service@1.1.3
1.1.2
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
- @nudojs/parser@1.1.2
- @nudojs/service@1.1.2
1.1.1
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
- @nudojs/parser@1.1.1
- @nudojs/service@1.1.1
2.0.0-beta.1
Major Changes
-
4305674: Split the
@nudojs/servicegod package: harvest →@nudojs/harvester, IDE surface →@nudojs/lsp, emit products consolidated under@nudojs/service/emit.BREAKING for
@nudojs/servicesubpath consumers:Removed subpath Migrate to @nudojs/service/interface@nudojs/service/emit@nudojs/service/dts@nudojs/service/emit@nudojs/service/case@nudojs/service/emit@nudojs/service/lsp@nudojs/lsp(library entry — no server side effects)@nudojs/service/harvest@nudojs/harvester@nudojs/servicekeeps.,./analysis,./evaluator,./emit. The language server moves to@nudojs/lsp/server(binnudo-lspunchanged);@nudojs/lspis now a side-effect-free library entry re-exporting the IDE surface.No dependency cycles:
lsp → service,harvesterstays independent ofservice. Emit is a service subpath (same package). Public function signatures and diagnostic codes are unchanged.
Patch Changes
- Updated dependencies [4305674]
- @nudojs/service@5.0.0-beta.1
2.0.0-beta.0
Major Changes
-
22baf33: feat!: product CLI face only — remove deprecated verbs/aliases; L2 entry may-throw
- BREAKING — deleted with no compatibility layer: verbs
infer/types/interface/refine/generate/emit/guard/doctor/ top-levelwatch/harvest; flags--callsites,--output,--format zod,--dts,--emit-cases; APIabsToZodSchema;InferJson/serializeInferJson→CaseJson/serializeCaseJson; LSP agent toolsnudo.infer/nudo.interface*and aliases →nudo.test/nudo.contract*; config keypackage.json#nudo.interface.*→package.json#nudo.contract.*. Root scriptsinfer/types/interfaceremoved. - Primary verbs:
check/test/contract/export/health/env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell@nudojs/nudojsfollows@nudojs/climajors. - L2: undigested may-throw on entry/export functions is
nudo:entry-may-throw(default error). Configure with--ignore-throws/--entry-throwsorpackage.json#nudo.check.{ignoreThrows,entryThrows}. - Nested try: soft may-throw from an inner try re-homes to the enclosing try frame. Catch rethrow does not digest soft effects.
checkalways prints signatures on success; unconstrained entry params display asany(trueunknown= inference failure +nudo:unknown-inference).testprints every case including syntheticcall@/entry@; only declared@nudo:caseexpectations affect exit.--freeze[=update]solidifies witnesses.- Flags:
--from,export --format dts|guard|schema|standard|all(--dialect zodfor schema),export --out.--jsoncannot combine with--abs. - Design docs consolidated: truth sources
design-kernel-merge.md+design-cli-semantics.md; domain designs compressed to status summaries. - Breaking for CI scripts that still call old verbs or read old config keys.
- BREAKING — deleted with no compatibility layer: verbs
-
0e1432a: feat!: source contract directive is
@nudo:contractonly@nudo:refineand@nudo:interfaceare deleted with no alias layer. The product word is contract end to end (sidecar*.nudo.js,@nudo:contract,nudo contract,package.json#nudo.contract.*).- BREAKING: replace every
@nudo:refine/@nudo:interfacewith@nudo:contract(including@nudo:contract return <constraint>). Grammar is unchanged:@nudo:contract <param> <constraint>. - Constraints still enter Abs as Preds and participate in algebra (
x>0⇒x+1>1) — this is not a call-site validation gate. - Diagnostic codes
nudo:interface-*are unchanged in this release. - Chinese product copy uses 契约, not 精化.
- BREAKING: replace every
Minor Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
-
5a5e167: feat(export)+review P0–P2: dialect-aware schema export, Standard Schema path, CLI/LSP honesty fixes.
Service / schema:
absToSchemaSource/projectAbsToSchema/absToSchemaNode— SchemaNode carries refinements anddroppednotes.- Projection prefers core
absToConstraint(parity foreq(self,lit)→z.literal, or-literal unions, int/bounds/string length). - Schema projection API:
absToSchemaSource/projectAbsToSchema(zod via{ dialect: "zod" }). - New
absToStandardSchemaModule/validateSchemaNode— Standard Schema v1 modules (~standard, vendornudo).
CLI:
nudo export --format schema [--dialect zod]→*.nudo.schema.<dialect>.tsnudo export --format standard→<fn>.nudo.standard.ts(contract-first domains; joinAbs when no contract)test --jsonstdout is one JSON document (cases only);check --jsonstays a separate command--ignore-throwsnow merges withpackage.json#nudo.check.ignoreThrows(additive)
LSP:
- Gate codes (
nudo:entry-may-throwetc.) keep Error and Warning underanalysis.diagnostics=off|errorsso IDE matches CLI whenentryThrows=warning
Docs/product copy:
- Day1 sidecar example uses
fn({ params }, returns?)(not barenumber().gt(0)on a function export) - Help / generated markers use
schema/standardandnudo contract --emit
Patch Changes
- Updated dependencies [22baf33]
- Updated dependencies [0e1432a]
- Updated dependencies [3c3f9d2]
- Updated dependencies
- Updated dependencies [279d73a]
- Updated dependencies [5a5e167]
- @nudojs/core@3.0.0-beta.0
- @nudojs/service@5.0.0-beta.0
- @nudojs/parser@1.1.0-beta.0
1.0.0
Major Changes
-
69ebbf6: Align product surface with interface-first design:
@nudo:caseis debug /nudo testonly, and theT.*directive grammar is removed.- Directive type expressions accept constraint builders (
number(),lit(),shape(),union(),array(),any(), …) and concrete literals only. BareT.*parses as unknown;parseTypeValueExpris no longer exported — useparseCaseArgExpr. serializeCaseArg/--emit-casesemit builders (number(),union(…)) instead ofT.*.- LSP
typeExprToDirectiveemits builders (number(),union(…),any()). - CLI
inferreports call-site facts (call@L…) anddebug "name"witnesses withObserved:joins — notCase "…"/Combined:as the type product. Contracts stay on*.nudo.js/@nudo:refine. - Constraint builders accept concrete nested literals so directive grammar round-trips.
- Directive type expressions accept constraint builders (
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/parser@1.0.0
- @nudojs/service@4.0.0
- @nudojs/core@2.1.0
0.8.1
Patch Changes
-
9731238: BREAKING (behavior)
@nudojs/service: handwritten@nudojs/envnow wins over harvest / module-graph modules on overlapping module keys and export names (mergeHarvestUnderEnv). This is the documented B8 priority — harvest only fills missing slots — but analysis results on projects that relied on harvest overwriting a handwritten env export will change.Migration: remove or update the conflicting handwritten
@nudojs/envslot if you needed harvest's version; otherwise no code change. Conflicts emit anudo:env-harvest-conflictwarning listing overwritten module/export names.Also in this service major (additive public surface, riding the required major for the priority change):
- Public harvest helpers:
mergeHarvestUnderEnv(optional per-callonConflict),setEnvHarvestConflictCollector(returns previous; save/restore for nested analysis),getEnvHarvestConflictCollector,clearNodeHarvestCache,getNodeHarvestCacheSize,isHarvestNodeDisabled,HARVEST_NODE_DEFAULT_*. Negative harvest outcomes (not-found/no-dts/failed) are cached in-process;NUDO_HARVEST_NODE=offstays explicit and uncached.clearNodeHarvestCache()also dropsnot-foundmisses so a later@types/nodeinstall is visible in-process.nudo:env-harvest-conflictwarnings point at the conflicting import specifier when found (file-levelline 0otherwise). @nudojs/env(minor):events/stream/querystring; high-frequencyutilslots; Promise APIs only underfs.promises/node:fs/promises(callback-stylefs.readFileetc. no longer pretend to return Promise). Optional Node params (path.basenameext,url.URLbase) keep typed labels (ext?: string) but are not required slots —requiredFnArityskips?/....@nudojs/core(patch):formatShaperenders fn rest labels (...paths) and optional labels (options?) as...name: T/name?: T.leqAbsfn arity uses required slots only (requiredFnArityskips...rest/name?): src is assignable to tgt iffsrc.required ≤ tgt.required(TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). PairwiseparamTypescontravariance is unchanged.@nudojs/lsp(patch): freeze inventory inpublic-api.ts(also exported as@nudojs/lsp/public-api); agent slash requests register fromNUDO_AGENT_TOOL_NAMES;selectCase/getActiveCasesare editor executeCommand + slash-only (not dot-form custom requests).
Migration for env consumers who need bit-stable hover/format strings: pin
@nudojs/env~0.3.0after the next release, and prefer leaf-clean coverage counts (empty{ }shapes are not leaf-clean) over raw resolved ratios. - Public harvest helpers:
-
Updated dependencies [9731238]
- @nudojs/core@2.0.1
- @nudojs/service@3.0.0
- @nudojs/parser@0.5.1
0.8.0
Minor Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
- @nudojs/service@2.0.0
- @nudojs/parser@0.5.0
0.7.1
Patch Changes
- Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
- @nudojs/parser@0.4.2
- @nudojs/service@1.0.1
0.7.0
Minor Changes
-
0f0b7d5: Feature: Interface 分层推导 Phase 1(design-refine-derivation.md)
- 侧车同名自动绑定:
foo.nudo.js导出绑定foo.js本地 named export;手写 >@generated> 隐式合并序 - 约束代数:
lit/union/fn/shift/and/partial/pick/omit - Abs→ 契约投影与字面量域隶属(domain-membership)
- 新诊断:
nudo:interface-drift/interface-domain-exceeds/interface-conflict/interface-cycle/interface-load/interface-name-clash - CLI:
nudo interface(别名refine)分层打印;--emit/--fn/--all/--dry-run/--exit-on-diff/--callsites;nudo check --callsites - 配置:
package.json#nudo.interface.autoBind(默认 true;node_modules 永不 ambient 加载) - LSP:CodeLens interface 默认层 + persist/update;agent 工具
nudo.interface/nudo.interface.emit(emit 路径限制在项目根内) - 新薄壳包
nudo(bin委托@nudojs/cli)
- 侧车同名自动绑定:
Patch Changes
-
a2aac9e: Final review pass on feat/interface Phase 1:
- LSP emit bound live:
handleInterfaceEmitnow passesagentToolDepssoworkspaceRootsreachassertEmitTargetAllowed(was dead in production). - Emit fail-closed: empty
workspaceRootsrejects; no ancestor-package.jsonauthorization fallback;realpathblocks symlink escape; refuse writes undernode_modules. - autoBind kill-switch complete: threaded through scan
generalizeFromAst/ same-fileeiOpts; emptyfromFileno longer ambient-binds.nudo.js. - Conflict skip: conflicted params no longer also emit call-site
constraint-violated; detect eq/eq and eq/bound unsat. - Return contracts: string length bounds (
string().min/max) enforced via domain membership. - Perf/stability: file-local
effectiveInterfacememo in check;take*Sinceon memo hit/miss (no LSP diag theft);shiftrejects non-finite offsets;@generatedmarker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
- LSP emit bound live:
-
de47d84: Review fixes on feat/interface Phase 1:
- autoBind kill-switch: analyzer's cross-file
nudo:interface-domain-exceedspath now readspackage.json#nudo.interface.autoBind(was silently ambient-loading sidecars whenautoBind: false). nudo check --callsites: inject usage-site call records so CI gate can surfacenudo:interface-domain-exceeds(previously only reachable via analyze/interface paths).- Sidecar auto-bind coverage:
localNamedExportsaccepts localexport { x }/export { local as exported }list form (was declaration-only; silent miss for common style). - Directory targets:
isNudoTargetPathexcludes*.nudo.js/*.nudo.tsso check/infer/doctor no longer treat contract modules as source. - VS Code client: documentSelector includes TypeScript; file watcher covers
**/*.{js,mjs,ts}(includes.nudo.tssidecars). - LSP emit: failed
interfaceEmitno longer claims "sidecar written" and skips the invalidation path. - UX: first
--emitwith empty default targets prints a--fn/--alltip;--fn/--allwithout--emitwarn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
- autoBind kill-switch: analyzer's cross-file
-
78f6752: Fix hover, case switching, and NaN folding in Zed-style clients.
const n = double(21)reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.- Relational compare folds mixed concrete lits (
"a" > 3→ false), soif (x > 3)does not join both branches for NaN inputs. joinValuesusesObject.issojoin(NaN, NaN)staysNaN(NaN === NaNis false).workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]).- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes. - Param inlay no longer invents
where x > 3fromif (x > 3) return x— only explicit@nudo:refinecontracts show as preconditions. - Return inlay is a path summary with source param names:
x + 1,x | x * 2(not the refinednumber where x>3 | string | …dump). - Number range narrowing uses exclusive bounds (
> 3, not integer-style>= 4). - Concrete
iftests no longer narrow the tested value into a range (44 > 3keepsxas44). - True branch of
x > kon unknown refines tonumber>… | string(JS ToNumber space). flattenSumkeys prim members by term/pred sonumber=A1>3andnumber=A1*2stay distinct paths.
-
Updated dependencies [0fd253f]
-
Updated dependencies [a2aac9e]
-
Updated dependencies [0f0b7d5]
-
Updated dependencies [de47d84]
-
Updated dependencies [78f6752]
- @nudojs/core@1.0.0
- @nudojs/service@1.0.0
- @nudojs/parser@0.4.1
0.6.0
Minor Changes
- 1d6bb01: - dist 产物自包含(同 cli:@nudojs/* 源码进 bundle、splitting:false、banner 补齐)
- 自定义请求别名同时注册
nudo/<tool>与nudo.<tool>两种拼写(后者与 executeCommand 命令名一致,供 MCP 桥接客户端复用) - 跨文件 definition:本地声明与 import 绑定都未命中时,新增工作区导出回退扫描(同名导出定义,≤200 文件 + 会话已知文件),修复解构注入参数(
computeScorecard({…})形参)无法跳转的问题;rename 刻意不接此回退(重命名必须绑定真实绑定点) - 附带回归测试:export 形式 refine、跨文件定义回退、早返回折叠
- 自定义请求别名同时注册
Patch Changes
-
1d233a7: Fix hover and CodeLens case switching in Zed-style clients, and fold JS ToNumber for
- * / %.const n = double(21)now reports the init Abs (42) instead of the statement'sunknown(record the declarator id inevalVarDecl).const s = double("a")isNaN(JS"a" * 2), notunknown— concrete string/boolean lits coerce under ToNumber;formatAbsprintsNaN/Infinityinstead ofnull.workspace/executeCommandaccepts positionalnudo.selectCaseargs from CodeLens ([uri, fn, index, name]), not only the agent object form.- Hover inside
@nudo:casefunctions goes through TypeValue +activeCasesinstead of call-site B-path nodes, so selecting a case actually changes the shown types.
-
Updated dependencies [1d6bb01]
-
Updated dependencies [1d6bb01]
-
Updated dependencies [1d233a7]
- @nudojs/core@0.4.0
- @nudojs/parser@0.4.0
- @nudojs/service@0.3.2
0.5.0
Minor Changes
- 4a43e10: Add a
nudo-lspbin (shebang ondist/server.js) and default to stdio when the host did not pass a transport flag (--stdio/--node-ipc/--socket=). Editors and agent bridges can launch the server as a bare command (nudo-lsp,node dist/server.js) instead oftsx+src/server.ts. The Zed extension uses this path.
0.4.1
Patch Changes
- 34b246c: Implement textDocument/documentSymbol and workspace/symbol; make definition, references, and rename follow relative imports across files so go-to-definition on an imported symbol lands in the defining module and rename/references include importer call sites.
- bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
- @nudojs/service@0.3.1
- @nudojs/parser@0.3.1
0.4.0
Minor Changes
-
5786fa5: Promote the B-path (transpile + in-process Abs runtime) to the primary evaluation path for capable sources.
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
export *, require, cycle/depth/missing guards, and env modules (path/node:pathetc.). - Diagnostics,
@nudo:env/ mock injection,call@/entry@provenance, method-missing, unknown-recv, generators, classes, async/await, optional chaining, and destructuring run through B. - When B hosts a file,
evaluateProgramis skipped so TypeValue no longer double-reports. - CLI
check/types/testaccept directories; check uses an Abs-only gate. - LSP hover /
getTypeAtPositionon capable files read the Abs node table;*.nudo.jsedits evict L0 and recheck open parents. - Public core surface now re-exports the algebra API (
Abs, check, generalize, exec, bridge,parseSource,stripTypes).
- Module graph now supports relative imports, bare-package harvest, default/namespace imports, re-exports,
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
- @nudojs/service@0.3.0
- @nudojs/parser@0.3.0
0.3.0
Minor Changes
-
0fd0718: Merge the three environment packages into one:
@nudojs/env-es,@nudojs/env-web,@nudojs/env-nodeare replaced by a single@nudojs/envpackage with subpath exports@nudojs/env/es,@nudojs/env/web,@nudojs/env/node.Move agent-facing tools from the standalone MCP server into the language server:
@nudojs/mcpis removed.@nudojs/lspnow exposesnudo.whatIf,nudo.suggestCase,nudo.trace,nudo.selectCase, andnudo.getActiveCasesviaworkspace/executeCommand(custom-request aliasesnudo/whatIfetc. included), adds pull-mode diagnostics, and works on files that are not open in the editor (disk fallback).nudo.whatIfnow actually applies the given type bindings — previously they were ignored. AI agents connect through any LSP↔MCP bridge (cclsp, mcpls, agent-lsp) or a native LSP client; an installable agent skill ships atpackages/lsp/agent-skill/SKILL.md.
Patch Changes
- @nudojs/service@0.2.1
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version
Patch Changes
- Updated dependencies [6c38283]
- Updated dependencies [9f7f819]
- Updated dependencies [c175f71]
- @nudojs/core@0.2.0
- @nudojs/service@0.2.0
0.1.0
Minor Changes
- Conceptual design and basic implementation.
Patch Changes
- Updated dependencies
- @nudojs/core@0.1.0
- @nudojs/service@0.1.0
@nudojs/env 0.5.11
0.5.11
Patch Changes
- Updated dependencies [795e322]
- Updated dependencies [161d156]
- @nudojs/core@1.20.1
Version history (61)
0.5.10
Patch Changes
-
aff6b7c: Add
number().finite()and sound relation-complement narrowing.number()includesNaNand±Infinity, so a sequential guard such asif (x < 1) return 0; return x + y;cannot assumex >= 1on the fall-through path (NaN < 1is false).number().finite()adds the missing non-NaN evidence; when it (or any numeric bound) is present, the evaluator refines the fall-through / else arm with the complement of the relation guard at runtime ($refineRelComplement, fail-closed without evidence; the arm's Phi and$refineNotNaNalso count as evidence). NaN guards (Number.isNaN(x),x !== x,x === x,!Number.isNaN(x)) establishne(x, NaN)on the arm where that holds;Number.isFinite(x)is one-sided (true arm only). Aconst/let/varalias such asconst ok = Number.isNaN(x); if (!ok) { … }is resolved in the same function body or at module top level (a written alias name or guarded variable, loop-header shadowing/assignment, catch parameters and function boundaries drop the alias). A user-shadowedNumberdisables the builtin guard fact (fail-closed). De Morgan spellings (x < 1 || y < 2) are complemented per disjunct. The previous unproven results for barenumber()are unchanged.Literal
NaN/±Infinityarguments (including0/0,Number.NaN,Number.POSITIVE_INFINITY) now violate afiniteprecondition instead of passing silently;NaNand±Infinityglobals are modeled as literals.兼容性:新增 builder 方法与非 NaN 证据下的精度收紧;未使用
.finite()的 既有契约输出逐字节不变。 -
Updated dependencies [c93a32d]
-
Updated dependencies [190761e]
-
Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
0.5.9
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
0.5.8
Patch Changes
-
5267658: Fix: architecture debt A3+A4 — the declared throws face now survives the relation face (no apply) and the construct paths (
new X()/ bind products).- A3 (relation throws channel):
relationFngains an optionalthrowscarrier (impl.relation.throws— same representation asAbsApplyResult.throws,never/absent = no throw; not written into the fn shape, which has no throws consumer). The$callrelation arm routes it through the singlerouteApplyThrowsentry (may-throw →pushThrowExitinto the caller frame;returnType = never+ throws →NudoThrow). env declarations whose host throws but which declare no apply no longer read as "never throws" (false green) —envFn's no-apply branch passesopts.throwsthrough (opt-in; no existing declaration changes behavior). - A4 (construct paths dropped the apply throws slot): the two bare-unpack sites —
$new'simpl.applybranch (exec/class/construct.ts) and the bind-product[[Construct]]facet (exec/class/invoke.ts) — now route throughrouteApplyThrowsinstead of peeling.abs, so constructor-declared throws take effect onnew X()too (previously call-face only). Under@nudo:env node,new URL(<invalid or abstract>)now records may-throwTypeErrorinstead of silently succeeding; definite always-throw constructor applies surface asNudoThrowat the construct point. A source gate forbids reintroducingisAbsApplyResult(x) ? x.abs : xpeeling in the class dispatch layer. - Regression pins:
abs-apply-throws-channel.test.ts(A3/A4 sections + cross-module gold + source gate),env-bug-s0-mechanism.test.ts(A3 env-face section incl. ctor-shape relation), and the former false-green pinenv-bug-642.4 rewritten as a positive assertion.
- A3 (relation throws channel):
-
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
0.5.7
Patch Changes
-
01a550b: Dedup batch 6 (same-file fragment twins from the jscpd
--min-tokens 70audit; batch 5 closed the cross-file sync obligations and whole-function twins). Pure refactor — outputs byte-identical (vitest --changed green, verify:examples 251 checks, lint + lint:tests clean, defineEnv deep structural dump parity vs HEAD for the env change).- transpile
expr/optional-chain.ts:invoke/invokeKeyhop arms share the emission tail (contOf IIFE wrap, fnOptional double fork with Bug 187 whole-chain short-circuit + BUG-216 single-Get preRead, recvOptional short-circuit, bare tail) — extractedemitInvokeTail; the two arms now only definecallOf($invokevs$invokeKey) and the method-value read ($getvs$idx). Emitted code text unchanged. algebra/term.ts:surviveMulOne/surviveSubZeroverbatim-twin closures → sharedtoNumberDomainTerm(Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).algebra/check.ts: assume / invariant segment processing sharesanchorSurfaceOf(#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) sharepushEntryMayThrowIssue— only theactualline differs.- transpile
stmt/statement.ts: for-loop fallback path and init-declaration path share the body-prep block (forBodyPrep: body local decls → body opts with alias filtering → body statements → loop-carried assignment names); paths inject constScope shadowing and the initName exclusion. Emitted code text unchanged. builtins/json.ts: tuple and arrayView branches of the stringify walker sharemapElements(index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).builtins/object/methods.ts:Object.keys/Object.entriesstring- literal receiver arms sharestringIndexTupleAbs(code-unit indexing, exact conf; element construction injected).algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk sharewalkChildren.arithmetic/muldiv.ts:div/modshare the numeric leading (divModLead: builtin-brand ToPrimitive re-entry, Symbol TypeError, bigint fold + abstract-bigint domain with 0n RangeError per Bug 106); 0-divisor semantics after the leading remain per-op.env/src/node.ts: the three verbatim MessagePort slot tables (MessageChannel.port1 / port2 / standalone MessagePort brand) single- sourced asmessagePortSlots(same cross-brand sharing pattern as the existingstreamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.lsp/src/symbols.ts:FunctionDeclaration/FunctionExpressionvisitor bodies merged into a single"FunctionDeclaration|FunctionExpression"visitor key (babel traverse alias syntax), bodies were verbatim twins.
- transpile
-
fd0fb09: Dedup batch 7 (jscpd
--min-tokens 70re-audit after batch 6: residual same-file fragment twins + one drifted manual-sync pair). Pure refactor — defineEnv deep structural dump (sorted + insertion-order preserving) byte-identical vs HEAD, verify:examples 251 checks green, lint + lint:tests clean.- env
node.ts: Storage slot table ×3 (ctor brand + localStorage + sessionStorage) → singlestorageObjconst (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → sharedexecSyncOptions; Request / Response body-mixin slots (clone/arrayBuffer/blob/formData/json/text, clone returns the respective brand) →bodyMixinSlots(self)factory; EventEmitter core on/once/off/emit →emitterCoreSlotsshared by the EventEmitter brand and theprocessglobal object. - env
node.tspath family — the drifted manual-sync pair: the top-levelpathModuleinlined the whole member table next to theplatformPathMethods(posix/win32)factory and had already drifted (join.requiredonly on the top-level copy).pathModulenow consumes the factory; member order canonicalized to the top-level key order;join's required-arity enforcement is now identical across path/posix/win32 (Bug 877 case 6's claimed parity now real). - env
web.ts: URL.searchParamsslot table and the global URLSearchParams constructor sharesearchParamsCoreSlots(toString / iterator face / size stay per-site; insertion order preserved). - core
builtins/error/binary.ts: DataView ctor andmakeTypedArrayFromBuffersharebufferByteLengthLiteral(brand→inner obj→byteLength slot fold);TypedArray.of's inlined copy of the number-domain item enforcement now callsenforceTaItem(the.ofcause variant is unified into the shared text — no pins). - core
builtins/object/methods.ts:getOwnPropertySymbolsobj arm and brand-inner arm share theownSymbolsTupletail (open/index → undefined, closed → counted tuple). - core
exec/transpile/helpers.ts: the MemberExpression root-identifier walk (assignment / update / stateful-call faces, ×3) →markFreeMemberRoot. - core
scan-call-graph.ts: dynamic-import and require ObjectPattern destructure binding loops →bindPatternImports; top-level class scans (findClassDecl+ module-frame class bindings) shareunwrapExportDecl. - harvester
harvest-dts.ts:resolveIfaceDeclsinner-first relative namespace resolution loop (qualified arm + short-name arm) →addRelativeNsHit;absExtends' twoes.k === "sum"member folds →foldSumFlags(thecs.k === "sum"fold is intentionally different and untouched). - service
analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) shareactualSlotTable(obj direct / brand inner-obj unwrap). - lsp
server-navigation.ts:onDefinitionnow uses the sharednavigationIdentAtpreamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept. - lsp
agent-tools.ts:suggestCase/traceshare theanalyzeToolFilepreamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
- env
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
0.5.6
Patch Changes
-
afd7c36: Fix bug-report category 15 (node / web host environment modeling) — 12 defects.
- BUG-125:
crypto.getRandomValues(and thecrypto.webcrypto/Crypto/ globalcryptofaces) now accept the integer TypedArray domain and reject plain Arrays, float views and primitives with a definiteTypeErrorinstead of returningunknown. - BUG-148: host objects that model slots as
unknown(webResponse.body,Headers.getSetCookie,document.location; nodeEvent/CustomEvent/Request) now carry their real slot types. - BUG-149:
performance.mark/performance.measurereturnPerformanceMark/PerformanceMeasurebrands instead of throwing. - BUG-150:
crypto.subtlecall sites widen the rejection reason toOperationError ∪ TypeError(the static reason staysOperationError). - BUG-153: 13 undeclared browser globals are now modeled (
FormData,Blob,BroadcastChannel,DisposableStack,AsyncDisposableStack,PerformanceMark,PerformanceObserver,ReadableStream,ReadableStreamBYOBReader,ReadableStreamDefaultReader,URLPattern,WritableStream,WritableStreamDefaultWriter). - BUG-154:
keys/values/entriesof the iterable families (nodeHeaders/FormData; webHeaders/FormData/URLSearchParams) are modeled as total iterators instead of degrading tounknown. - BUG-155:
AbortSignal.anyis function-valued, and the 10WebAssembly.*/Temporal.*members are modeled as constructors. - BUG-161: the web constructor instance faces keep their brand (12 faces), so
instanceofmatches the runtime instead of reportingObject/false. - BUG-193:
Buffer's static table no longer carries members the host does not have, and thenode:buffermodule face is modeled. - BUG-255:
path.posix/path.win32exposeparse/formatfrom one shared source of truth withpath. - BUG-256:
process.titleis a string slot (it previously folded toundefined). - BUG-257:
util.typesmodels all 43 host predicates (35 were missing).
Regression tests:
env-bug-125-*…env-bug-257-*(12 files).追加:
env-bug-64负控重钉(依据 BUG-160)env-bug-64的负控钉的是「删掉 env 声明、回落宿主 ⇒TextEncoder.encoding退成undefined(确定的错值)」,其前提是宿主路没有实例面建模。BUG-160 要求的正确行为是TextEncoder实例面 =encoding(只读访问器,恒"utf-8")+encode/encodeInto,且 成员读不得折undefined⇒ 负控改为断言宿主路真值'"utf-8"'(宿主实测同值);env 声明 面仍是放宽的string,上一行断言未动。 - BUG-125:
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [0650ef0]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
- @nudojs/core@1.17.2
0.5.5
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
0.5.4
Patch Changes
- f1d4958: Update env source comments: the env-skip list is now the derived
getEnvShadowSkipGlobals(namespace identity routing + host intrinsic names) rather than the oldENV_SHADOW_SKIP_GLOBALSconstant. Comment-only; no runtime behaviour change. - Updated dependencies [0438f10]
- Updated dependencies [6ebf5a4]
- @nudojs/core@1.17.0
0.5.3
Patch Changes
-
e3b8791: Reading a member of a built-in prototype, a branded value or a namespace now returns what JavaScript returns instead of a confident
undefined.- A built-in prototype object had no table for its own members, so
Map.prototype[Symbol.toStringTag]returnedundefinedinstead of"Map",RegExp.prototype.flagsreturnedundefinedinstead of""andError.prototype.namereturnedundefinedinstead of"Error". The prototype objects of the built-ins now carry their own symbol members, their own data properties and their own methods. - A value of a built-in brand whose class was derived from a built-in — an
instance of
class M extends Set— lost the whole built-in prototype face:s.addreturnedundefinedeven though"add" in ssaidtrue. The two answers contradicted each other. The prototype chain is now resolved to the first built-in owner, and a member defined by the derived class still wins. Object.prototype.toString.call(Math)reported[object Math]butMath[Symbol.toStringTag]returnedundefined. A namespace object now exposes itsSymbol.toStringTag.Symbol.prototype.descriptionreturned the string"undefined"and did not record a throw; it now throws aTypeError, like the specification says.Map.prototype.sizeandSet.prototype.sizereturned"undefined"and did not record a throw; they now throw aTypeError.Intl.NumberFormat.prototype.formatreturnedundefinedand did not record a throw; reading a brand-check accessor of anIntlprototype now throws aTypeError.- A member that does not exist on a
number,booleanorbigintprimitive folded tounknown, which made every later read of that value look harmless. It now folds toundefined, so the later read is still recognised as a possibleTypeError. Symbol()instances resolvedtoStringandtoLocaleStringto the matching members ofObject.prototype, losing the brand check. The brand check is now performed.- The
constructorof a class value resolved to a built-in constructor named after the class, soWidget.constructor === Functionwasfalse. It is nowtrue. - A getter-only static accessor accepted a write; it now throws a
TypeErrorin strict mode, like the instance-level accessors already did. - The
prototypeproperty of a class value was missing its "not writable" flag, soA.prototype = {}silently wrote through. It is now rejected with aTypeError. process.envandprocess.versionswere shown asRecord<string, string | undefined>but readingprocess.env.HOMEreturnedunknown, and the difference was reported as a failed inference. The read now uses the declared index domain.- A host or namespace object such as
Mathonly projected its enumerable own properties, soObject.getOwnPropertyNames(Math)returned0andMath.PIcould not be read at all, even though the object was marked as exactly known. All own properties are projected now, and the descriptor flags are recorded, so the enumerable face still matches the original.
- A built-in prototype object had no table for its own members, so
-
a1c093f: 族 62(片 W12):env 的 ES / Web 内建构造器声明面精度 —— 5 条台账里 1 条 env 侧真修、3 条由同批 core 收口、1 条复核后为非缺陷。
真修 · 第 5 条(Bug 890 精度):env promise 的拒绝 reason 逐声明可见。
promiseOf(inner)加可选拒绝 reason(缺省仍是unknown⇒ 其余声明逐字不变), 逐声明给出规范规定的 reason:fetch⇒TypeError(网络错 / 非法 URL)∪AbortError(信号 abort 的默认 reason);Request/Response的 body 读取族(json/text/arrayBuffer/blob/formData)⇒TypeError(WHATWG Fetch「consume body」:流出错 / JSON 解析失败);crypto.subtle.*(digest/encrypt/decrypt/sign/verify/generateKey/deriveKey/deriveBits/wrapKey/unwrapKey/exportKey)⇒OperationErrorDOMException(WebCrypto 规范);navigator.clipboard.readText/writeText⇒NotAllowedErrorDOMException(Clipboard 规范);Promise.reject(reason)(声明面)⇒ 拒绝 reason 就是实参(ES 规范)。
效果:
catch (e)的形参不再恒为unknown⇒e.name/e.message可解 (此前e.message折出 unknown ⇒ 拿不到)。声明面 · 第 1 条(Bug 332):Intl 子构造器的实例方法面。
Intl.Collator/Intl.NumberFormat/Intl.DateTimeFormat的实例面 补上原生原型成员(compare/format/formatToParts/formatRange/formatRangeToParts/resolvedOptions),方法值 + 参数/返回面齐备。其余 3 条已由同批 core 收口(
fix-core-remaining-65):第 1 条的运行时面 (typeof new Intl.Collator().compare现折精确"function")、第 3 条 (继承的cause不再折「确定不存在」,现为unknown—— 原生是1, 引擎取不假精确的口径)、第 4 条(new Int8Array(["3"])[0]折3, 类型化数组元素值面已建模)。第 2 条不是缺陷:原生new AggregateError()抛 TypeError,引擎同判(该入口报nudo:entry-may-throwTypeError), 台账「errors = []」的前提与原生不符。env 包的
exportsmap 未动(无新增导出面);promiseOf只加了可选形参。 -
9f26414: fix(env): env 成员表对齐宿主实测(族 35 · Bug 1044 / 1047 / 1048 / 1049)
env 的成员表是手写的 ⇒ 两个方向的错都会进产品面:缺成员 ⇒ 闭 obj 缺槽 ⇒ 成员读出 exact
undefined(确定的错值)⇒ 调用即「确定抛 TypeError」⇒ L2 门禁假红;写错返回域 ⇒ 宿主必抛的调用被判安全 ⇒ L2 门禁假绿。 本批把四条从未被任何批次处理过的成员表缺陷一并对齐,并补上宿主实测护栏。- Bug 1044(node env ·
Response静态面 · 假绿):Response.json的返回域 写成了promise<unknown>(WHATWG Fetch / undici:静态Response.json同步返回Response)⇒.then(...)被判安全而宿主必抛 (TypeError: Response.json(...).then is not a function)。改成Response实例面(brand),读面与宿主一致(.status→ number、.then→ exactundefined),与 web env 的静态面同源;实例面的json(读 body ⇒ 真 promise)保持不动。 已知偏差:.then(...)这一具体形态仍不被 L2 门禁标出——core 的 「确定不可调用成员」判定只覆盖平 obj 接收者,brand 接收者的缺槽成员 被调用时不记抛(core 侧问题,本包改不到)。 - Bug 1047(node env ·
performance· 假红):补齐宿主真实存在的 6 个成员 ——toJSON/clearResourceTimings(Performance Level 2 标准面,web env 早已补过 ⇒ 两 env 不对称)/eventLoopUtilization/nodeTiming/setResourceTimingBufferSize/timerify(perf_hooks 面)。nodeTiming按 宿主实测建模为对象,timerify的返回域是可调用面(宿主返回包装函数, 不是undefined)。 - Bug 1048(node env ·
navigator· 假红):补locks(Web Locks API,W3C 标准,浏览器 + node 24+ 都有)⇒navigator.locks不再读出 exactundefined,navigator.locks.request(...)不再被判「确定抛 TypeError」。 - Bug 1049(web env ·
crypto.subtle· 假红):补 4 个标准 WebCrypto API ——deriveKey/deriveBits(Level 1)/wrapKey/unwrapKey(Level 2) ⇒ node env 同一对象早已声明前两个的两 env 自相矛盾消失。
两 env 同源:node env 的
crypto.subtle同步补上wrapKey/unwrapKey, node / web 两 env 的crypto.subtle成员集合同源;web env 的navigator同步 补上locks。node env 内部把performance(全局对象面 +Performance实例面)、navigator(全局对象面 +Navigator实例面)与crypto.subtle(crypto全局面SubtleCrypto实例面)改为共用一份槽表,杜绝「一处补了一处没补」的漂移。
宿主实测护栏:新增回归钉,对
performance/navigator/crypto.subtle/Response各断言「宿主实测成员名 ⊆ env 表成员名」(真 node 子进程跑Object.getOwnPropertyNames对照 env 表),并带负控(宿主没有的成员仍被判 「确定缺失」)⇒ 证明没有把整张表改成全放行。 - Bug 1044(node env ·
-
67abd92: fix(env): node env 面的 4 处假绿 / 口径不一致收尾(族 64)
env 的 node 声明面是手写的 ⇒ 宿主必抛的路径被判「恒不抛」⇒ L2 门禁假绿。本批按宿主实测(node v26.10.0)逐条收口。
第 1 条 · 全局
TextEncoder是 class,裸调必抛 TypeError(真修)。 宿主实测:TextEncoder()⇒ TypeError("Class constructor TextEncoder cannot be invoked without 'new'");旧声明是普通 fn 面 ⇒ 裸调落「返回声明类型、 永不抛」⇒ 假绿。现在在 env 侧声明成类值(core 的 Bug 272 判据:ctor: true+ 单一 rest 形参"_rest"⇒ 裸调定抛 TypeError,与原生同形),apply返回声明实例面 ⇒new TextEncoder()的实例面 (encoding/encode/encodeInto)不丢——不像「删声明回落宿主」那样 退成undefined(那是确定的错值,宿主真值是"utf-8")。 副作用(诚实记录):签名显示从() => TextEncoder变为(_rest) => TextEncoder——与 core 自己对类表达式的显示口径((_rest) => ?)同款。第 2 条 ·
node:url的URL不再吞掉原生异常(真修,调用面)。 apply 的 catch 分支此前return undefined⇒ 非法 URL 被静默吞掉(恒不抛); 现在套 Bug 881(fileURLToPath)同款范式:非法 URL ⇒ 记 TypeError throws 面;抽象实参 ⇒ 原生可能抛 ⇒ 同样记 may-throw TypeError;合法 URL ⇒ 零抛 + 字面量href(字面量精度不回归)。 已知偏差(core 侧 A 类债):core 的$new只取AbsApplyResult的abs(throws 面被丢)⇒ env 层无法表达「构造期必抛」⇒new URL("not a url")仍恒不抛;已在钉里记录现状,待 core 修复后改写。第 3 条 ·
util/querystring的escape/unescape(无需改动,已钉)。 宿主实测:require("node:util").escape === undefined(util 没有这两个 成员)、require("node:querystring").escape是函数(querystring 有)⇒ env 的 querystring 面与宿主一致,util 面也没有多声明 ⇒ 任务书前提里的 「util 多声明」实为误归因(声明在 querystring 面,宿主同样有)⇒ 不改, 只钉住与宿主一致。第 4 条 ·
crypto.subtle的拒绝 reason(不改,保持unknown,已钉)。 宿主实测:node 的 WebCrypto 与浏览器不同——拒绝 reason ∈{NotSupportedError, TypeError, OperationError, DataError}(从不是 OperationError 唯一值)⇒ 按promiseOf的契约(reason 必须是全部拒绝 路径的公共上界,否则是 wrong-exact)node env 的 reason 必须保持unknown; web env 的OperationError是浏览器口径(WebCrypto 规范)⇒ 跨 env 不同源是宿主事实,不是缺陷 ⇒ 不改,只钉住。负控:族 61 的既有声明逐字不变——node env 仍是 130 个全局、
node:crypto/node:fs/node:fs/promises的成员名单与 formatShape 不变。 env 包的exportsmap 未动(无新增导出面)。 -
3d66f5a: fix(env): node env 的模块面与共享槽面对齐宿主实测(族 61 · 6 条)
node env 的声明面是手写的 ⇒ 两个方向的错都会进产品面:缺成员 ⇒ 该名 走宿主路径(行为对、类型精度低);缺实参域 ⇒ 原生必抛的入口被判 「恒不抛」⇒ L2 门禁假绿。本批按宿主实测(node v26.10.0)补齐六条。
node:crypto同族兄弟不再恒不抛(假绿):旧实现只给createHash/randomBytes/randomInt/pbkdf2Sync/timingSafeEqual建了实参域;createHmac/createCipheriv/createDecipheriv/scryptSync/generateKeyPairSync(以及新增的createSign/createVerify) 原生必抛的调用被判安全。现在按宿主实测建 throws 面:createHmac:不认识的 digest 名 ⇒TypeError(ERR_CRYPTO_INVALID_DIGEST);认识但 HMAC 用不了的名字 (shake-*/keccak-kmac-*,8 个)⇒Error(OpenSSL 错误)——两档 错误品牌与原生一致;合法 digest 零抛。createCipheriv/createDecipheriv:未知 cipher ⇒Error(ERR_CRYPTO_UNKNOWN_CIPHER)。createSign/createVerify:不认识的 digest 名 ⇒TypeError。generateKeyPairSync(新增成员):不支持的 key type ⇒TypeError(ERR_INVALID_ARG_VALUE);合法 type 零抛,返回域是{ publicKey, privateKey }(KeyObject 面)。scryptSync:keylen越界 ⇒RangeError;options.N非 2 的幂 ⇒RangeError;内存闸128*r*(N+p+2) > maxmem⇒RangeError;options 缺省槽按原生默认值(r=8 / p=1 / maxmem=32MB)判定 ⇒ 合法参数零抛。 已知偏差:key / iv 的长度校验与generateKeyPairSync的options(modulusLength/namedCurve)域未建模。
node:crypto导出webcrypto(缺口):宿主require("node:crypto")自带webcrypto/subtle/getRandomValues三个自有键,env 一个都没导出 ⇒ 这三个名走宿主路径。现在补上:webcrypto是Crypto面 (subtle/getRandomValues/randomUUID),subtle与全局crypto.subtle同源(共用族 35 的subtleCryptoSlots一份槽表)。node:fs/node:fs/promisesAPI 面补齐(缺口):fs.openSync此前未声明 ⇒ 补上(返回 fd(number);路径不存在 ⇒ may-throwError(ENOENT 语义,同 fs 同步族口径);非法 flags 字符串 ⇒ 必抛TypeError(ERR_INVALID_ARG_VALUE);flags 缺省 ="r");fs/promises补lstat(与stat同一张 Stats 表)、statfs(8 个数值槽)、opendir(Dir面:path/read/readSync/close/closeSync/entries)。- 回归钉(已随族 35 关闭):
navigator.userAgent已是prim.str(), node env 全局表里没有读出unknown的槽 ⇒ 钉成回归钉防回退。 - ESM 上下文全局面(141 vs 130):宿主实测 ESM 上下文 184 个全局,减去
43 个 Node 内建模块命名空间 = 141;env 声明 130(多出
__dirname/__filename两个 CJS 模块作用域名)⇒ 真实缺口是 13 个 (台账的「11」是 141−130 的粗算)。13 个逐个给出不声明的理由:Object/Function/Proxy/escape/unescape(es env 金标要求, 声明会遮蔽 core 的精确语义)、eval(直接 eval 是语法形式)、queueMicrotask/structuredClone/atob/btoa(族 29 Bug 883 / 884 / 888 金标:声明会遮蔽宿主的 throws 面 ⇒ 反而制造假绿)、URL/URLSearchParams(宿主路径已同样精确,声明无收益)、TextDecoder(宿主路径比 env 面更精确:utf-8vsstring⇒ 声明会降 精度)。 - env 覆盖基线:
docs/reports/env-coverage-baseline.{json,md}用scripts/env-coverage-baseline.ts重新生成(未手改)。数字未变 (node resolved 75/77、leaf-clean 69、signature-level 6、unknown 0、 mock-required 2)——剩下的 2 条 mock-required(流机器 / 真起进程)与 6 条 signature-level(assert.*/util.*的真无约束参)都是docs/design/limitations.md记的设计边界,不是缺口。
负控:既有 env 成员的声明逐字不变——
node:crypto既有 10 个成员、node:fs/node:fs/promises既有成员名单与 formatShape、以及 node env 的 130 个全局全部不变;本次只新增成员(crypto 6 个 / fs 1 个 / fs-promises 3 个)。 -
69e67d3: Env declarations can now report that a host call throws, and can police the types of the arguments they are given.
envFnused to swallow whatever the host function threw: theapplywrapper caught every exception and returned the declared return type, so a declaration such asatob("!!!")looked like a call that never throws. The wrapper now returns through core's existing throws channel (makeAbsApplyResult), so a native exception is recorded as a may-throw at the call site, the same way a user-writtenthrowis. An apply that returns a bare value still means "does not throw", and an apply that returns its own throws face keeps it.- The error brand of a native exception is taken from
error.name, with"Error"as the fallback for a non-Errorthrow. Declarations whose host throws a brand that is not a standard error name —atobandbtoathrow aDOMExceptionnamedInvalidCharacterError— pass the brand explicitly through the new declaration-sidethrowsoption. - The new declaration-side
enforceArgsoption checks each argument against the declared parameter type before the host call happens. An argument that definitely does not fit makes the call throw aTypeError; an argument the engine cannot pin down (anunknown, anany, or a value that is not exact) makes the call possibly throw aTypeError. The check is opt-in, per declaration. envFnVariadicaccepts the samethrowsandenforceArgsoptions and passes them on; for a variadic declaration only the required parameters are checked.- The declaration helpers involved —
envFn,envFnVariadic,errBrand(name)(builds an error-brand value) and theEnvApplyImplapply signature — are internal to the package (src/abs-helpers.ts) and are not part of itsexportssurface:@nudojs/env/es,/weband/nodeexport onlydefineEnvand theEnvDefinitiontype.
-
69e67d3: The web environment now describes the browser the way the browser behaves.
- The browser constructors are constructible again.
Response,Request,Headers,URLSearchParams,EventTarget,EventandCustomEventare declared withctor: true, sonew X()no longer reports a may-throw for a call that the browser makes happily.Responseused to be a plain object rather than a function at all, which madenew Response()a definiteTypeError; it is now a constructor whose staticjson,redirectanderrorlive on the constructor itself. Requestno longer copies the whole member table ofResponse. The status membersok,status,statusText,redirectedandtypebelong toResponseonly — a nativeRequesthas nostatusat all — so readingrequest.statusnow yieldsundefinedinstead of a number.Requestkeeps its own members (method,body,mode,credentials,cache,redirect,referrer,referrerPolicy,integrity,signal,keepalive,duplex,destination) and sharesbodyUsedwithResponse.documentandperformancelist their members. A member the table left out used to read asundefined, and calling it was reported as a definiteTypeError— ondocument.getElementsByTagName,document.forms,document.write,performance.getEntriesand the rest. The collections read as arrays, andperformancealso exposesnavigation,serverTimingandtimeOrigin.- The global list covers the browser globals that were missing:
alert,screen,DOMParser,XMLHttpRequest,Worker,FileReader,matchMedia,IntersectionObserver,getComputedStyle,indexedDBandcaches. Reading an undeclared global is aReferenceError, so the missing ones were reported on perfectly ordinary browser code. navigator.hardwareConcurrencyis declared. It used to read asundefined, which madenavigator.hardwareConcurrency > 4fold tofalsewithout a word of complaint; it is a number now.AbortSignal.anyis declared, so combining signals no longer reads as a definiteTypeError.location.searchParamsis declared, solocation.searchParams.get("q")no longer reads as a definiteTypeError; it returnsstring | null.atob,btoa,TextEncoderandTextDecoderare no longer declared by the environment, because the host models them more precisely than the environment did.atob("!!!")used to look like a call that never throws; it now reports theInvalidCharacterErrorthe browser raises, and valid base64 still folds to the exact string.new TextDecoderwith an unsupported label reported aTypeError; it now reports theRangeErrorthe browser raises.TextEncoderandTextDecoderare classes, so calling either withoutnewreports theTypeErrorthe browser raises, and calling them withnewreports nothing.queueMicrotaskis no longer declared by the environment. The declaration shadowed the check that the argument is callable, soqueueMicrotask(1)looked like a call that never throws; it now reports theTypeErrorthe browser raises.
- The browser constructors are constructible again.
-
69e67d3: The node environment now covers the globals Node actually has, and stops shadowing the host built-ins it does not need to model.
- The node environment used to declare 41 globals. The remaining host
globals were unmodelled, so
new BroadcastChannel("x").nameand friends were cast into an empty brand: reading a member gaveundefined, and reading it twice gave a definiteTypeError. The environment now declares the host constructors — with their instance faces, and withctor: truefor the ones Node can actually construct andctor: falsefor the ones it cannot (AbortSignal,MessagePort) — together with the global objectscrypto,performanceandnavigator. Readingcrypto.randomUUID()now gives astringinstead ofunknownplus a misleadingnudo:unknown-inferencediagnostic that blamed the user's code. Built-ins that core already models exactly (URL,URLSearchParams,TextDecoder,Proxy, the error and typed-array families) are still not declared, so their precise behaviour is not shadowed. Bufferis a constructor now. It was declared as a plain object, sonew Buffer(1)was a definiteTypeErroralthough Node returns a buffer. The static side (from,alloc,of, …) hangs off the constructor and points at the same buffer shape as the instance side.- The
Bufferinstance face gainedbyteLength,bufferandbyteOffset. They used to read asundefinedwhere Node reports4, anArrayBufferand0. - The three process streams (
stdin,stdout,stderr) share one socket face.process.stdoutonly hadwriteandprocess.stdinonly hadon, soprocess.stdout.on("data", …)andprocess.stdin.setEncoding("utf8")were definiteTypeErrors. - The
processface gained twelve real members:emitWarning,abort,kill,release,features,umask,getActiveResourcesInfo,resourceUsage,availableMemory,loadEnvFile,getBuiltinModuleandconstrainedMemory.process.featuresis an open map overboolean | string | undefinedvalues, so reading a flag no longer degrades tounknown. process.hrtimeis callable again. It was declared as an object, soprocess.hrtime()becameunknownand produced a misleadingnudo:unknown-inferencediagnostic; it now returns a[seconds, nanoseconds]array, withhrtime.bigint()as a static member.- The node environment no longer declares
structuredCloneorqueueMicrotask. Declaring them shadowed the host built-ins and made their throws face disappear, so the engine claimed calls that do throw never do. Both names now fall back to the host path, which keeps the throws face.
- The node environment used to declare 41 globals. The remaining host
globals were unmodelled, so
-
69e67d3: Node
fs/fs/promises/path/osdeclarations now match what the host actually does, so the checker no longer reports calls as safe when the host throws, and no longer invents values the host cannot produce.os.cpus()describes the whole per-CPU record. The result was missing thetimesmember, so readingcpus()[0].times.userproduced an exactundefinedand the engine concluded the call must throw aTypeError. The record now carriestimeswithuser/nice/sys/idle/irq, as the host does.- The
node:pathfamily checks the types of its arguments. A path argument that definitely is not a string makes the call throw aTypeError, which is what the host does —path.join(123)andpath.isAbsolute(123)both fail that way. An argument the engine cannot pin down makes the call possibly throw instead. A bad argument no longer produces a confident value either:path.basename("/x/y.txt", 5)used to report the string"y.txt", a name the host never returns. Variadic members (join,resolve) are checked across every argument, and the optional suffix ofbasenamestill acceptsundefined, as the host does.path.posixandpath.win32follow the same rules. - The synchronous
node:fsmembers report that they may throw. The host throws anError(with acodesuch asENOENT) when a path is missing or a permission is denied, but the declaration claimed the call could never fail. The call is now marked as possibly throwing anError; it is not marked as always throwing, because the engine cannot know whether the path exists.existsSyncstill never throws, andrmSyncwithforce: truekeeps ignoring a missing path. fs/promisesresults use the same member tables as the synchronous family. The promise-family result was a trimmed copy, so readingmtimeMs,nlinkorisBlockDevice()off it produced an exactundefinedinstead of the number or boolean the host returns, and theDirentofreaddirhad no shape at all.readdirnow also follows the host and returns names whenwithFileTypesis not set and directory entries when it is.statSyncandfs.promises.statreport theundefinedthe host returns forthrowIfNoEntry: false. The result was declared as neverundefined, so the checker reported the call as safe and went on to give a confidentbooleanornumberfor a member read that the host answers with aTypeError.
-
69e67d3: The node environment now models the host's real throw and value behaviour for its
url,crypto,child_process,utilandassertmodules.node:url'sURLandURLSearchParamsandnode:util'sTextEncoderandTextDecoderare constructors now. They are declared as plain functions, sonew URL("https://x.dev/a")was reported as a call that may throw aTypeError("new on function value of unknown constructibility") even though the host never throws there. The declarations now carry the constructor flag, and the instance faces are unchanged.node:assertno longer claims that an assertion never fails.ok(false),strictEqual(1, 2),deepStrictEqual({a:1},{a:2}),notStrictEqual(1, 1),match("abc", /z/)andfail()throw anAssertionErrorin the host, and the declarations now say so: an assertion that is known to fail throws anAssertionError, an assertion that is known to hold throws nothing, and an argument the engine cannot pin down may throw. A missing argument tostrictEqualthrows aTypeError, the way the host does.node:url'sfileURLToPathno longer swallows the exception the host throws for an invalid URL or a non-file:scheme. The call is now reported as a call that may throw aTypeErrorinstead of quietly returning a string.node:crypto'screateHash,randomBytes,randomInt,pbkdf2SyncandtimingSafeEqualnow carry the throw the host throws for an out-of-range argument: an unsupported digest name throws anError, an out-of-range size, iteration count or key length throws aRangeError, and two buffers of different lengths throw aRangeError.node:util'spromisify,callbackify,inheritsandisDeepStrictEqualtake their function arguments through the apply path, so the argument is no longer bound as a type variable. The signatures are unchanged.url.pathToFileURLreturns the full URL face (eleven components plustoStringandtoJSON) instead of a one-slot{ href }object, so reading.pathnameor.protocolno longer yieldsundefined, and reading a member of one of them no longer looks like a guaranteedTypeError.child_process.spawnSyncreturns the full face of the host's result:pid,output,signal,status,stdout,stderranderror. Reading.pidno longer yieldsundefined, and reading.output[0]no longer looks like a guaranteedTypeError.
-
69e67d3: 族 29 修复 S5:Bug 861 · 864 · 865 —— es env 的 console 成员表补全(
timeStamp/dirxml/profile/profileEnd等缺槽读出 exact undefined ⇒console.timeStamp()假红「may throw TypeError」)、URI 族改走 core 的evalGlobalFn建模(decodeURI("%")的URIError不再被吞 ⇒ L2 假绿修复,抽象实参回落声明域 + may-throw URIError)、es env 补齐 ES 规范全局声明 + service 的「已被覆盖」判定改为按 core 真实建模能力推导(BigInt/ TypedArray 全家 /ArrayBuffer/DataView/AggregateError/Function/escape等不再被报「未被 Nudo 覆盖」,与同一份报告里的精确签名自洽)。 -
69e67d3: 族 29 修复 S6:Bug 882 · Bug 890 —— node:util 品牌形参函数的普通调用面 L2 假红 + env promise 缺 rejected 通道(catch 臂被当成死代码)。
Bug 882(core 侧根因) —
promisify/callbackify/inherits/isDeepStrictEqual这类品牌形参函数在具名导入调用面 (import { promisify } from "node:util"⇒promisify(readFile))报nudo:entry-may-throw,而成员调用面(util.promisify(readFile))正常 ⇒ 同一函数两种口径。根因:普通调用面把裸宿主值(宿主函数 / 宿主构造器 / 函数声明绑定)原样灌进bindTypeVars,arg.shape解引用undefined⇒ TypeError 冒泡 ⇒ 上层记 may TypeError ⇒ L2 假红(原生必不抛)。packages/core/src/algebra/hof.ts的bindTypeVars:无形状的实参不参与 类型变量绑定(此前直接解引用arg.shape崩)。- 普通调用面也做实参归一化(与成员调用面同款):
hof.ts新增setRawArgNormalizer注册钩子,packages/core/src/algebra/exec/class/invoke.ts在加载期注册asAbsVal门面 ⇒ 两个调用面共用同一归一化 ⇒ 同一宿主函数恒 同一 Abs 身份 ⇒ 两种口径一致。
Bug 890 — env 造的 promise 没有 rejected 通道 ⇒ core 读成「确定 fulfilled」⇒
catch臂被当成死代码 ⇒ 引擎给出确定的错值(原生fs/promises.readFile/fetch/crypto.subtle.digest都可能拒绝)。-
core 侧零改动:
settledFulfilledOf/then/catch/$await对 带rejected通道的 promise 处理已经正确(rejected !== undefined⇒ 不判「确定 fulfilled」;catch走「两臂 join」分支;$await把拒绝臂送进 throw 通道 ⇒try/catch可吸收 ⇒ catch 臂可达)。本分片只补回归钉。 -
env 侧改法(
packages/env/src/abs-helpers.ts的promiseOf()):给 promise 形状补上rejected通道 ⇒ 两臂均可能 ⇒ catch 臂保持活:export function promiseOf(inner: Abs): Abs {return makeAbs({ k: "eff", eff: "promise", inner, rejected: unknown },undefined,undefined,"exact",);}(
unknown= env 侧已有的 unknown Abs——拒绝 reason 不可知 ⇒ 两臂均可能;rejected是态信息,不进 leq / 指纹 / check 等价。)
-
69e67d3: 族 29 主 agent 收口:跨分片组合出来的 4 个缺口。
- Bug 884(web 侧):
web.ts的structuredClone声明已删(node 侧同款 修法在node.ts)⇒ 回落宿主内建 ⇒ 不可克隆值的 throws 面(宿主DOMException/DataCloneError)不再被 env 声明整段吃掉 ⇒ L2 门禁恢复。 enforceArgs的并集实参过严(S3 越界发现,主 agent 修正):实参是并集 (如string | undefined)时,leqAbs(sum, pt)整体判 false ⇒ 旧实现把它 当「确定不符 ⇒ 必抛 TypeError」,而原生只在undefined分支抛 ⇒ 可能假红。 现在逐成员判定:只有全部分支都不兼容才判必抛,部分分支不兼容判 may-throw ⇒ 与原生同口径。- Bug 886 / 889 的组合缺口(S1 删声明 + S5 覆盖推导撞出来的):web env 的
TextDecoder声明已删(宿主才有精确的RangeError与「类不可裸调」语义), 但 core 的构造面evalBuiltinNew不认TextDecoder⇒ ①nudo test报「Built-in API "TextDecoder" is not covered by Nudo's type inference」(假阳);② Abs 面与$new宿主面口径分裂。现在evalBuiltinNew补case "TextDecoder"⇒ 两侧同 builder (makeTextDecoderAbs),假阳消失。 - 「已被覆盖」判定里的手写例外已删(族 29 Bug 865 的根因收口):core 其实
已精确建模
WeakRef(evalBuiltinNew的case "WeakRef"),但三条既有 service 契约把WeakRef当作「未被覆盖的全局」样例钉住,于是判定里留了 一张手写例外表——那正是 Bug 865 要消灭的「手写白名单」换了个地方继续写。 现在例外表删除,三条契约的样例全局换成真正未被建模的宿主全局Atomics(core 无Atomics建模面;它是globalThis里的数据属性 ⇒ 不触发访问器副作用),契约的意图(未建模全局要报builtin-unknown、 且不与unknown-global双报)完全保留。
- Bug 884(web 侧):
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [7fea13a]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
- @nudojs/core@1.16.0
0.5.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
0.5.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
0.5.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- Updated dependencies [aae0f96]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
0.4.42
Patch Changes
- Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
0.4.41
Patch Changes
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
0.4.40
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
0.4.39
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
0.4.38
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
0.4.37
Patch Changes
- Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
0.4.36
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
0.4.35
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
0.4.34
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
0.4.33
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
0.4.32
Patch Changes
- Updated dependencies [334b914]
- Updated dependencies [94197eb]
- Updated dependencies [b8db17b]
- Updated dependencies [5e275df]
- @nudojs/core@1.10.0
0.4.31
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
0.4.30
Patch Changes
- Updated dependencies [b6495c6]
- Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
0.4.29
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
0.4.28
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
0.4.27
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
0.4.26
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
0.4.25
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
0.4.24
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
0.4.23
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
0.4.22
Patch Changes
-
92e6a5f: fix(core,env): L2 entry-may-throw 假阳性两处(issue #105 / #106)——1.3.5 的 builtin throws 语义对齐(2e5aeb35)引入的回归面:
- #105 typeof 守卫后的 any 不再记假 may-throw:
$narrowTypeOf此前只剪 sum 成员,裸any(无约束入口参数)在守卫事实臂原样保留 →RegExp.exec/test(v)的 subject ToString 档位按 any 记 may-throw。修复:事实臂(keep=true)any 健全窄化为对应 prim(string/number/boolean/bigint/symbol,term/pred/conf 保留;补集臂与 object/function/undefined 不可表示、unknown fail-closed 令牌均保守保留)。npm-safeparseVersion(typeof v !== 'string'+if (!m) return null双守卫 + 捕获组读)恢复干净。无守卫的exec(any)仍如实报(原生exec(Symbol())抛 TypeError,与 check-gold 的 scale(x) 口径一致)。 - #106 env 声明构造器不再报 constructibility 假抛:env 的 Error 族声明为无名 envFn——
$new的按名派发(evalBuiltinNew → errorBrandAbs)拿不到名字,落到通用 fn 分支的 unknown-constructibility 门;$class的 extends 门同样只见 ctor:undefined,class ApiError extends Error定义期误报。修复:envFn支持ctorfacet 并给 relationFn 路径补name盖章;Error 族 / Date / Promise / URL / AbortController / EventEmitter / stream 族声明 ctor:true(Symbol 声明 ctor:false——原生非构造器,new Symbol()/extends Symbol仍定抛);$new的 ctor:true-无-impl 路径回落声明 returnType(保实例面精度,AbortController/EventEmitter 不丢方法槽)。new Error('lit')/new TypeError('lit')/new ApiError(...)/class extends Error在 env 下恢复干净;new Error(anyMsg)仍如实报 message ToString may-throw(node 实测new Error(Symbol())抛 TypeError,与无 env 宿主路径同口径)。
- #105 typeof 守卫后的 any 不再记假 may-throw:
-
Updated dependencies [d6fa067]
-
Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
0.4.21
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
0.4.20
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
0.4.19
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
0.4.18
Patch Changes
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
0.4.17
Patch Changes
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [a00bccc]
- Updated dependencies [39332ca]
- Updated dependencies [446914f]
- @nudojs/core@1.7.2
0.4.16
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
0.4.15
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
0.4.14
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
0.4.13
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
0.4.12
Patch Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
-
Updated dependencies [f10066d]
- @nudojs/core@1.4.0
0.4.11
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
0.4.10
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
0.4.9
Patch Changes
-
662aeb5: fix(env): env-declared
Number/Array/Promise/Dateno longer shadow away call/constructDeclaring
nudo.env(e.g."es") bound these globals as namespace-onlyobjAbsobjects. Once shadowed,Number(x)andnew Array(n)found nothing callable/constructible and degraded tounknown— the opposite of the host identity path (no env), which folds viaGLOBAL_FNS/$new'scls === Array.Dual-facet globals now model both faces (issue #58 option 1):
- Abs
fnmay carry staticslots(Number.isFinite,Array.isArray, …).$get/$inread them;typeofstays"function". $newdispatches Abs constructors by name throughevalBuiltinNew(Array/Date/Promise/Number/String/Boolean/Map/Set/Error), instead of only the Error/Promise special cases.- ES env declares
Number/Array/Promise/Dateas callableenvFnwith static slots and a ctorname, so call, construct, and statics all keep builtin semantics under env shadowing.
Number(s)folds tonumber,new Array(n)to a holey tuple, andNumber.isInteger/Array.isArraystay precise withnudo.envdeclared. - Abs
-
Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
0.4.8
Patch Changes
-
5494f67: fix(env):
Math.min/Math.max/Math.hypotare variadicThe ES env declared them as binary (
envFn([prim.num(), prim.num()], num)), soMath.min(a, b, c)— the ordinary usage — no longer matched the arity, and the call degraded tounknown. On a real project this turned an OSA Damerau–Levenshtein implementation intounknownand failed 8 case assertions the momentnudo.envwas declared.They now use
envFnVariadic(prim.num(), prim.num(), { apply: numImplVAbs(...) }): any number of literal numeric args fold (Math.min(3, 1, 2) === 1), and non-literal args yieldnumberinstead ofunknown. -
Updated dependencies [7b8df37]
-
Updated dependencies [af8cb68]
-
Updated dependencies [ff37d91]
- @nudojs/core@1.2.1
0.4.7
Patch Changes
- Updated dependencies [5ff4202]
- Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
0.4.6
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
0.4.5
Patch Changes
- Updated dependencies [3bf9997]
- @nudojs/core@1.1.3
0.4.4
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
0.4.3
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
0.4.2-beta.0
Patch Changes
- Updated dependencies [22baf33]
- Updated dependencies [0e1432a]
- Updated dependencies [3c3f9d2]
- Updated dependencies
- Updated dependencies [279d73a]
- @nudojs/core@3.0.0-beta.0
0.4.1
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/core@2.1.0
0.4.0
Minor Changes
-
9731238: BREAKING (behavior)
@nudojs/service: handwritten@nudojs/envnow wins over harvest / module-graph modules on overlapping module keys and export names (mergeHarvestUnderEnv). This is the documented B8 priority — harvest only fills missing slots — but analysis results on projects that relied on harvest overwriting a handwritten env export will change.Migration: remove or update the conflicting handwritten
@nudojs/envslot if you needed harvest's version; otherwise no code change. Conflicts emit anudo:env-harvest-conflictwarning listing overwritten module/export names.Also in this service major (additive public surface, riding the required major for the priority change):
- Public harvest helpers:
mergeHarvestUnderEnv(optional per-callonConflict),setEnvHarvestConflictCollector(returns previous; save/restore for nested analysis),getEnvHarvestConflictCollector,clearNodeHarvestCache,getNodeHarvestCacheSize,isHarvestNodeDisabled,HARVEST_NODE_DEFAULT_*. Negative harvest outcomes (not-found/no-dts/failed) are cached in-process;NUDO_HARVEST_NODE=offstays explicit and uncached.clearNodeHarvestCache()also dropsnot-foundmisses so a later@types/nodeinstall is visible in-process.nudo:env-harvest-conflictwarnings point at the conflicting import specifier when found (file-levelline 0otherwise). @nudojs/env(minor):events/stream/querystring; high-frequencyutilslots; Promise APIs only underfs.promises/node:fs/promises(callback-stylefs.readFileetc. no longer pretend to return Promise). Optional Node params (path.basenameext,url.URLbase) keep typed labels (ext?: string) but are not required slots —requiredFnArityskips?/....@nudojs/core(patch):formatShaperenders fn rest labels (...paths) and optional labels (options?) as...name: T/name?: T.leqAbsfn arity uses required slots only (requiredFnArityskips...rest/name?): src is assignable to tgt iffsrc.required ≤ tgt.required(TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). PairwiseparamTypescontravariance is unchanged.@nudojs/lsp(patch): freeze inventory inpublic-api.ts(also exported as@nudojs/lsp/public-api); agent slash requests register fromNUDO_AGENT_TOOL_NAMES;selectCase/getActiveCasesare editor executeCommand + slash-only (not dot-form custom requests).
Migration for env consumers who need bit-stable hover/format strings: pin
@nudojs/env~0.3.0after the next release, and prefer leaf-clean coverage counts (empty{ }shapes are not leaf-clean) over raw resolved ratios. - Public harvest helpers:
Patch Changes
- Updated dependencies [9731238]
- @nudojs/core@2.0.1
0.3.0
Minor Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
0.2.5
Patch Changes
-
61b8a6c: Fix soundness issues in Abs evaluation:
parseInthonors hex/octal/binary prefixes and explicit radix (no forced radix 10)Array.isArrayreturns unknown boolean for any/unknown/sum, and sees through brandDate.now()is an unknown number, not a folded wall-clock timestamp- strict numeric bounds win over non-strict at equal value (order-independent)
boundsSatisfiableno longer downgrades strict bounds via redundant ge/le- structural
absShapeKeystops join/dedup collapsing distinct arrays, overloads, brands denoteGuardrenders NaN/±Infinity correctlyString.splitwith non-literal separator returnsarr<string>, not a 1-tuple
-
Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
0.2.4
Patch Changes
- Updated dependencies [0fd253f]
- Updated dependencies [a2aac9e]
- Updated dependencies [0f0b7d5]
- Updated dependencies [de47d84]
- Updated dependencies [78f6752]
- @nudojs/core@1.0.0
0.2.3
Patch Changes
- Updated dependencies [1d6bb01]
- Updated dependencies [1d233a7]
- @nudojs/core@0.4.0
0.2.2
Patch Changes
- df1726c: Make
@nudo:envactually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path$invokeimplements string methods and filters union members, andcollectAbsCallRecordsmerges env modules so call@ cases no longer overwrite correct B-path results. - bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
0.2.1
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
0.2.0
Minor Changes
-
0fd0718: Merge the three environment packages into one:
@nudojs/env-es,@nudojs/env-web,@nudojs/env-nodeare replaced by a single@nudojs/envpackage with subpath exports@nudojs/env/es,@nudojs/env/web,@nudojs/env/node.Move agent-facing tools from the standalone MCP server into the language server:
@nudojs/mcpis removed.@nudojs/lspnow exposesnudo.whatIf,nudo.suggestCase,nudo.trace,nudo.selectCase, andnudo.getActiveCasesviaworkspace/executeCommand(custom-request aliasesnudo/whatIfetc. included), adds pull-mode diagnostics, and works on files that are not open in the editor (disk fallback).nudo.whatIfnow actually applies the given type bindings — previously they were ignored. AI agents connect through any LSP↔MCP bridge (cclsp, mcpls, agent-lsp) or a native LSP client; an installable agent skill ships atpackages/lsp/agent-skill/SKILL.md.
@nudojs/harvester 0.6.3
0.6.3
Patch Changes
- Updated dependencies [795e322]
- Updated dependencies [161d156]
- @nudojs/core@1.20.1
- @nudojs/env@0.5.11
- @nudojs/parser@1.5.11
Version history (61)
0.6.2
Patch Changes
- Updated dependencies [c93a32d]
- Updated dependencies [190761e]
- Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
- @nudojs/parser@1.5.10
- @nudojs/env@0.5.10
0.6.1
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
- @nudojs/env@0.5.9
- @nudojs/parser@1.5.9
0.6.0
Minor Changes
-
897b19f: > 版本定性(2026-11-05 产品裁决):本批不判定为 breaking 变更 ⇒
changeset 不写 BREAKING / Migration 标注;下方「兼容性」段落只是升级时的 注意点,不是迁移要求。发布级别仍按此前决定走 minor(additive 能力 + 暂无外部用户),不占 major、不触发
scripts/gate-major.mjs。Abs现在携带可选facets槽位容器(callable/protoOwnKeys/brand),三个槽位均已在引擎内启用。缺省不出现 ⇒ 旧Abs的键、投影与leqAbs接受集逐字节不变;但带上槽位的值在以下面给出比以前更精确的判定:callable:类值裸调用判据不再只靠class-mark.ts的 WeakMap 与_rest形参启发式 ⇒ 快照 /substAbs/ 重铸后的类值仍定抛TypeError。该槽位表达「无new的 [[Call]] 定抛」,不是规范IsCallable。protoOwnKeys:原型对象的自有键集随值携带(Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols),不再只能按 brand 名查固定表。brand:生成器对象身份随值携带,dts 的iteratorTSType不再只靠next/@@iterator槽启发式 ⇒ 丢了内部协议槽的重建产物仍投影Generator<T>(泛型实参照旧推导,不输出裸名以免 TS2314)。
兼容性:直接构造
Abs字面量 / 只读取既有字段的代码无需改动 ——facets缺省即旧行为。用Object.keys(abs)、结构化克隆或自有实现的序列化器枚举Abs全部字段的内部代码,需容忍新增的可选facets(不读它即与旧行为一致)。absKey只对非空容器进键 ⇒ 带槽位的值会自然得到不同的 memo / 指纹,无需手工清缓存。coreformatShape的展示面不发布生成器身份(既有契约,逐字不变)。残余批次(同批发布):
- A2 声明/收割面:
declare class类值挂callable:false;JSON.stringify(obj, 类构造器)由may-throw升为确定抛 TypeError。HarvestSig.fn新增callable字段、HARVEST_DISK_ABIv14 → v15(~/.cache/nudo/deps/旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs的absFunctionmock 重建也整包搬运槽位。 - A10 内建原型:
Array/Object/Map/Set/Promise/String/Number/Date/RegExp等的Object.getOwnPropertyNames/Object.hasOwn/getOwnPropertySymbols由保守string[]/boolean/symbol[]升为与宿主动态对拍的精确面(键集随 Node 版本给出各自真实值,不写死清单)。 - A10 用户类原型交错定义序:
EvalClassSpec新增可选protoMemberOrder(transpile/class-emit.ts按类体源码序登记、declare.ts::rekey同步换名)。Object.getOwnPropertyNames(用户类.prototype)对「方法与访问器交错定义」的类由保守string[]升为与宿主对拍的精确有序表;静态 / 私有成员不列入。手写 spec / mock 桥 / 旧产物无该字段 ⇒ 回落旧保守域(零回归兜底)。 - A11 TReturn / TNext:
AbsFacets新增可选genReturn/genNext,dts 输出Generator<T, TReturn>/AsyncGenerator<T, TReturn>(恒带类型实参,无 TS2314)。本轮进一步接通 TNext 保守域:makeGenObject填unknown(引擎不建模.next(v)入参 ⇒ 与 TS 该类型形参默认值等价,不是精度承诺),iteratorTSType仅当facets.genNext存在才输出第 3 实参 ⇒Generator<T, TReturn, unknown>;三实参仍恒带<…>,无 TS2314。手工构造 / 无genReturn的旧 Abs 输出逐字不变;填真实 v 域依赖 A1 步骤 4 真挂起(明确停点)。 - A1 步骤 2 骨架(零语义):
exec/match-iter.ts把 7 个元素面读出函数收口到模块私有的幂等触发器表,生产侧不登记 ⇒ eager 时序与全部值面逐字不变;不进任何 barrel,公共 API 冻结不变。为后续「首消费点触发」预置接线,不改变任何对外行为。 - schema / standard / guard 生成器身份投影:已实施,另立 patch changeset(
.changeset/generator-identity-validator-fix.md)。产品裁决「收紧是 bug、不判定为 breaking 变更」⇒ 三面按facets.brand统一收紧;emit-bug-130的无 brand 夹具仍逐字不变(负控制)。z.instanceof路径经运行时实证仍不可行。实施记录见docs/design/architecture-debt.md,生产接线回归见emit-generator-identity-poc.test.ts。
兼容性(补充):① 自行解析磁盘收割 JSON 或依赖
HARVEST_DISK_ABI的下游需接受HarvestSig.fn.callable新字段(旧缓存按 v15 自动失效);② 枚举Abs.facets全部字段的代码需容忍新增的genReturn/genNext(不读即旧行为);③ 曾断言内建原型gOPN为string[]/hasOwn为boolean的内部测试需改为与宿主对拍的精确断言;④ 解析生成器 dts 类型实参的下游需容忍三实参Generator<T, TReturn, unknown>(无genNext的旧手工 Abs 仍两实参 / 一实参,逐字不变);⑤ 自行构造EvalClassSpec的下游可忽略新增的可选protoMemberOrder(缺省即旧两表拼接口径),但曾断言交错类gOPN为string[]的内部测试需改为精确有序断言。Evidence: 三槽各独立全仓回归 0 新增失败;最终 2159 文件 / 17191 用例 0 新增失败;金标 1.0/1.0、真包 0 FP、差分语料 0 回退、公共 API 冻结未变。发布级别按 2026-11-05 产品裁决:整批不判定为 breaking 变更 ⇒ 不写 BREAKING / Migration 标注,仍以 minor 发布(
scripts/gate-major.mjs不触发);一旦有外部用户依赖这些包面,即刻回到docs/versioning.md的「1.x + API/schema break ⇒ major」。
Patch Changes
-
09d49af: Feat: architecture debt A6 — fn shapes carry an optional overload set, and calls dispatch by argument shape (closes the Bug 827 / A5 false red).
Shapefn branch gains optionaloverloads?: FnOverload[]({ paramTypes, returnType }[], declaration order = TS resolution order). Absent ⇒ every existing shape, key, and projection is byte-identical.instantiateReturndispatches on overloads: first arm in declaration order whose arity matches and whose params accept the arguments (per-paramleqAbs, α bound/substituted per arm) supplies the return face; zero hits fall back to the union return face (no invented may-throw). Union face (paramTypes/returnType) stays the authoritative extensional face —leqAbs,formatShape, dts/schema/guard read only it; overloads are a dispatch refinement, not assignability.- Harvester: top-level function overloads and interface/class method overloads both snapshot arms before the union-face merge (shared
collectOverloadArms; Bug 807 two-path parity preserved).HarvestSiggainsoverloadsso disk-cache round-trips keep the dispatch face;HARVEST_DISK_ABIv13 → v14 (old entries miss cleanly instead of silently losing overloads). absKeyincludes overloads (distinct overload sets no longer share memo/fingerprint);substShapesubstitutes arm Abs data;snapshotAbsdeep-copies overloads and now carries the fn impl side table (A7 mirror — snapshots no longer degrade to shape-only).- Evidence: types-only package with
convert(x: string): string; convert(x: number): number;—nudo checkgoes from 2 L2entry-may-throwfalse reds (method 'toFixed' missing on string receiver/ symmetric) to OK, matchingtsc --strictexit 0;useNum() => string/useStr() => stringexact. Gold/recall/real-package gates 223 green; harvest + emit + differential 1434 green.
-
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
- @nudojs/env@0.5.8
- @nudojs/parser@1.5.8
0.5.0
Minor Changes
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
-
01463d8: Dedup batch 3 (jscpd + dead-export + doc-drift audit): single-source the remaining cross-package and in-package copies, remove dead exports, and fix doc drift.
Single-sourcing (comment-pinned manual-sync pairs now share one implementation):
- env WHATWG globals: new
env/src/whatwg.tsshared factory consumed by bothnode.tsandweb.ts(Headers/FormData/URLPattern/Blob/stream readers/writers/DisposableStack family). Byte-identical parity verified via before/after brand-slot dumps; intentionally divergent declarations (Request/Response/fetch/…, see whatwg.ts header) stay per-env with pointer comments. - atomic writes: new
@nudojs/servicewriteFileAtomic(randomBytes tmp suffix) replaces 6 hand-copied variants across lsp/nudojs (contract-emit, migrate) / service (emit ×2, disk-cache). - analyzer-diagnostics → CheckIssue mapping: core
checkIssuesFromDiagnostics(+AnalyzerDiagnosticLike) via@nudojs/core/internal; nudojs keeps adomainIssuesFromDiagnosticsalias, lspagent-toolsdrops its copy (Bug 632/1038 drift class closed). - ESM AST detection: core
isEsmProgramexported via internal; serviceabs-modules-graphdeletes its verbatim copy. - dependency collection: core
collectDependencySpecsWithMode(import/require mode labels, Bug 238) replaces service'simportSpecs/collectRequireSpecscopy;collectDependencySpecsstays a thin shell. - string-aware scan skeleton: core
text-scangrowsfindTopLevelChar/walkTopLevelCharsprimitives; parserfindReplaceSeparator/literalNestingDepth/outerParensWrapAll/findTrailingCommentStartconsume them (Bug 1009 copy-drift class). - core arithmetic: bigint mixed-operand tail shared via coerce.ts helpers
(Bug 946 matrix re-verified); sub/mul/div/mod numeric tail shared via
arithmetic/shared.tsnumericOpTail; AST walk skeleton unified inalgebra/ast-walk.ts(skip-key differences parameterized);errorTypeAbsleaf module (algebra/error-type-abs.ts) breaks the fake cycle that forcedsuper-access.tsto keep a copy; brand slot reads shared viabuiltins/brand-slot.ts. - harvester:
dts-contract-draftmemberKey delegates to exportedcomputedMemberName. - LSP stdio framing: shared
scripts/lib/lsp-framing.mjsframe reader for both smoke scripts.
Dead exports removed (zero product consumers):
bodyReadFieldsFor(service-emit),paramName(parser ast-guards),loadHarvestEnvFromDisk/harvestToAbsModules/summarizeNodeEnv(harvester), plusstreamOptionsdead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh).generateDtsstays exported (cross-package test use).Docs:
api/harvester.md(en+zh) no longer claimsautoHarvestModules/harvestNodeTypesare exported from@nudojs/service(they live in@nudojs/harvester). - env WHATWG globals: new
-
fd0fb09: Dedup batch 7 (jscpd
--min-tokens 70re-audit after batch 6: residual same-file fragment twins + one drifted manual-sync pair). Pure refactor — defineEnv deep structural dump (sorted + insertion-order preserving) byte-identical vs HEAD, verify:examples 251 checks green, lint + lint:tests clean.- env
node.ts: Storage slot table ×3 (ctor brand + localStorage + sessionStorage) → singlestorageObjconst (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → sharedexecSyncOptions; Request / Response body-mixin slots (clone/arrayBuffer/blob/formData/json/text, clone returns the respective brand) →bodyMixinSlots(self)factory; EventEmitter core on/once/off/emit →emitterCoreSlotsshared by the EventEmitter brand and theprocessglobal object. - env
node.tspath family — the drifted manual-sync pair: the top-levelpathModuleinlined the whole member table next to theplatformPathMethods(posix/win32)factory and had already drifted (join.requiredonly on the top-level copy).pathModulenow consumes the factory; member order canonicalized to the top-level key order;join's required-arity enforcement is now identical across path/posix/win32 (Bug 877 case 6's claimed parity now real). - env
web.ts: URL.searchParamsslot table and the global URLSearchParams constructor sharesearchParamsCoreSlots(toString / iterator face / size stay per-site; insertion order preserved). - core
builtins/error/binary.ts: DataView ctor andmakeTypedArrayFromBuffersharebufferByteLengthLiteral(brand→inner obj→byteLength slot fold);TypedArray.of's inlined copy of the number-domain item enforcement now callsenforceTaItem(the.ofcause variant is unified into the shared text — no pins). - core
builtins/object/methods.ts:getOwnPropertySymbolsobj arm and brand-inner arm share theownSymbolsTupletail (open/index → undefined, closed → counted tuple). - core
exec/transpile/helpers.ts: the MemberExpression root-identifier walk (assignment / update / stateful-call faces, ×3) →markFreeMemberRoot. - core
scan-call-graph.ts: dynamic-import and require ObjectPattern destructure binding loops →bindPatternImports; top-level class scans (findClassDecl+ module-frame class bindings) shareunwrapExportDecl. - harvester
harvest-dts.ts:resolveIfaceDeclsinner-first relative namespace resolution loop (qualified arm + short-name arm) →addRelativeNsHit;absExtends' twoes.k === "sum"member folds →foldSumFlags(thecs.k === "sum"fold is intentionally different and untouched). - service
analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) shareactualSlotTable(obj direct / brand inner-obj unwrap). - lsp
server-navigation.ts:onDefinitionnow uses the sharednavigationIdentAtpreamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept. - lsp
agent-tools.ts:suggestCase/traceshare theanalyzeToolFilepreamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
- env
-
Updated dependencies [5cd4106]
-
Updated dependencies [01463d8]
-
Updated dependencies [7d7abe4]
-
Updated dependencies [5769211]
-
Updated dependencies [01a550b]
-
Updated dependencies [fd0fb09]
-
Updated dependencies [6eaf219]
-
Updated dependencies [c48fd48]
-
Updated dependencies [00ba198]
- @nudojs/core@1.18.0
- @nudojs/parser@1.5.7
- @nudojs/env@0.5.7
0.4.6
Patch Changes
-
7231e87: Fix bug-report category 16 (harvester) — all 13 defects.
- BUG-123: promoted interface members are tagged and excluded from
declare modulerecords, the package-root merge and the unresolved fallback, so a member is no longer published as a phantom package export (nudo no longer accepts an import TypeScript rejects). - BUG-124:
emitAbs's object case emitsindex/open(and slotoptional/readonly) viaobjOf(slots, opts), so theinterfaceandtypealias forms harvest identically. - BUG-126:
signatureToFnSigcomputesoptionalParams(question / rest) and projects it, so optional parameters and arity survive harvesting. - BUG-141: namespace + namespace merges members (declaration merging) instead of counting a skip.
- BUG-142: overload returns are unioned and a generic α is kept only when the merged parameters can bind it, so no dangling α or pool replacement is produced.
- BUG-143: an identifier-named
ModuleDeclarationfalls through to the generic export path; only string-named ambient modules are skipped. - BUG-144: enums are modeled as member→literal objects (numeric auto-increment, string, const), matching the draft DSL.
- BUG-212:
nsSlotsByName.getuses the same\0separator asset(all four sites aligned), so a function declaration is no longer dropped when a namespace is declared first. - BUG-213: the union join is guarded by a bounded path-cost DFS with a directly-built sum
fallback, and bounded fingerprints replace core's
absKey-basedrelationFingerprint— an optional-member DAG no longer explodes (17.4 s + RangeError → ~1 ms). - BUG-252:
inferFrom/condFallbackare emitted intorelationFnoptions, so the persisted env module no longer degrades a conditional type toany(and the L1 gate stops being falsely green). - BUG-253:
emitEnvModuleno longer writes promoted interface members into the env's globals / module records. - BUG-265: a new
privatebag (module-private top-level declarations) is subtracted in the "public surface unknown" fallback, with exported names winning. - BUG-280: declared literals round-trip with
conf: "exact"instead ofmock(sowidenUncertainLiteralstops widening them), and the harvest JSON ABI is bumped v11 → v13 with the promoted-member provenance persisted — a cold and a hotnudo exportare now byte-identical.
Regression tests:
harvester-bug-{123,124,126,141,142,143,144,212,213,252,253,265,280}-*and the ABI literal inharvest-bug-803-disk-facet-roundtrip.test.tsbumped tov13(required by the documented "bump ABI when harvest semantics change" rule).Known follow-ups NOT covered here:
- BUG-253 is fixed at the emit boundary only;
env.globalsstill carries promoted members becauseharvest-bug-807-method-two-pathsandharvest-bug-808-promoted-optional-memberassert exactly that shape. harvest-disk.tsstill swallows harvest failures (catch { h = null });PackageHarvesthas no diagnostic channel.- Core-side residual risk:
absKeyremains exponential on shared DAGs, soabsFingerprint(generic instantiations) and other core callers still pay it.
追加:BUG-253 完整修法(源头消除幽灵全局)
上一版只在出口(
emitEnvModule)过滤提升出来的成员——收割面的env.globals仍留着幽灵名字。现按条目「修复方向」在源头消除:harvest-dts.ts的materialize只对模块作用域的值位置声明提升成员 (p.scope.moduleName !== undefined);顶层export declare const o: Opts;的p.scope是全局作用域 ⇒ 不提升,成员只在接口内部 / brand 面可见。 这正是@types/lodash泄漏 60 个方法名(clone/isEqual/now…)的形态。- 提升路径本身不受削弱:模块作用域形态(
@types/node24path、lodashLoDashStatic的declare module形态)照旧提升。
已有测试更新(原先钉住的是顶层提升这一错误行为,已按条目口径改为模块作用域):
harvest-bug-807-method-two-paths.test.ts(fixture 包进declare module; 断言改env.modules.*)harvest-bug-808-promoted-optional-member.test.ts(同上)harvest-bug-977-optional-method-member.test.ts(同上)harvest.test.ts的「interface augmentation merge (lodash LoDashStatic)」 (合并仍生效,但成员落在模块面;新增「不得成为裸全局」断言)harvester-bug-253-promoted-not-emitted-globals.test.ts(由「收割面仍保留、 出口过滤」改为「收割面即不产生」)
新增回归:
harvester-bug-253-ghost-globals.test.ts(顶层不提升 / 模块作用域提升 / 接口单声明基线三向对照)。tmp/verify-bug.sh BUG-253→ exit 1。 - BUG-123: promoted interface members are tagged and excluded from
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [206713f]
-
Updated dependencies [0650ef0]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
-
Updated dependencies [afd7c36]
- @nudojs/core@1.17.2
- @nudojs/parser@1.5.6
- @nudojs/env@0.5.6
0.4.5
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
- @nudojs/env@0.5.5
- @nudojs/parser@1.5.5
0.4.4
Patch Changes
- Updated dependencies [f1d4958]
- Updated dependencies [0438f10]
- Updated dependencies [6ebf5a4]
- @nudojs/env@0.5.4
- @nudojs/core@1.17.0
- @nudojs/parser@1.5.4
0.4.3
Patch Changes
-
b4768ca: 族 27 修复 H1a:Bug 797 798 816 821 822 823 —— 条件类型的
extends判定改成三分支(真 / 假 / 判不出):字面量按值比(number extends 1不再恒真)、brand 按结构比(同名之外不再确定判假)、keyof/typeof/ 未解析类型判不出时不取支;infer的括号穿透 + 绑定替换真支;条件元数据按条目隔离(不再从上下文级单槽泄漏进下一条签名 ⇒ 逐字相同的两条声明不再得到不同类型,冷 / 热缓存不再翻转结论);真支是嵌套条件类型时递归求值(不再被infer变量顶替)。 -
b4768ca: 族 27 修复 H1b:Bug 799 / 800 / 802 / 803 / 810 / 811 / 819 / 829 / 830 —— 泛型 / 交叉 / 元组 / 索引 / 类型字面量的收割面与 TypeScript 真实语义对齐:交叉类型合并两侧成员、泛型别名按类型实参实例化、元组逐槽映射、
Record/ 索引签名建成开放对象、方法类型形参按作用域遮蔽外层同名形参、内联类型字面量的访问器成员可读、构造签名带ctor面、调用签名投影成 fn、落盘产物保留泛型 α 的 var term。 -
b4768ca: 族 27 修复 H2:Bug 791 · 805 · 806 · 812 · 813 —— 泛型实例化按实参身份分桶、 接口成员重载集全部保留、递归类型别名改按引用建模(不再指数展开)、 递归 interface 的自引用不再铸成闭合空 brand、类型形参默认值生效。
Bug 791 — 泛型实例化缓存键只编码实参个数 ⇒ 同一接口的不同类型实参命中 同一条缓存 ⇒
Box<number>被折成Box<string>(Box<number>.value收割成string)。缓存键改成编码类型实参的身份(Abs 结构 + α term 身份)⇒ 不同 实参 ⇒ 不同实例;同一实参 ⇒ 仍然命中缓存(同一个 Abs 实例对象)。Bug 805 — 接口成员的重载集只保留第一个 overload ⇒ 其余 overload 的返回 类型被整体抹除(
m(a: number): string; m(a: string): number收割成(number) => string⇒ 假红 + 假绿,与 TS 完全倒置)。重载集现在全部保留: 参数位逐位 union(复用顶层函数路径的mergeOverloadParams,Bug 827 同族), 返回位取 union(带 α 的返回优先)⇒ 与 materialize 的 fn 分支同口径, 同一实体两条收割路径不再分叉。Bug 806 — 递归类型别名按 depth 硬展开 ⇒ 展开 8 层且指数级(6 个 自引用成员 ⇒ 54,083,943 字节的 env 模块)⇒ 末层折成
unknown。递归别名改成 惰性/引用式建模:别名登记成合成 interface(成员面照搬类型字面量),自引用点 经实例化路径落到「按名引用 + 形状待定」的 brand ⇒ 不再内联展开。同一夹具现在 5,176 字节(≈ 10,000× 更小),且互引别名(type A = { b: B }; type B = { a: A }) 同样被识别为递归。Bug 812 — 递归 interface 的自引用被铸成空 brand(
absBrand(name, {})) ⇒ 那是闭合空对象 = 「该对象确定没有这个成员」⇒ 成员读走「槽位缺失 ⇒ exact undefined」⇒ 合法代码被判「定抛 TypeError」(L2 门禁假红)。自引用改成 「按名引用 + 形状待定」(shape: unknown)—— 与落盘面(emitAbs早已如此) 同口径 ⇒ 收割面 / 磁盘往返面 / 落盘发射面给出同一个类型。Bug 813 — 泛型类型形参默认值从不读取 ⇒ 无参引用(
Box对interface Box<T extends string = string>)留下未绑定 α ⇒ 引擎侧「未绑定 α」= 无约束值 ⇒ 其上的方法调用被建模为定抛 TypeError(假红)。现在按 TS 语义取 值:显式实参 > 默认值 > 约束 > 推断unknown(不再留未绑定 α)。⚠️ 已知残留(core 侧,本次不改):Bug 805 的重载在调用点仍无法按实参类型选 arm —— Abs 的 fn 形状没有 overload 集合的承载位,收割面只能给 union 返回 ⇒
union方法分派的保守性(string 分支也参与toFixed分派)仍会让iov.m("hello").toFixed(0)报 may-throw(与顶层函数路径的 Bug 827 同款残留, core 冻结,本次不消)。 -
b4768ca: 族 27 修复 H3:Bug 792 807 808 809 831 832 977 —— 收割面的接口成员表与 TypeScript 对齐:限定名类型引用不再并入其它命名空间的同名接口(792)、同一接口方法在 brand 面与模块级提升面是同一个类型(807)、提升时保留
?可选标记(808)、extends的继承成员并入实例模型(809)、接口成员提升不再抢真实导出的名字也不产生幽灵导出(831)、计算成员名[Symbol.iterator]保留(迭代协议不再整体丢失,832)、可选方法成员与可选属性同口径保留可省性(977)。 -
b4768ca: 族 27 修复 H4:Bug 814 · 815 · 817 · 818 · 820 · 824 · 827 —— 收割面不再丢 导出形式(
export default/export { X as Y }/export = X/export * from), 导出表不再随.d.ts遍历顺序变,重载集不再塌成「第一个 overload 的参数 + union 返回」。Bug 814 —
export default不在模块导出表里 ⇒ 默认导入落unknown(假警告); 默认导出的局部名被当成具名导出(假绿:TS 侧是 TS2614,引擎侧解析成功)。export default function foo()/export default class Foo {}的导出名改成default(局部名不再进导出表);export default <局部名>解析到该局部绑定的值。
Bug 815 —
export { X as Y }(本地改名再导出)被整条丢弃 ⇒ 改名后的导出 根本不存在(假警告)。现在改名后的导出名进导出表,值取局部绑定。Bug 817 —
export * from的别名应用是整记录替换(!ctx.modules[alias]守卫) ⇒ 有自有声明的模块把星号再导出的名字整批丢掉。别名改成与模块自有声明 合并(自有优先),多目标(export * from "a"; export * from "b";)也合并; 纯别名仍与目标共用同一条记录(落盘面继续去重)。Bug 818 —
declare module "x" { export = <本地类/常量> }⇒ 整个模块记录不生成 (ctx.skipped++静默丢弃)。现在模块记录生成、default= 被导出实体的值; 解析不出来时计入skipped(汇总行有信号)。按 TS 语义(export =的类只能默认导入, 具名导入是 TS2595)不生成具名导出。Bug 820 —
export { X }的「是不是值」判定发生在 Phase 1 ⇒ 模块导出表随.d.ts遍历顺序变(同一份声明换个文件顺序就少一个导出)。判定挪到物化阶段 (符号表完整时)⇒ 导出表逐项相同、与遍历顺序无关。类型位导出 (export type { X }/export { type X })不产生运行时值,计入skipped。Bug 824 — 模块级
.d.ts顶层的 CJSexport = X整个被丢弃 ⇒ 该包没有default导出 ⇒ ESM 默认导入(import _ from "pkg")落unknown+ 假警告。 现在顶层export = X进default导出(值 = X 的值),桥接层把它提升成包的default导出。Bug 827 — 顶层函数的重载集塌成 union 返回(参数只取第一个 overload)。 参数位改成保留每个 overload 的参数类型(逐位 union;参数个数不同或带泛型 α 时保持原样),返回位仍是各 overload 返回类型的 union ⇒ 重载集不再在收割产物里 被抹掉。
⚠️ 已知残留(core 侧,本次不改):
convert(1).toFixed()的 L5 假红还需要 core 侧「按实参形态选 overload arm」的 dispatch(Abs 的 fn 形状目前没有 overload 集合的承载位)+ union 方法分派只认string成员(Bug 771 / 263)—— 收割侧 无法单独消掉该假红,详见交付报告的「越界发现」段。 -
b4768ca: 族 27 修复 H5:Bug 793 · Bug 794 · Bug 796 · Bug 804 · Bug 826 —— 声明采集 丢实体 / 元数错位 / 可构造性未知(收割面)。
Bug 793 — 顶层
declare namespace的运行时成员被摊平进 globals ⇒ harvester 凭空造出全局(declare namespace Foo { function bar() {} }⇒ globals 里多出一个不存在的bar)⇒ 并抑制了对应的 ReferenceError 诊断 (裸bar()被当成有定义;tsc --strict对同一份代码报 TS2304)。harvest-dts.ts的collectStatement:namespace分支改为把运行时成员收进 命名空间自有的记录(Scope.nsRec),并挂一个命名空间对象Foo(成员在Foo.bar面)⇒ 不摊平进 globals。recordFor命中scope.nsRec⇒ 命名空间成员落在自己的记录里;scopeKey把命名空间链计入作用域键 ⇒ 两个命名空间的同名成员不会被当成 overload 合并。- 只有类型(interface / type)的命名空间不产生运行时对象 ⇒
declare namespace _ { interface X {} }不会凭空多出一个全局_。 - 模块作用域(
declare module "x" { namespace Y { … } })保持既有口径 (成员摊平进模块记录):export = ns的模块(@types/node 的 path / fs) 正是这个形态。
Bug 794 —
this形参被当普通形参收割 ⇒ 元数错位(arity +1, 第一个真实实参被绑到this槽)+ 契约草稿凭空多一个必填参数。harvest-dts.ts的signatureToFnSig跳过this形参(TS 把它建模成 名字为this的普通 ParameterDeclaration,不显式跳过就与真形参无法区分)。classValueAbs的构造器参数同口径(跳过this形参)。- 草稿面(
dts-contract-draft.ts)不在本片区间:对应改法见交付报告。
Bug 796 —
declare class的实例成员整体丢失(declare class的instanceFor拿到空壳 ⇒ 展开成空 obj)+const p: Point这个绑定从 globals 彻底消失。harvest-dts.ts的interfaceDeclsOf放宽为「interface 或 class」 (成员收集器本来就写好了类支持,只是被一道isInterfaceDeclaration过滤 挡在门外);返回类型随之放宽为NamedTypeDecl[]。registerTypeDecl对 class 也登记限定名(命名空间里的 classNodeJS.Process的实例面可解析)。
Bug 804 — 映射类型 / 模板字面量类型 / 索引访问类型(以及
keyof/typeof)落unknown后,declare const整条绑定被丢弃 ⇒ 用户代码引用 它时被判「确定抛 ReferenceError」(L2 假红;tsc --strictexit 0)。harvest-dts.ts的materializevar 分支:类型判不出时保留绑定(值为unknown)——「类型未建模」是降级(值域未知),不是「符号不存在」⇒ 不再计入skipped(丢了才计入)。
Bug 826 — 收割的
declare class类值没有ctorfacet ⇒new X()被判「可能抛 TypeError(可构造性未知)」⇒ L2 假红。harvest-dts.ts的classValueAbs:类值走absCtorSig(带ctor: truefacet)—— core 的new路径按 callee 的ctorfacet 判可构造性。harvest-to-abs.ts的harvestedValueToAbs:mock 化时透传ctorfacet(否则又变回「可构造性未知」)。
-
b4768ca: 族 27 修复 H6:Bug 795 · Bug 828 · Bug 836 —— 落盘面保留
bigint/symbol原语(不再降级unknown)+ 导出表 / 模块记录表改用无原型字典(撞Object.prototype成员的导出不再整条丢失、declare module "__proto__"不再 污染Object.prototype)。Bug 795 —
emitEnvModule只认number/string/boolean三个原语,bigint/symbol一律降级成unknown⇒ 同一份.d.ts,内存收割与 落盘产物给出不同答案(内存面是(bigint) => bigint,落盘面是(unknown) => unknown)。harvest-dts.ts的emitAbs(落盘渲染)补bigint/symbol分支 ⇒ 与 内存面(mapType→absPrim)同口径;磁盘投影(harvest-json.ts)本来就 带这两个原语 ⇒ 这次补的是发射器与磁盘格式之间的能力缺口。harvest-json.ts的harvestSigToAbs去掉骗人的sig.type as "number" | "string" | "boolean" | "bigint"硬转:改成白名单 校验(bigint/symbol都保留,未知原语标签诚实降级成unknown)。
Bug 828 — 导出表 / 成员表用普通对象 + 原型链裸读裸写 ⇒ 名字撞
Object.prototype成员的导出(toString/valueOf/hasOwnProperty/constructor/__proto__)整条静默丢失,而stats.skipped仍是 0 ⇒ 端到端 L2 假红(tsc --strictexit 0 的代码报 may-throw + unknown-inference)。harvest-dts.ts的recordFor:globals/ 模块记录表改用Object.create(null)(无原型 ⇒ 只有自有键可见,__proto__只是普通 数据键),并用Object.hasOwn判定「已有记录」⇒ 去重裸读不再命中原型成员。harvest-json.ts的序列化 / 回放路径同样改用无原型表(模块名 / 导出名 / 对象槽名撞原型成员时不再被吞)。
Bug 836 —
declare module "__proto__"让收割器把导出直接写到Object.prototype上 ⇒ 进程级原型污染(分析进程里每个普通对象都多出 该成员)+ 该模块记录从表里消失。harvest-dts.ts的recordFor:模块记录表无原型 + own-property 判定 ⇒ 模块名__proto__/constructor读到的是自己的记录而不是Object.prototype/Object⇒ 不再写穿原型链,模块记录也不再消失。harvest-dts.ts的emitKey:__proto__改用计算属性名 (["__proto__"])——对象字面量里的__proto__: v(即便带引号)也会触发[[SetPrototypeOf]]⇒ 成员丢失 + 字面量原型被改写。
-
b4768ca: 族 27 修复 H7:Bug 833 835 1014 —— 包根解析改为「包自带 types 优先、
@types最后回落」;包名键只由该包自己的顶层导出占(模块记录不再占包名键),子路径说明符不再回落到包名键;ambient 声明(declare global/ script 模式.d.ts)不再被提升成包名键的具名导出。 -
b4768ca: 族 27 修复 H8a:Bug 801 / 916 / 945 / 1011 / 1012 / 1013 ——
contract --from-dts的草稿面类型语义与 TypeScript 对齐:- 801:TS 的
null不再映射成any()(契约是空的 ⇒ 假绿)⇒ 映射成真 null 面(union(…, null));undefined同理;约束位(导出顶层 / fn 返回位)上的裸字面量包一层union(…)⇒ 草稿抄进侧车后仍是真约束。 - 916:
Promise<T>不再剥掉 Promise 外壳(剥掉 ⇒ 契约先天不可满足 ⇒ 假红,且与收割面相反)⇒ 该位无约束 + 如实标注丢失(与收割面保留eff/promise同口径)。 - 945:类型字面量里的方法签名成员不再被丢(丢了 ⇒ 契约被悄悄放宽 ⇒ 假绿 TS2345)⇒ 进契约为
fn(…);数字键成员同样保留。 - 1011:同文件的
type别名被解析(不解析 ⇒string降成any()⇒ 零义务假绿)⇒type Id = string⇒string();interface同样展开成 shape。 - 1012:
Partial<T>的字段变可选(原样透传 ⇒ 比 TS 更严 ⇒ 假红)⇒partial(shape({…}))。 - 1013:
Record<K,V>的值域落到实现(键为字面量集合时 ⇒shape({ a: number() }));键非字面量时契约 DSL 无索引签名 ⇒ 如实降级(不再写「注释宣称有值域」的假声明)+ 标注「值域未建模」+ 计入skipped。
- 801:TS 的
-
b4768ca: 族 27 修复 H8b:Bug 825 · 834 · 960 · 1003 · 1015 —— 草稿面(
nudo contract --from-dts)不再静默丢导出 / 说谎的汇总行 / 产出语法非法的草稿。Bug 825 — 重载集静默塌成第一个 overload ⇒ 草稿少声明签名,且被丢掉的 overload 不计入
skipped⇒ 汇总行看不出任何丢失。现在重载全部保留 (返回位取全部 overload 的 union,与收割面同口径),每条 overload 的签名写进 note(审阅者看得见「这里本来有 N 条」),被合并掉的 overload 逐条计入stats.skipped。Bug 834 — 带引号 / 连字符的属性键产出语法非法的草稿 ⇒ 抄进
*.nudo.js后 sidecar 加载失败 ⇒nudo check门禁由绿转红(exit 1)。属性键现在走 合法转义(JS 标识符 / 字符串字面量两种合法形态);__proto__走计算属性名 (对象字面量里的__proto__: v即便带引号也会触发[[SetPrototypeOf]]⇒ 成员从 字面量里消失)。Bug 960 — 5 类运行时导出(
export {x} from/export * from/enum/namespace/ 匿名export default function)整条丢弃,且汇总行报「0 skipped」⇒ 丢失零信号;而同一 harvester 的收割面看得见Color(enum) ⇒ 两个产物面自相 矛盾。现在 5 类导出全部进草稿(enum/namespace投影成运行时 shape;再导出 逐个 push + note);投影不了的也要push({name, note, kind})⇒ 进stats.skipped⇒ 汇总行说真话。Bug 1003 — 具名 default 导出被写成本地名键 ⇒ 草稿键
helper≠ 模块导出名default⇒ 照抄进侧车后该导出永远零义务(假绿),而汇总行报「0 skipped」。 现在 default 导出的草稿键恒为default⇒ 抄进侧车后绑定的是模块的default导出(实测impl(x: number) => string;改前是impl(x: any) => string+nudo:interface-entry-only)。Bug 1015 — 目录模式静默只投影前 16 个
.d.ts⇒ 第 17+ 个文件的导出整条 不存在,而汇总行报「16 d.ts · 0 skipped」。现在目录模式投影全部.d.ts; 遍历不到的地方(读失败 / 深度上限)如实计数 ⇒ 汇总行说真话。 -
1b08a18: 族 27 修复 S4:Bug 1054 —— TS 类型谓词的返回类型不再被收割成
unknown。mapType的类型节点分派表没有TypePredicate分支 ⇒x is T/asserts x is T落进兜底分支(default: return absUnknown())⇒ 被谓词的签名返回面变成unknown:- 调用方的签名面随之变成
unknown⇒ 触发nudo:unknown-inference误导诊断 (把「谓词返回 boolean」说成「推断失败」,并把用户引向@nudo:case/ env mock / refine —— 而真正要修的是收割器); - dts 产物写
unknown⇒ 消费方 tsc TS2322 假红(const b: boolean = f(x))。
修法(同一张分派表上补分支,不另起一套):按 TS 运行时语义映射返回面 ——
x is T⇒boolean(T是收窄信息,是调用点的副作用,不是返回面);asserts x is T/asserts x⇒void(断言函数运行时返回undefined, 与: void返回同口径)。覆盖顶层函数、接口方法签名、函数类型(type literal)三条路径。 - 调用方的签名面随之变成
-
b4768ca: 族 27 收口接线:让三个产物面(内存收割面 / 磁盘缓存面 / 落盘源码面)与 两个产物面(收割面 / 草稿面)在同一份
.d.ts上给出同一个类型。磁盘 ABI v8 → v9 → v10 ——
HARVEST_DISK_ABI随收割语义抬版本。不抬则 用户本地~/.cache/nudo/deps/里的旧收割产物会继续命中 ⇒ CLI 看不到本轮 修复(实测:同一夹具,旧缓存 ⇒useDefault(xs: any) => unknown)。 v10 覆盖收口时又改的三处语义:this形参不再进收割签名(Bug 794)、declare class进入接口成员表并带ctorfacet(Bug 796 / 826)、顶层declare namespace的运行时成员收进命名空间自有记录(Bug 793)。磁盘投影补 facet ——
HarvestSig此前只投影params/returns,把obj的索引签名与开放标志、tuple的 rest、fn的ctor与静态槽全部 丢掉 ⇒ 缓存往返把「开放对象 + 值域」抹成闭合空对象(成员读 undefined ⇒ 定抛)、把「构造器」抹成普通 fn(new落「可构造性未知」⇒ 假红)、把类型 字面量的具名成员抹掉。absToHarvestSig投影 +harvestSigToAbs还原两侧 同时补齐。磁盘投影补条件元数据 ——
fn形态加inferFrom/condFallback:条件 类型判不出时的绑定线索与假支此前不投影 ⇒ 缓存命中后条件元数据丢失 ⇒ 同一份.d.ts,冷缓存与热缓存给出不同类型(实测:改前冷 ⇒callCond()返回0,热 ⇒any;改后冷 / 热完全一致)。落盘源码面补
ctor/ 静态槽 ——emitAbs的fn分支此前只发relationFn([...], ret, { conf: "exact" }),把 facet 全丢 ⇒ 走落盘 env 模块 时new X()判「可构造性未知」。用 IIFE 在relationFn之后补 facet(不改 core 冻结面)⇒ 三路径同型。草稿面
this形参跳过 ——dts-contract-draft.ts的参数收集此前把this写成必填实参位 ⇒ 草稿元数 +1(第一个真实实参被绑到this槽)。 判据同收割面。草稿面接口 heritage 展开 ——
extends基接口的成员进草稿(带环保护)。CLI 汇总行接
droppedDirs——nudo contract --from-dts <目录>的目录 模式只取dtsPathToContractDraft的files、丢掉它的 stats ⇒ 「遍历不到的目录」不出现在汇总行 ⇒ 汇总行报「0 skipped」而实际丢了东西。 现在并进skipped。 -
5fd3cbb: fix(harvester): 草稿面(
nudo contract --from-dts)8 条与收割面同源(族 51)harvester 有两面:收割面(
harvest-dts.ts→ Abs)与草稿面 (dts-contract-draft.ts→*.nudo.js草稿)。台账族 27 记了 8 条草稿面的 纯缺口(收割面已修、草稿面没跟上)⇒ 同一份.d.ts,收割面说得准、草稿面说不了 (草稿比 TS 松,不是假红,但用户拿到的是残缺草稿);共同症状是 静默降级成any()/ 丢成员,而汇总行不说谎 ⇒ 用户看不出草稿缺了什么。本次只改草稿面(
packages/harvester/src/dts-contract-draft.ts),逐条照搬收割面 (harvest-dts.ts)的既有正确处理:- 条件类型:新增
ConditionalTypeNode分支 ⇒ 判不出时取两支并集 (收割面mapConditionalType同口径),extends unknown的恒真形态只取真支; 不再整条降级any(),且降级明确可见(note ⇒ 计入skipped)。 - 计算成员名:
memberKey按收割面computedMemberName同口径认Symbol.iterator→@@iterator/Symbol.asyncIterator→@@asyncIterator/ 计算键的字符串字面量 ⇒ 不再整条丢弃;不可静态判定者留 note ⇒ 部分丢失时汇总行也看得见(此前只在「全部成员被丢」时才发 note)。 extends基接口成员:collectSymbols按限定名登记(命名空间内的 interface 登记为A.Opts),interfaceMembers按限定名解析基类 ⇒ 基接口成员进草稿,且A.Base与B.Base不互相并入。- 命名空间限定名:
A.Opts能解析(此前只有短名桶 ⇒ 降级any())。 - class 构造器签名:投影为类值的构造器 fn(收割面同款:类值 = 构造器)
⇒
new Thing(…)不再零义务;该条计入skipped(契约 DSL 无new语义 ⇒ 需人工审阅),汇总行不再说谎。 - ambient module 体:
declare module "x" { … }/declare global { … }的体被遍历 ⇒ 内部导出进草稿且计数(此前整块不可见也不计数)。 - 重载 arity:元数相同 ⇒ 形参按位合并(并集,不比 TS 更严,
收割面 Bug 827 同口径);元数不同 ⇒ 仍取首个 overload(改成最宽会让
f("a")变成「参数不够」⇒ 假红)但明确标注窄口径(note 写明 arity 与 「多参调用不在覆盖内」)。 - 跨文件再导出 / 跨文件导入的类型:名字可见、降级可见且计入
skipped(类型需模块解析器 ⇒ 本片无法闭合,已如实标注为剩余缺口)。
草稿面不比 TS 更严(新投影只会更宽:并集 / 可见降级),负控形态(与族 51 无关的 声明)的草稿输出逐字不变;既有金标全绿(
packages/harvester72 个测试文件 / 344 例)。 - 条件类型:新增
-
5fb8a51: 族 52 修复(片 W2):harvester 收割面的 7 条残留 —— ①非限定类型引用按「引用点所在命名空间」解析(
A.Opts与B.Opts不再互相并入;792 残留);②extends的基接口按基声明分别代入类型实参(interface D extends Base<number>⇒ 基成员v是number,不再是 α);③条件类型按绑定实参求值真支(嵌套条件类型给出精确的"s"/"n"/"x",不再给并集);④泛型实例化顺序反转(成员在类型实参的作用域里映射 ⇒Box<Promise<string>>的payload是string,不再是 α);⑤模块作用域的命名空间不再摊平进模块记录(declare module "x" { namespace Y { … } }⇒import { bar } from "x"不再错误解析成功,与 TS 的 TS2305 同口径;export = ns的模块导出面仍摊平 ⇒ @types/node 的node:path等真实包零回归);⑥「类型未建模」进stats.degraded(可选字段,降级 ≠ 丢了;没有降级时stats形状逐字不变);⑦匿名默认导出(export default function (): void;/export default class { … })不再被丢掉 ⇒ 模块的default导出在,不再计入skipped。磁盘 ABI v10 → v11 ——
HARVEST_DISK_ABI随收割语义抬版本(①②③④⑦ 任一条都会让 旧缓存的物化结果与新收割器不一致 ⇒ 旧缓存必须 miss,否则用户本地~/.cache/nudo/deps/里的旧收割产物会继续命中 ⇒ CLI 看不到本轮修复)。 -
dde4b03:
nudo contract --draftnow writes a draft that can be copied into a sidecar as-is: the sidecar key is the module's export identity, the file is always valid JavaScript, the return obligation never contradicts the function's own inferred return domain, and a draft the user has edited is never silently overwritten.- The draft's sidecar key came from the analysis name, sanitized into a
legal identifier. An anonymous
export defaulttherefore got the synthesized key_default, while the key that actually binds isdefault— copying the draft into*.nudo.jsleft the contract in place but inert, andnudo checkstayed green on a call that violated it. The key is now the export identity (the same source asnudo contract --emit), and an unsafe binding name is emitted in the alias formconst _nudo_N = …; export { _nudo_N as <identity> };. - The builder
importand the generatedexport const <name>shared one module scope, so a function whose name is a builder name (number,lit,union, …) producedimport { number } from "@nudojs/core"next toexport const number = …— a parse-timeSyntaxError: Identifier 'number' has already been declared. The generated file was not valid JavaScript, so the "copy the accepted exports into the sidecar" step could only produce a broken sidecar. The same collision is fixed in the--from-dtsdraft. - A rest parameter (
...rest) was rendered into the constraint DSL verbatim ({ first: number(), ...rest: number() }), which is neither a legal object literal nor legal DSL: copying the draft broke the whole sidecar (nudo:interface-load), losing every contract in the file. Rest-parameter functions are now reported asnot-projectableand skipped, and every draft is assembled once (execNudoModule) before it is written — a draft that does not load is never handed to the user. - The return obligation was derived only from the observed call sites,
which are a subset of the function's real return domain:
opt(flag)returning1 | nullwas drafted asfn({ flag: boolean() }, number()), so accepting the draft made the function violate its own draft. The obligation is now checked against the inferred return domain (the same source as thenudo checksignature) and is not written when it does not cover it. --draft --writeoverwrote a hand-edited*.nudo.draft.jswithout a word, while the file's own header claims "Handwritten contracts are never overwritten". Drafts now carry a content fingerprint; a draft whose content no longer matches its fingerprint is kept as-is and the command reports that it was not overwritten.
- The draft's sidecar key came from the analysis name, sanitized into a
legal identifier. An anonymous
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [7fea13a]
-
Updated dependencies [a1c093f]
-
Updated dependencies [9f26414]
-
Updated dependencies [67abd92]
-
Updated dependencies [3d66f5a]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
- @nudojs/core@1.16.0
- @nudojs/env@0.5.3
- @nudojs/parser@1.5.3
0.4.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
- @nudojs/env@0.5.2
- @nudojs/parser@1.5.2
0.4.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
- @nudojs/env@0.5.1
- @nudojs/parser@1.5.1
0.4.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- aae0f96: Fix stale-cache windows in cache keys and session eviction.
nodeHarvestCacheKeyflooredmtimeMsto whole seconds (same-second, same-size rewrites of@types/nodereused a stale harvest — now uses the raw float mtime, matching the repo-widemtimeMs+sizestrict-equality contract). The path-env cache key/validation only comparedmtimeMs(coarse-mtime filesystems could keep serving a staledefineEnvfactory and re-register it, self-perpetuating — nowmtimeMs+size, and the direct-import URL query carriessizeso the ESM module cache can't replay old content). The path-env fallback copy filename hashed onlypath:mtime— rewritten content now hashes into the filename so a changed file gets a new URL and the ESM cache invalidates naturally. Harvest caches (harvestCache, node not-found cache) had no production eviction —clearAnalysisSessionCaches()now clears both, sopnpm install/ watcher rounds see upgraded or newly installed@typeswithout a process restart.checkMemoKeynow normalizesfilePathviastablePathKey(same file no longer occupies two entries under different path shapes). - 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every
existsSync(p) && statSync(p)double call (TOCTOU race + errno swallowing) with a singlestatSync(p, { throwIfNoEntry: false })per the repo's load-module convention: ENOENT stays a silent miss, EACCES/EIO surface via the site's error channel (top-level catch,reports.push({error}), exit-1 message, or a logged warning) instead of masquerading as "file absent". Read-failure catches now branch one.code: sidecar contracts unreadable for reasons other than ENOENT print awarning: cannot read sidecar contract …incheck/check --fix(no more silent contract-blind green runs);@nudo:mockseed evaluation failures warn inexportbefore degrading;pnpm-workspace.yamlread failures other than ENOENT abortmigrate(a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read reportread-failedwith the errno instead of the misleading "Mock file not found"; npm entry probes and LSP module-candidate stats log persistent failures instead of degrading a package's export face to unknown or silently breaking go-to-definition;contract --from-dtspath-like arguments that don't exist now error aspath not foundinstead of being treated as npm package names ending in a misleadingno .d.ts files found. - Updated dependencies [aae0f96]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
- @nudojs/parser@1.5.0
- @nudojs/env@0.5.0
0.3.28
Patch Changes
- Updated dependencies [c19bd48]
- Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
- @nudojs/parser@1.4.24
- @nudojs/env@0.4.42
0.3.27
Patch Changes
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
- @nudojs/env@0.4.41
- @nudojs/parser@1.4.23
0.3.26
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
- @nudojs/env@0.4.40
- @nudojs/parser@1.4.22
0.3.25
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
- @nudojs/env@0.4.39
- @nudojs/parser@1.4.21
0.3.24
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
- @nudojs/env@0.4.38
- @nudojs/parser@1.4.20
0.3.23
Patch Changes
- Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
- @nudojs/env@0.4.37
- @nudojs/parser@1.4.19
0.3.22
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
- @nudojs/env@0.4.36
- @nudojs/parser@1.4.18
0.3.21
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
- @nudojs/env@0.4.35
- @nudojs/parser@1.4.17
0.3.20
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
- @nudojs/env@0.4.34
- @nudojs/parser@1.4.16
0.3.19
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
- @nudojs/env@0.4.33
- @nudojs/parser@1.4.15
0.3.18
Patch Changes
- Updated dependencies [334b914]
- Updated dependencies [94197eb]
- Updated dependencies [b8db17b]
- Updated dependencies [5e275df]
- @nudojs/core@1.10.0
- @nudojs/env@0.4.32
- @nudojs/parser@1.4.14
0.3.17
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
- @nudojs/env@0.4.31
- @nudojs/parser@1.4.13
0.3.16
Patch Changes
- Updated dependencies [b6495c6]
- Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
- @nudojs/env@0.4.30
- @nudojs/parser@1.4.12
0.3.15
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
- @nudojs/env@0.4.29
- @nudojs/parser@1.4.11
0.3.14
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
- @nudojs/env@0.4.28
- @nudojs/parser@1.4.10
0.3.13
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
- @nudojs/env@0.4.27
- @nudojs/parser@1.4.9
0.3.12
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
- @nudojs/env@0.4.26
- @nudojs/parser@1.4.8
0.3.11
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
- @nudojs/env@0.4.25
- @nudojs/parser@1.4.7
0.3.10
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
- @nudojs/env@0.4.24
- @nudojs/parser@1.4.6
0.3.9
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
- @nudojs/env@0.4.23
- @nudojs/parser@1.4.5
0.3.8
Patch Changes
- Updated dependencies [d6fa067]
- Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
- @nudojs/env@0.4.22
- @nudojs/parser@1.4.4
0.3.7
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
- @nudojs/env@0.4.21
- @nudojs/parser@1.4.3
0.3.6
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
- @nudojs/env@0.4.20
- @nudojs/parser@1.4.2
0.3.5
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
- @nudojs/env@0.4.19
- @nudojs/parser@1.4.1
0.3.4
Patch Changes
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
- @nudojs/parser@1.4.0
- @nudojs/env@0.4.18
0.3.3
Patch Changes
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [a00bccc]
- Updated dependencies [39332ca]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [446914f]
- @nudojs/core@1.7.2
- @nudojs/parser@2.0.0
- @nudojs/env@0.4.17
0.3.2
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
- @nudojs/env@0.4.16
- @nudojs/parser@1.3.2
0.3.1
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
- @nudojs/env@0.4.15
- @nudojs/parser@1.3.1
0.3.0
Minor Changes
-
2f9717b: repo-wide correctness batch (fix-10: 19 fixes + 3 design-defect fixes)
Security & correctness:
- type-expression AST whitelist blocks @nudo:case/@nudo:as RCE (P0)
- unified export/binding-name sanitization (reserved words / collisions)
- slot & export tables read via own-property, blocking Object.prototype members
Type system:
- tuple rest slot effective across leq / widen / runtime / schema / dts
- x++/x-- propagate term/pred/Φ constraints from the same source as +=/-=
- key-channel literals distinguish -0/0 (litKeyString)
- projection/format exits unified under ProjectionBudget: cycle & depth truncation observable
CLI gates & contracts:
- health --from path errors fold into pathErrors; ok↔exit single source
- migrate verify/health pass skips, judged same as nudo check
- malformed JSDoc directives no longer silently dropped / line-swallowed / host-throwing
- case-arg recursion depth cap 32 (DoS protection)
Service layer:
- cache-limit precedence explicit > env > project; env params take effect per call
- session LRUs aligned with BoundedLruMap (overwrite refreshes position; max=0 read miss)
- module-cache entries carry subtree content fingerprints; transitive invalidation cohesive (DESIGN-002)
- sidecar contract identity = export name, binding name aliasable; reserved-word / string exports emitted safely (DESIGN-003)
- @nudo:import alias lookup uses the original export name; miss reports a diagnostic
Parsing & diagnostics:
- eval diagnostics cover rest / default-value / named-expression declarations and computed-key references
- ambient sidecar lookup includes .nudo.mjs; suffix set single source of truth
S2/S5/S6 tracking batch (BUG-017–028):
- type inference: collectPredVars collects assumeFinite constraints; eqLit channel tagged (eq(x, lit(undefined)) projectable); non-finite bounds (NaN/±Infinity) not projected; fn rest non-array types promoted to (T)[]; optional param names keep
? - gates & CLI: check --fix preserves gate semantics (residual errors exit 1; flag combos are usage errors); variadic flags swallowing positional args → targeted usage error +
--terminator; export on the PathError face (nudo:path-* + nudo:path-io); findProjectConfig parse-failure diagnostic + stop - eval engine: injection-table collection exceptions fail-closed (never a half table); same-name class collision epoch detection + fallback observation; EvalCallRecord.threw required + bridge fail-closed (omitted threw → throwsAbs unknown); tryEvalCall explicit isAbsVal guard
- LSP / error face: validateText document version gate (stale analysis never published); diagnostic / agent error message absolute-path redaction (home→~, root→.); injection setup failure surfaces and blocks exit
- observation face: standard-schema missing-key vs explicit-undefined distinction; dts projection optional param names, fn rest TS validity
PR #80 review batches (merge 7e6051ae):
- own-property reads across sidecar import/export tables and the modules table; emit-identity dedup; quote-aware sidecar binding scan; check injection-failure gate (no fake-green --json exit, no degraded cache write); class-collision epoch scoped to the entry-call phase; LSP error redaction with real workspace roots; health --from requires explicit paths
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
- @nudojs/parser@1.3.0
- @nudojs/env@0.4.14
0.2.19
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
- @nudojs/env@0.4.13
- @nudojs/parser@1.2.1
0.2.18
Patch Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
-
Updated dependencies [f10066d]
- @nudojs/core@1.4.0
- @nudojs/parser@1.2.0
- @nudojs/env@0.4.12
0.2.17
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
- @nudojs/env@0.4.11
- @nudojs/parser@1.1.9
0.2.16
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
- @nudojs/env@0.4.10
- @nudojs/parser@1.1.8
0.2.15
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
- @nudojs/env@0.4.9
- @nudojs/parser@1.1.7
0.2.14
Patch Changes
- Updated dependencies [5494f67]
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/env@0.4.8
- @nudojs/core@1.2.1
- @nudojs/parser@1.1.6
0.2.13
Patch Changes
- Updated dependencies [5ff4202]
- Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
- @nudojs/env@0.4.7
- @nudojs/parser@1.1.5
0.2.12
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
- @nudojs/env@0.4.6
- @nudojs/parser@1.1.4
0.2.11
Patch Changes
- Updated dependencies [3bf9997]
- @nudojs/core@1.1.3
- @nudojs/parser@1.1.3
- @nudojs/env@0.4.5
0.2.10
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
- @nudojs/env@0.4.4
- @nudojs/parser@1.1.2
0.2.9
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
- @nudojs/env@0.4.3
- @nudojs/parser@1.1.1
1.0.0-beta.1
Major Changes
-
4305674: Split the
@nudojs/servicegod package: harvest →@nudojs/harvester, IDE surface →@nudojs/lsp, emit products consolidated under@nudojs/service/emit.BREAKING for
@nudojs/servicesubpath consumers:Removed subpath Migrate to @nudojs/service/interface@nudojs/service/emit@nudojs/service/dts@nudojs/service/emit@nudojs/service/case@nudojs/service/emit@nudojs/service/lsp@nudojs/lsp(library entry — no server side effects)@nudojs/service/harvest@nudojs/harvester@nudojs/servicekeeps.,./analysis,./evaluator,./emit. The language server moves to@nudojs/lsp/server(binnudo-lspunchanged);@nudojs/lspis now a side-effect-free library entry re-exporting the IDE surface.No dependency cycles:
lsp → service,harvesterstays independent ofservice. Emit is a service subpath (same package). Public function signatures and diagnostic codes are unchanged.
0.2.8-beta.0
Patch Changes
- Updated dependencies [22baf33]
- Updated dependencies [0e1432a]
- Updated dependencies [3c3f9d2]
- Updated dependencies
- Updated dependencies [279d73a]
- @nudojs/core@3.0.0-beta.0
0.2.7
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/core@2.1.0
0.2.6
Patch Changes
- Updated dependencies [9731238]
- @nudojs/core@2.0.1
0.2.5
Patch Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
-
Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
0.2.4
Patch Changes
- Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
0.2.3
Patch Changes
- Updated dependencies [0fd253f]
- Updated dependencies [a2aac9e]
- Updated dependencies [0f0b7d5]
- Updated dependencies [de47d84]
- Updated dependencies [78f6752]
- @nudojs/core@1.0.0
0.2.2
Patch Changes
- Updated dependencies [1d6bb01]
- Updated dependencies [1d233a7]
- @nudojs/core@0.4.0
0.2.1
Patch Changes
- bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
0.2.0
Minor Changes
-
5786fa5: Auto-inject
@typesduring analysis-path harvest and guard oversized dts work.- Analysis can resolve package roots upward and feed harvested Abs into the B module graph.
harvestDtsaccepts optionalmaxFileBytes/maxMsand skips unreadable or oversized files instead of failing the run.
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
vite-plugin-nudo 0.7.4
0.7.4
Patch Changes
- Updated dependencies [795e322]
- Updated dependencies [161d156]
- @nudojs/core@1.20.1
- @nudojs/service@1.12.3
Version history (64)
0.7.3
Patch Changes
- Updated dependencies [c93a32d]
- Updated dependencies [190761e]
- Updated dependencies [aff6b7c]
- @nudojs/core@1.20.0
- @nudojs/service@1.12.2
0.7.2
Patch Changes
- Updated dependencies [86bc56e]
- @nudojs/core@1.19.1
- @nudojs/service@1.12.1
0.7.1
Patch Changes
-
4fc7e19: Rename the remaining Nudo
interfaceterminology tocontractend to end.- Core:
effectiveInterface→effectiveContract,InterfaceSource→ContractSource,InterfaceTierInfo→ContractTierInfo,interfaceTierOf→contractTierOf,takeInterfaceDiags*→takeContractDiags*, and thealgebra/interface/directory →algebra/contract/. - Service:
emitInterface/draftInterface/interfaceSurface→emitContract/draftContract/contractSurface;interface-*.tsfiles →contract-*.ts;ifaceCacheKey→contractCacheKeyand the disk-cache namespaceiface→contract. - Diagnostics:
nudo:interface-*→nudo:contract-*(no alias layer). - CLI/LSP: CodeLens titles
⚡ persist contract/↻ update contract/⚡ draft contract; agent messagesno contract found/no contract changes;CheckIssueactions and hover/inlay fields usecontractSource/contractDisplay/contractActive. - Docs, examples (
contract-derivation/,contract-draft/), API snapshots, and website references updated.
TypeScript's
interfacekeyword, Babel ASTTSInterface*, and historical release notes are intentionally unchanged. - Core:
-
Updated dependencies [9a087f9]
-
Updated dependencies [09d49af]
-
Updated dependencies [c6cf8fa]
-
Updated dependencies [e1e6892]
-
Updated dependencies [ca8005b]
-
Updated dependencies [1a4cabd]
-
Updated dependencies [b57d1d2]
-
Updated dependencies [fb54d1a]
-
Updated dependencies [869f22d]
-
Updated dependencies [09f5ff8]
-
Updated dependencies [df56e83]
-
Updated dependencies [af8173b]
-
Updated dependencies [61c22d5]
-
Updated dependencies [c8aac63]
-
Updated dependencies [9886482]
-
Updated dependencies [3ddcb81]
-
Updated dependencies [897b19f]
-
Updated dependencies [53d8248]
-
Updated dependencies [4361e2e]
-
Updated dependencies [792eb79]
-
Updated dependencies [949ddce]
-
Updated dependencies [56d8227]
-
Updated dependencies [14cf89a]
-
Updated dependencies [49cdb00]
-
Updated dependencies [4fc7e19]
-
Updated dependencies [4e986cd]
-
Updated dependencies [47463ae]
-
Updated dependencies [018bc20]
-
Updated dependencies [b4435ae]
-
Updated dependencies [e4dc7df]
-
Updated dependencies [7ddd831]
-
Updated dependencies [06bd8ee]
-
Updated dependencies [533c8c6]
-
Updated dependencies [951b256]
-
Updated dependencies [0331e00]
-
Updated dependencies [f7d105a]
-
Updated dependencies [fdc0a5a]
-
Updated dependencies [1aab8ff]
-
Updated dependencies [c9c39e8]
-
Updated dependencies [b6cdf66]
-
Updated dependencies [1316e42]
-
Updated dependencies [a9638c2]
-
Updated dependencies [4ea0cbc]
-
Updated dependencies [ead77d6]
-
Updated dependencies [cd7c6e2]
-
Updated dependencies [f66e104]
-
Updated dependencies [5267658]
-
Updated dependencies [b060986]
-
Updated dependencies [21ffc28]
- @nudojs/core@1.19.0
- @nudojs/service@1.12.0
0.7.0
Minor Changes
-
00ba198: Dedup / fail-closed / dead-code batch (repo-wide review): single-source the cross-face copies and stop folding read errors into silent misses.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
buildEvalInjectionin@nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — thehealthcopy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and droppedmockFromErrors);parseIgnoreThrows/configIgnoreThrows(service; CLI / LSP / vite-plugin);CHECK_FACE_DIAG_CODESandCHECK_ISSUE_OPTIONAL_KEYS(@nudojs/core/internal);normalizeRealPath(service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径);Object.prototypename list now derived instead of hand-synced;normalizeModulePath/externalAbsCallRecords/stripIssuesByCodeshared within the CLI package. - Fail-closed fixes (read errors no longer fold into "miss"): harvester
disk cache fingerprint carries a
readerr:sentinel and skips the disk layer when a dts closure read fails; transient harvest failures are no longer pinned asnullin the process cache; unreadable dts entries count intostats.skipped;nudo migrateenumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish fromretire --all);nudo export --outrefuses to overwrite an existing target it cannot read (EISDIR still routes to the write-failure channel, which cannot clobber); LSP sidecar read failures surface as structurednudo:path-iopath errors instead of "no sidecar"; core's same-file contract-face resolver notes engine exceptions (nudo:internal) instead of silently memoizing "no contract face". - Removed zero-consumer aliases (no production consumers in-repo or in
the published docs matrix):
transpile(usetranspileSource) from@nudojs/core,generateGuardFunction(usegenerateGuardFunctionFromAbs) from@nudojs/service/emit,maybeLeak/leakIfNeeded/resetLeakCounterfrom@nudojs/core/internal. - Behavior notes:
nudo healthnow merges env modules viamergeHarvestUnderEnv(same-name env+harvest packages keep harvest's non-conflicting exports) and can fail red on error-level mock-load problems; the check face may surfacenudo:internalinfo issues for engine exceptions that were previously swallowed. - Internal refactors, byte-identical output: class-emit / computed-key
assignment / destructure emitters deduplicated via shared helpers (verified
by a 56-corpus byte-diff plus the pinned emission suites);
analyzeFileUncachedInnermodule-issue mapping is table-driven;runHealthsplit into print/json helpers.
- Cross-face single sources (previously hand-synced copies that had already
drifted): eval injection assembly (
Patch Changes
- Updated dependencies [5cd4106]
- Updated dependencies [01463d8]
- Updated dependencies [7d7abe4]
- Updated dependencies [5769211]
- Updated dependencies [01a550b]
- Updated dependencies [fd0fb09]
- Updated dependencies [6eaf219]
- Updated dependencies [c48fd48]
- Updated dependencies [00ba198]
- @nudojs/core@1.18.0
- @nudojs/service@1.11.0
0.6.3
Patch Changes
-
37e9aa0: Fix bug-report category 17 (vite-plugin gate surface).
- BUG-110: the plugin's report face and gate face agree on
ignoreThrows, so the same project no longer yields contradictory verdicts between the two faces. - BUG-111: project-level env is resolved from the project root rather than the importing
file's directory, and env-module exports are merged with
mergeHarvestUnderEnvinstead of object spread — so adding an unrelated@nudo:envline no longer flips the gate from green to red, and harvest-only exports are no longer dropped. - BUG-221: project-level env resolves against the project base dir, so the plugin gate matches the evaluator.
- BUG-222: a project-level env load failure is no longer silent in the plugin; it reports
nudo:env-unresolvedlike the CLI and LSP instead of a false green.
Regression tests:
vite-bug-110-*,vite-bug-111-*,vite-bug-221-*,vite-bug-222-*.Note: BUG-140 (listed in this category file but whose defect is the LSP diagnostic face missing
nudo:internal) is NOT covered here; it belongs to category 14. - BUG-110: the plugin's report face and gate face agree on
-
Updated dependencies [51e69f8]
-
Updated dependencies [51b510a]
-
Updated dependencies [aed8e00]
-
Updated dependencies [e4190b5]
-
Updated dependencies [6daa52e]
-
Updated dependencies [206713f]
-
Updated dependencies [0650ef0]
-
Updated dependencies [fe03e18]
-
Updated dependencies [250f0ba]
-
Updated dependencies [d4ab7fb]
-
Updated dependencies [9ff1709]
-
Updated dependencies [37e9aa0]
- @nudojs/core@1.17.2
- @nudojs/service@1.10.3
0.6.2
Patch Changes
- Updated dependencies [d726525]
- @nudojs/core@1.17.1
- @nudojs/service@1.10.2
0.6.1
Patch Changes
- Updated dependencies [0438f10]
- Updated dependencies [6ebf5a4]
- @nudojs/core@1.17.0
- @nudojs/service@1.10.1
0.6.0
Minor Changes
-
b37321b: BREAKING:
nudo.analysis.include的字面量条目现在真的命中 (Bug 1018 同族)——此前不带通配符的条目永不匹配 ⇒ 整份 allowlist 被 静默忽略 ⇒ 该工程此前零诊断;现在字面条目按路径命中(该文件或该目录) ⇒ 此前零分析的工程开始产出诊断,failOnError: true的构建会由绿变红。 env 加载失败(缺文件 / 未知 env 名 / 未导出defineEnv())此前完全静默 ⇒ 受影响代码被当成「env 不存在」分析;现在会报出来。谁会坏:依赖 0.5.x「静默零分析」的项目(把
nudo.analysis.include当装饰用、 靠它压掉整片分析的构建流水线);以及依赖「env 加载失败不阻断构建」的流水线。怎么迁移:把
nudo.analysis.include写成字面语义即可;想继续「整片静音」 请用nudo.analysis.diagnostics档位,而不是靠不生效的 allowlist。vite-plugin-nudo仍是 pre-1.0(0.x):本次按政策以 minor 发布 (0.x 的 minor 可能含破坏性变更)。The build plugin reports the env failures it used to drop.
-
A path env file that failed to load — a missing file, an unknown env name, a file that does not export a
defineEnv()function — produced no diagnostic during a build, so the affected code was analyzed as if the env did not exist. The failure is reported now. -
A
nudo.analysis.includeentry without a wildcard never matched, so the whole allowlist was silently ignored. A literal entry is matched as a path now: it names that file, or that directory.
-
-
c52b107: fix(vite-plugin): 构建期分析面的「模块 id → 匹配」层归一化(896 / 902 / 903 / 1018 / 1056)
BREAKING: 项目相对
include/exclude现在真的生效(Bug 1018)—— 此前插件选项只按绝对 module id 匹配 ⇒exclude: ["other/**"]静默不生效、include: ["src/**"]静默把整份分析归零 ⇒ 「静默零分析」的工程此前零诊断。 现在选项与nudo.analysis.include/exclude同口径(绝对路径 或 相对config.root的路径命中即算命中)⇒ 此前零分析的工程开始产出诊断,failOnError: true的构建会由绿变红。谁会坏:依赖 0.5.x「静默零分析」的项目(把
include/exclude当装饰用、 靠它压掉整片分析的构建流水线);以及显式传了exclude却指望它只作用于项目内 路径的用法(依赖 / 软链依赖现在一律排除)。怎么迁移:把
include/exclude写成字面语义即可(相对config.root的 glob 现在与nudo.analysis.*同口径);想继续「整片静音」请用nudo.analysis.diagnostics档位,而不是靠不生效的 glob。vite-plugin-nudo仍是 pre-1.0(0.x):本次按政策以 minor 发布(0.x 的 minor 可能含破坏性变更)。-
Bug 896(虚拟模块):Vite 的虚拟模块 id(
\0前缀 /virtual:前缀) 被原样拼成侧车路径 ⇒ 路径含 NUL ⇒ 必读不到 ⇒ 干净模块被判 error (failOnError: true时抛错中断构建)。虚拟 id 现在在分析入口被跳过。 -
Bug 902(畸形入参):
transform(code = null)抛未捕获异常 (Cannot read properties of null (reading 'length'),且异常在插件兜底catch之外)。非字符串code现在被前置拦下,守卫调用也移进try⇒ 任何畸形入参都走「跳过」而不是抛给调用方。 -
Bug 903(HMR query):
?t=<timestamp>/?v=<hash>让 include 失配 ⇒ 整份文件被跳过 ⇒ dev 期诊断消失(假绿)。匹配与分析现在统一用 剥掉 query 的 id。 -
Bug 1018(相对 glob 失效):
include/exclude选项此前只按 绝对 module id 匹配 ⇒ 项目相对 glob(other/**/src/**)永不命中 ⇒ 与同名的项目配置nudo.analysis.include/exclude判定相反。 选项现在与nudo.analysis.*同口径:同时对「相对config.root的路径」 与「绝对路径」求值。 ⚠ 破坏性行为变更:项目相对 glob 现在生效 —— 此前exclude: ["other/**"]静默不生效、include: ["src/**"]静默把整份分析 归零;现在两者都按字面语义执行。之前「静默零分析」的工程会开始产出诊断。 -
Bug 1056(软链依赖):默认排除的「node_modules 段」规则匹配不到 软链工作区依赖的 realpath id ⇒ 别的包源码被当项目源码分析 (Vite 红 / 同项目
nudo check绿 ⇒ 跨面矛盾 + 假红)。排除判定前先把 id 归一化成依赖图视角 ⇒ 软链依赖与物理目录依赖一致地被排除。 ⚠ 行为变更:依赖(node_modules段 / 软链依赖 / 工程根config.root之外的路径)现在一律排除,即使用户显式传了自定义exclude。
-
-
c52b107: The build plugin no longer hides contract failures or drops diagnostics.
BREAKING: 两处构建期行为变化(0.5.x 的绿构建可能变红 / 静默构建可能变吵):
nudo.analysis.diagnostics: "off"不再静默契约门禁。此前门禁诊断 (L1nudo:constraint-violated/ L2nudo:entry-may-throw)与显示通道合并 过滤 ⇒off项目零诊断、failOnError: true也照样绿(坏契约上的 绿灯 CI)。现在门禁通道独立:error 级的 check 诊断在任何档位(含off) 都照常上报、照常拦构建。build.logLevel: "silent"现在真的什么都不输出(含汇总行)。汇总行此前 走裸console.log,逃出 Vite logger 的管辖 ⇒ 静默构建仍打印[nudo] Analysis complete: N error(s), M warning(s),却看不到那 N 条诊断 (只报数、不给理由)。现在汇总行走 Vite logger ⇒ 静默档下连汇总行都没有。
谁会坏:靠
diagnostics: "off"换「构建期不拦契约」的流水线(CI 由绿转红); 以及在logLevel: "silent"下仍依赖[nudo] Analysis complete: …这行汇总 做日志采集的脚本(该行不再出现)。怎么迁移:想让构建期完全安静,用
build.logLevel: "silent"(现在它真的静默) 并把failOnError设为false;想让契约门禁在构建期也生效,保持现状即可 (门禁不再被off抹掉,这是有意的 fail-closed 方向)。vite-plugin-nudo仍是 pre-1.0(0.x):本次按政策以 minor 发布(0.x 的 minor 可能含破坏性变更)。-
nudo.analysis.diagnostics: "off"no longer silences the contract gate. Previously the check-gate diagnostics (L1nudo:constraint-violated, L2nudo:entry-may-throw) were merged into the display path and filtered together with it, so anoffproject reported zero diagnostics and a build withfailOnError: truestill passed — a green CI on a broken contract. The gate channel is now separate: error-level check diagnostics are reported and still fail the build underfailOnError: true, in every diagnostics tier includingoff. The display path (evaluator diagnostics, path-env failures, and check warnings/info) keeps the old tier semantics. -
build.logLevel: "silent"now silences everything the plugin prints. The build summary used to be written with a bareconsole.log, which escaped Vite's logger: a silent build still printed[nudo] Analysis complete: N error(s), M warning(s)while none of the N diagnostics were shown. The summary now goes through Vite's logger, so a silent build prints nothing at all.
Fixes
-
failOnError: truereported only the first error-level diagnostic and dropped the rest, while the build summary counted them all ("2 error(s)" next to a single reported error). The first error still fails the build; every remaining error-level diagnostic is now reported as well, so the summary count and the number of reported diagnostics agree. -
Diagnostics without a source position were rendered as
:0:0(a line that does not exist) or:1:0(an invented first line). A diagnostic with no position now omits the:line:colpart entirely, matching the CLI, which prints no location for the same diagnostic. -
The evaluator-side diagnostics dropped their
(nudo:code)suffix, so a single build log mixed two text formats andgrep '(nudo:'only found half of the diagnostics. Every diagnostic now carries its code, and the two sources use the same format.
-
c52b107: fix(vite-plugin): 构建期分析面看到原始 TS 源码(895 / 900)+ 模块 id 归一化接线
BREAKING: 本版本一并生效的三处破坏性行为变化(详见下文 「Breaking behavior changes(本版本一并生效)」逐条说明):
- 899 ——
nudo.analysis.diagnostics: "off"不再抹掉契约门禁:error 级的 check 诊断在任何档位(含off)都照常上报、照常拦构建 ⇒ 此前靠off拿到 绿灯 CI 的流水线由绿转红。 - 1002 ——
build.logLevel: "silent"下插件什么都不输出(含汇总行) ⇒ 依赖[nudo] Analysis complete: …这行做日志采集的脚本取不到该行。 - 1018 —— 项目相对 glob 现在生效(
include/exclude同时对「相对config.root的路径」与「绝对路径」求值)⇒ 此前「静默零分析」的工程 开始产出诊断,failOnError: true的构建由绿转红。
谁会坏:靠
diagnostics: "off"换「构建期不拦契约」的流水线;依赖静默构建里 那行汇总做采集的脚本;把include/exclude当装饰用、靠它压掉整片分析的 工程。怎么迁移:用
build.logLevel: "silent"+failOnError: false换「构建期完全 安静」;include/exclude改成字面语义(与nudo.analysis.*同口径); 契约门禁在构建期生效是有意的 fail-closed 方向,保持现状即可。vite-plugin-nudo仍是 pre-1.0(0.x):本次按政策以 minor 发布 (0.x 的 minor 可能含破坏性变更)。Fixes
-
Bug 895(假红面):插件对象缺
enforce: "pre"⇒ 排在核心插件vite:esbuild之后 ⇒transform收到的是 esbuild 的转译产物 (TS loader 剥光注释)⇒.ts源里只存在于注释的@nudo:指令全部 不可见 ⇒ 分析按「无指令普通模块」跑 ⇒ 报出nudo check不会报的 error(同一份文件:CLI 判 OK,vite build红)。插件现在排在vite:esbuild之前 ⇒ 看到原始 TS 源码 ⇒ 指令可见 ⇒ 与 CLI 判同。 -
Bug 900(假绿面 · 895 的反方向):同一根因的另一面 ——
.ts源里的@nudo:contract/@nudo:case被 esbuild 删光 ⇒ 门禁静默放绿 (同一份契约:.js源报红,.ts源零诊断)。修复后.ts源与.js源的诊断集合一致。 -
模块 id 归一化接线:分析 / 诊断一律用剥掉 query(
?t=/?v=) 的 module id ⇒ ① 诊断文本不再带?t=;②sidecarPathOf命中真实 侧车 ⇒ HMR 期侧车契约不再静默失效。 -
诊断行号回到源码坐标系:
enforce: "pre"之后诊断行号从「转译产物 坐标系」回到「源码坐标系」—— 这是预期修复(诊断集合不变, 位置回到用户写代码的那份文件)。 -
TS 语法兜底:
enforce: "pre"⇒ 插件看到含类型注解的原始 TS 源码 ⇒ 分析面必须吃得住 TS 语法。TS 特有语法(interface/ 泛型 /enum/namespace/as const/satisfies/ 抽象类 / 参数属性)照常解析; 解析不了的语法(如装饰器)降级为一条Failed to analyzewarning —— 构建不炸。
Breaking behavior changes(本版本一并生效)
-
899 ——
nudo.analysis.diagnostics: "off"不再抹掉契约门禁。此前门禁 诊断(L1nudo:constraint-violated/ L2nudo:entry-may-throw)与 evaluator 诊断合并后一起过滤 ⇒off项目零诊断、failOnError: true也照样绿(坏契约上的绿灯 CI)。现在门禁通道独立:error 级的 check 诊断在任何档位(含off)都照常上报、照常拦构建;显示通道 (evaluator 诊断、path-env 失败、check 的 warning / info)保持原档位语义。 -
1002 ——
build.logLevel: "silent"下插件什么都不输出**(含汇总行)。 汇总行此前走裸console.log,逃出 Vite logger 的管辖 ⇒ 静默构建仍打印[nudo] Analysis complete: N error(s), M warning(s),却看不到那 N 条诊断 (只报数、不给理由)。现在汇总行走 Vite logger ⇒ 静默档下连汇总行都没有**。 -
1018 —— 项目相对 glob 现在生效。插件选项的
include/exclude此前只按绝对 module id 匹配 ⇒ 项目相对 glob(other/**/src/**) 永不命中 ⇒ 与同名的项目配置nudo.analysis.include/exclude判定相反。选项现在与nudo.analysis.*同口径:同时对「相对config.root的路径」与「绝对路径」求值。 ⚠ 之前「静默零分析」的工程会开始产出诊断(此前exclude: ["other/**"]静默不生效、include: ["src/**"]静默把整份分析归零)。
- 899 ——
Patch Changes
-
0f67015: fix: 并发 review 收口的 25 条缺陷 + 4 条跨文件尾巴(CI 闸门假红/假绿 · 自相信值 · 机器面口径漂移)
本片是一次并发 review(8 个分片)收口的结果:25 条缺陷全部修复,另补 4 条 worker 报告的跨文件尾巴。核心是闸门可信度——
nudo check是 CI 闸门,假红会卡死用户仓库、假绿会让门禁空转。高危(5 条 · 闸门级)
- L2 实例方法桥把构造器的 throws 归因给方法(
core/algebra/check-may-throw.ts): 实例桥用ctorAnyArgs(全any)跑构造器 ⇒ 构造器里的强制转换 TypeError 被算进方法的 throws 域 ⇒ 普通类即触发 error 级nudo:entry-may-throw。 修法:构造器改在独立 may-throw 会话里跑(证据隔离、副作用保留)⇒ 构造器的 throws 归因给new C()入口而非方法;构造器抛时退裸实例 继续求值方法体 ⇒ 方法自身的证据照常收集(闸门不整体关掉)。 async function*声明体的await发射成裸yield(core/algebra/exec/transpile/stmt/statement.ts):缺stmt.generator !== true守卫 ⇒ 产物是非法 JS ⇒ 整模块 fail-closed ⇒ 全部导出退 unknown/opaque ⇒ error 级nudo:entry-may-throw降成 INFOnudo:opaque-result(门禁假绿)。 修法:与函数表达式 / 对象方法 / 类方法三条兄弟路径对齐。- Proxy
getOwnPropertyDescriptor陷阱违反 [[GetOwnProperty]] 不变量 (core/algebra/builtins/object/descriptor.ts):引擎照抄陷阱的值 ⇒ 自信的 错值。修法:以 node v26.10.0 实测矩阵(82 例零偏差)反推完整谓词 ⇒ 补齐「靶无该自有键」「可配置性不一致」「不可配置属性的 writable / enumerable / value 冻结」「数据 / 访问器描述符不得混报」四档。 Object.getOwnPropertyDescriptors丢 symbol 键自有属性 (core/algebra/builtins/object/methods.ts):原生走[[OwnPropertyKeys]]含 symbol 键 ⇒ 结果对象少一个自有属性。附带修正builtins/invariants.ts把 gOPDs 列进「只枚举字符串键」的事实错误注释。Uint8ClampedArray元素先截断再钳位(core/algebra/builtins/error/binary.ts):ToUint8Clamp是就近偶数取整、不向零截断 ⇒ 改传未截断值。
中危(9 条)
strip-types把构造器参数属性赋值插到super()之前 (core/src/strip-types.ts):派生类产物在new C()时抛 ReferenceError ⇒migrate是一程闸门(无回退)且node --check只验语法 ⇒ 静默写出坏代码。 修法:按 tsc emit 口径插到super(...)之后;找不到顶层super(...)时 保持源自身的失败形态并产出一条 note(nudojs/src/migrate.ts侧透出)。Object.setPrototypeOf(Object.prototype, null)过拒绝 (core/algebra/builtins/object/methods.ts·objects.ts):按 ES2024 10.4.1.2([[SetPrototypeOf]]只在 V 非 null 时抛)+ node v26 实测 放行 null、仍拒非 null ⇒ 不再与原生/规范冲突(无需登记架构债)。Reflect.ownKeys的 symbol 键排在字符串键之前(core/algebra/builtins/reflect.ts): 按 ES2024OrdinaryOwnPropertyKeys改两段排列。arr形参 ×tuple实参的 α 绑定只取首元素(core/algebra/hof.ts): 异构数组字面量[1,"a"]⇒T := number⇒ 返回number[](窄于真实类型) ⇒ 把「不知道」升级成「知道」。修法:元素域取全部元素的同型 join,异构退any。- 项目级 path env 按「被分析文件目录」解析(
service/src/check-issues.ts·service/src/analyzer-orchestrate.ts·lsp/src/validation.ts):假阳(报 不存在的路径)+ 假阴(项目级 env 真实失败被静默丢弃)⇒ 改两层基准 (项目级按项目根 / 文件级按文件目录),与 CLI 同口径。 check --json --watch/test --json --watch的路径错误早退分支打 pretty JSON(nudojs/src/commands/check-command.ts·test.ts):破坏 watch 面 「stdout = JSON Lines」契约(机器消费者第一行即炸)⇒ 三动词统一一行一份 JSON。migrate strip --json的pathErrors[].path混用目录 / 文件量纲,且同目标内 成功文件的逐文件结果被整条丢弃(nudojs/src/commands/migrate.ts)⇒ 逐文件隔离在 CLI 面等于没生效 ⇒ 失败条目改用文件路径、成功行进results。- vite-plugin:工程根含软链时全部源文件被判为「依赖」
(
vite-plugin/src/scope.ts·index.ts):resolve()(不解析软链)对比realpathSync()(解析软链)⇒ 整工程被 skip 且零日志(静默空转)⇒ 两侧都取 realpath 再比;root 改为按插件实例持有(同进程第二个 Vite config 不再覆盖第一个的 root)。 - zh-Hans 镜像未跟随 en 更新(5 个页面):输出块按真机重抄 + 缺段补齐,并
新增机械闸门(
website/tests/docs-coverage.test.ts规则 21:blocks / machine / tokens / rows / paras 五档 en↔zh 比对)⇒ 漂移不再静默过 CI。
低危(11 条)
__nudoLv{N}循环槽名改走internalTmpName(core/algebra/exec/transpile/stmt/statement.ts); 后置条件证据面的 Φ 侧改同项判定(core/algebra/postcondition.ts·check-return.ts) ——无关 Φ 不再把「证不出」误判为disproved; standard-schema 内联__nudoDescribe与库函数副本的-0口径统一 (service/src/emit/standard-schema.ts);整文件缓存键的「项目级 path env 内容」 维度按项目根解析(service/src/analyzer-cache.ts);两条新诊断码改用 core 的DIAG注册表(service/src/analyzer-orchestrate-uncached.ts);用法错误码三动词 统一为nudo:usage-error(nudojs/src/commands/test.ts);vite-plugin 无line的 issue 不再伪造成:1:0(vite-plugin/src/check-assembly.ts);parser 的文件级 指令位置闸门补 class / 对象字面量体(parser/src/directives/file-directives.ts); LSP 语义 token 降级路径复用 core 的真 lexer 遮罩(lsp/src/semantic-tokens.ts); 架构债台账条目数 9→10(3 处索引);walkAbs的 brand 解包补空值守卫 (scripts/env-coverage-baseline.ts)。跨文件尾巴(4 条 · worker 报告的同源缺口,本片一并收口)
- core 文本路径的同类位置闸门洞(
core/algebra/directive-scan.ts): parser 侧修了 class / 对象体,core 的文本路径是孪生路径、同样漏了 ⇒ 按同口径 补上(nestedBodyRanges)。 generalize.ts的类方法桥(值域通道):构造器抛 ⇒ 异常逃出 ⇒ 方法签名退 unknown + 误导的 INFOnudo:opaque-result。check-may-throw.ts反向 importgeneralize.ts⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。nudojs/src/migrate.ts透出ctorParamPropsSuperMissingnote:core 已置位 但用户看不到 ⇒ 补提示。- LSP / service 的项目级 env 预载基准(见上「中危」条)。
验证
全仓
tsc --noEmit(含测试文件)0 错误;pnpm run test1756 文件 / 14515 用例全绿(exit 0);pnpm run buildexit 0;verify-doc-examples.sh278 checks passed / 0 failed;coverage:env -- --checkexit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。 - L2 实例方法桥把构造器的 throws 归因给方法(
-
c52b107: Internal restructuring only — no behaviour change.
The plugin entry point was split into three package-internal modules so the individual concerns can be maintained separately:
scope.ts— module id normalisation and analysis-scope decisions (include/exclude matching, theshouldAnalyzeFileguard,config.root).check-assembly.ts— assembling thecheckSourcecall and turning its issues into diagnostics.report.ts— the diagnostic reporting loop,failOnErroraggregation, the build-end summary, and the single message-rendering outlet.
index.tsis now a thin shell that only wires the plugin hooks together. The plugin's public surface is unchanged: the package still exports exactly one runtime symbol (default). The three new modules are not re-exported from the entry point and are not part of the package'sexportsmap, so they stay internal.The public behaviour of the plugin — which files are analysed, which diagnostics are reported, and what the build end summary says — is unchanged by this restructuring.
-
c52b107: The build plugin reads the project's L2 gate settings instead of ignoring them.
-
package.json#nudo.check.entryThrowswas ignored during a build: the plugin always applied the strictest level, so a project that had moved the gate to"warning"(or"off") sawnudo checkpass whilevite buildreported an error — and withfailOnError: truethe build was interrupted. The configured level is applied now, matching the CLI and the editor. -
package.json#nudo.check.ignoreThrowswas ignored for the same reason: a throw class listed there was still reported asnudo:entry-may-throw. The listed classes are ignored now.
-
-
c52b107: fix(vite-plugin): 补 Bug 901 的回归钉 —— info 不计入 warning 计数 + info 走 info 通道(假阳性片)
-
Bug 901 的核心症状已由族 26 随
f87c9f9d落地(changesetfix-lsp-core-F.md的「Bug 779 vite 半」):buildEnd汇总行的 warning 计数 改成只数severity === "warning"(此前是totalDiags - errorCount⇒ 把 info 级诊断算成告警),诊断上报循环新增 info →this.info分支(此前 info 级诊断一条都不上屏 ⇒ 汇总行与构建日志自相矛盾)。 -
本次只补回归钉(
packages/vite-plugin/src/__tests__/vite-bug-901-info-not-counted-as-warning.test.ts), 未改动任何实现:钉住两条已成立的行为 ——- info 不计入 warning 计数:汇总行
[nudo] Analysis complete: X error(s), Y warning(s)的Y只数 warning 级诊断;info 级诊断不计入,且汇总不得比「实际 warning 条数」多。 - info 走
this.info上屏:info 级诊断出现在 vite 的 info 通道,不混进 warn 流 (否则 info 冒充告警)。
- info 不计入 warning 计数:汇总行
-
该钉在 HEAD 只读副本上通过(它钉的是已修好的行为 ⇒ 本族唯一的「反向闸例外」), 在族 26 修复前的副本上 3/3 失败 ⇒ 仍是一道有效的回归守护。
-
-
Updated dependencies [02aa122]
-
Updated dependencies [6ec8afc]
-
Updated dependencies [7fea13a]
-
Updated dependencies [bb8e201]
-
Updated dependencies [5c750f2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [8a5bf7e]
-
Updated dependencies [8542f44]
-
Updated dependencies [f11510a]
-
Updated dependencies [5c750f2]
-
Updated dependencies [29d766d]
-
Updated dependencies [e3b8791]
-
Updated dependencies [e3b8791]
-
Updated dependencies [6e5344a]
-
Updated dependencies [f896290]
-
Updated dependencies [a069994]
-
Updated dependencies [7fea13a]
-
Updated dependencies [8bf3fd0]
-
Updated dependencies [5749924]
-
Updated dependencies [0f67015]
-
Updated dependencies [2d96c29]
-
Updated dependencies [e3b8791]
-
Updated dependencies [f6538a2]
-
Updated dependencies [e3b8791]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [2af2bae]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [e424592]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [0366b6d]
-
Updated dependencies [ec0a9e4]
-
Updated dependencies [c325a10]
-
Updated dependencies [c325a10]
-
Updated dependencies [b37321b]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [e59c991]
-
Updated dependencies [3d79864]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [e2880fd]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [da4fbfc]
-
Updated dependencies [5dd89ca]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [97f28ed]
-
Updated dependencies [e2880fd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [4d1a249]
-
Updated dependencies [af09752]
-
Updated dependencies [fcaa9e9]
-
Updated dependencies [7fea13a]
-
Updated dependencies [9ccffb3]
-
Updated dependencies [e9fdaa7]
-
Updated dependencies [cc9b638]
-
Updated dependencies [2688251]
-
Updated dependencies [7fea13a]
-
Updated dependencies [1caec28]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [69e67d3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [b0878e3]
-
Updated dependencies [a069994]
-
Updated dependencies [493b8c2]
-
Updated dependencies [d7ae28a]
-
Updated dependencies [edc7590]
-
Updated dependencies [5c750f2]
-
Updated dependencies [ed4d259]
-
Updated dependencies [e20c128]
-
Updated dependencies [abff33b]
-
Updated dependencies [e3b8791]
-
Updated dependencies [5c750f2]
-
Updated dependencies [c80456a]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [e6c4586]
-
Updated dependencies [f87c9f9]
-
Updated dependencies [27a795e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [a3c95a4]
-
Updated dependencies [e3b8791]
-
Updated dependencies [7fea13a]
-
Updated dependencies [d56cbd7]
-
Updated dependencies [e5b3f38]
-
Updated dependencies [089d4ec]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [169ed52]
-
Updated dependencies [02aa122]
-
Updated dependencies [02aa122]
-
Updated dependencies [3432d8c]
-
Updated dependencies [3432d8c]
-
Updated dependencies [f47fd50]
-
Updated dependencies [5c750f2]
-
Updated dependencies [d2cf3cf]
-
Updated dependencies [27cc16a]
-
Updated dependencies [27cc16a]
-
Updated dependencies [fbca6fb]
-
Updated dependencies [aa23265]
-
Updated dependencies [535adcd]
-
Updated dependencies [5c750f2]
-
Updated dependencies [535adcd]
-
Updated dependencies [e3b8791]
-
Updated dependencies [b6abab4]
-
Updated dependencies [356172a]
-
Updated dependencies [ebe909e]
-
Updated dependencies [e3b8791]
-
Updated dependencies [a069994]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [dde4b03]
-
Updated dependencies [b37321b]
-
Updated dependencies [b37321b]
-
Updated dependencies [106ad1d]
-
Updated dependencies [369a42d]
-
Updated dependencies [29d766d]
-
Updated dependencies [7fea13a]
-
Updated dependencies [56f308e]
-
Updated dependencies [5c750f2]
-
Updated dependencies [7fd7468]
-
Updated dependencies [ed4d259]
-
Updated dependencies [f896290]
-
Updated dependencies [ae69b28]
-
Updated dependencies [5c750f2]
-
Updated dependencies [8542f44]
- @nudojs/core@1.16.0
- @nudojs/service@1.10.0
0.5.2
Patch Changes
- Updated dependencies [4513a45]
- @nudojs/core@1.15.2
- @nudojs/service@1.9.2
0.5.1
Patch Changes
- Updated dependencies [76dee40]
- Updated dependencies [3f3b080]
- Updated dependencies [a3a5dee]
- Updated dependencies [3338ae5]
- Updated dependencies [471ddb3]
- Updated dependencies [2ab2f46]
- Updated dependencies [babee2b]
- Updated dependencies [4c6666b]
- Updated dependencies [1fed4a4]
- Updated dependencies [70631ed]
- Updated dependencies [367ef5a]
- Updated dependencies [8dd2b50]
- Updated dependencies [725c8e4]
- @nudojs/core@1.15.1
- @nudojs/service@1.9.1
0.5.0
Minor Changes
- 8faa2b0: BREAKING (runtime floor):
engines.noderaised from>=20to>=22on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (thepackageManager-pinned pnpm already requiresnode:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npmenginessemantics.
Patch Changes
- Updated dependencies [aae0f96]
- Updated dependencies [52de5ca]
- Updated dependencies [1ccff57]
- Updated dependencies [8faa2b0]
- @nudojs/core@1.15.0
- @nudojs/service@1.9.0
0.4.43
Patch Changes
-
c19bd48: Misplaced file-level directives now warn instead of being silently ignored, and
nudo.analysis.excludesupports real globs (fix-12 batch).- parser: file-level directives (
@nudo:env/@nudo:mock-module) written inside JSDoc blocks emitnudo:directive-syntaxwith the correct///form instead of being dropped silently. - service:
nudo.analysis.excludeaccepts glob patterns (sharedcompilePattern, extracted from vite-plugin as the single source; plain substrings still work, defaults always stack). - vite-plugin: pattern matching cut over to the shared
compilePattern— behavior unchanged, one implementation.
- parser: file-level directives (
-
Updated dependencies [c19bd48]
-
Updated dependencies [c19bd48]
- @nudojs/core@1.14.1
- @nudojs/service@1.8.0
0.4.42
Patch Changes
- Updated dependencies [0d9e7de]
- Updated dependencies [0d9e7de]
- @nudojs/core@1.14.0
- @nudojs/service@1.7.0
0.4.41
Patch Changes
- Updated dependencies [f5c0c6e]
- @nudojs/core@1.13.0
- @nudojs/service@1.6.25
0.4.40
Patch Changes
- Updated dependencies [e4e491f]
- Updated dependencies [1881f97]
- Updated dependencies [1881f97]
- Updated dependencies [8466793]
- @nudojs/core@1.12.0
- @nudojs/service@1.6.24
0.4.39
Patch Changes
- Updated dependencies [08d7a55]
- @nudojs/core@1.11.3
- @nudojs/service@1.6.23
0.4.38
Patch Changes
- Updated dependencies [82eaae8]
- @nudojs/core@1.11.2
- @nudojs/service@1.6.22
0.4.37
Patch Changes
- Updated dependencies [612d64f]
- @nudojs/core@1.11.1
- @nudojs/service@1.6.21
0.4.36
Patch Changes
- Updated dependencies [cce5e58]
- Updated dependencies [16cda31]
- Updated dependencies [cce5e58]
- @nudojs/core@1.11.0
- @nudojs/service@1.6.20
0.4.35
Patch Changes
- Updated dependencies [8806e93]
- @nudojs/core@1.10.2
- @nudojs/service@1.6.19
0.4.34
Patch Changes
- Updated dependencies [96090cd]
- @nudojs/core@1.10.1
- @nudojs/service@1.6.18
0.4.33
Patch Changes
- Updated dependencies [334b914]
- Updated dependencies [94197eb]
- Updated dependencies [b8db17b]
- Updated dependencies [fa52735]
- Updated dependencies [35ce944]
- Updated dependencies [5e275df]
- @nudojs/core@1.10.0
- @nudojs/service@1.6.17
0.4.32
Patch Changes
- Updated dependencies [2af4016]
- Updated dependencies [2af4016]
- @nudojs/core@1.9.4
- @nudojs/service@1.6.16
0.4.31
Patch Changes
- Updated dependencies [b6495c6]
- Updated dependencies [b6495c6]
- Updated dependencies [04a6d1d]
- @nudojs/core@1.9.3
- @nudojs/service@1.6.15
0.4.30
Patch Changes
- Updated dependencies [c8e0417]
- @nudojs/core@1.9.2
- @nudojs/service@1.6.14
0.4.29
Patch Changes
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- Updated dependencies [bf601e0]
- @nudojs/core@1.9.1
- @nudojs/service@1.6.13
0.4.28
Patch Changes
- Updated dependencies [aeb6f7e]
- @nudojs/core@1.9.0
- @nudojs/service@1.6.12
0.4.27
Patch Changes
- Updated dependencies [05c2c8c]
- Updated dependencies [33239da]
- Updated dependencies [3588ddd]
- Updated dependencies [c647af8]
- @nudojs/core@1.8.0
- @nudojs/service@1.6.11
0.4.26
Patch Changes
- Updated dependencies [427da20]
- Updated dependencies [427da20]
- @nudojs/core@1.7.10
- @nudojs/service@1.6.10
0.4.25
Patch Changes
- Updated dependencies [b14ac2d]
- @nudojs/core@1.7.9
- @nudojs/service@1.6.9
0.4.24
Patch Changes
- Updated dependencies [58b7938]
- @nudojs/core@1.7.8
- @nudojs/service@1.6.8
0.4.23
Patch Changes
- Updated dependencies [d6fa067]
- Updated dependencies [92e6a5f]
- @nudojs/core@1.7.7
- @nudojs/service@1.6.7
0.4.22
Patch Changes
- Updated dependencies [856d8bf]
- @nudojs/core@1.7.6
- @nudojs/service@1.6.6
0.4.21
Patch Changes
- Updated dependencies [4c3fafd]
- @nudojs/core@1.7.5
- @nudojs/service@1.6.5
0.4.20
Patch Changes
- Updated dependencies [0fd8e1a]
- @nudojs/core@1.7.4
- @nudojs/service@1.6.4
0.4.19
Patch Changes
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- Updated dependencies [50e50f1]
- @nudojs/core@1.7.3
- @nudojs/service@1.6.3
0.4.18
Patch Changes
- 446914f: fix(vite-plugin): checkSource 崩溃不再静默吞掉——默认
this.warn("[nudo] check failed for <id>: <msg>"),failOnError: true时升级this.error红构建(与 CLI BUG-023「注入/装配失败必须红」同口径);check 面按 (id, source) 套会话缓存,同一 build 会话内未变文件(如 client/SSR 双环境重复 transform)不重跑 check 推断链。 - Updated dependencies [446914f]
- Updated dependencies [446914f]
- Updated dependencies [a00bccc]
- Updated dependencies [446914f]
- Updated dependencies [39332ca]
- Updated dependencies [446914f]
- Updated dependencies [89358f2]
- Updated dependencies [89358f2]
- Updated dependencies [89358f2]
- Updated dependencies [446914f]
- @nudojs/core@1.7.2
- @nudojs/service@1.6.2
0.4.17
Patch Changes
- Updated dependencies [ef514a8]
- @nudojs/core@1.7.1
- @nudojs/service@1.6.1
0.4.16
Patch Changes
- Updated dependencies [f6ec0e8]
- @nudojs/core@1.7.0
- @nudojs/service@1.6.0
0.4.15
Patch Changes
- Updated dependencies [2f9717b]
- @nudojs/core@1.6.0
- @nudojs/service@1.5.0
0.4.14
Patch Changes
- Updated dependencies [64ca356]
- @nudojs/core@1.5.0
- @nudojs/service@1.4.0
0.4.13
Patch Changes
-
f10066d: fix: repository-scale bug hunt — algebra, CLI, IDE, cache, release hardening
Correctness (core algebra / check):
Symbol() < 1now TypeError (cmp relational ops);eq/neunchanged- bare prim contracts reject obj/arr/tuple/fn/brand/eff returns
lit(undefined)is a real literal (LitValueResult {ok,value}tagged path)- empty-sum reduce guards (DEC-006); explicit re-exports win over
export * - projection fidelity: tuple holes, tuple-rest parens, schema eq-app anchoring
Design refactors (additive public API):
LitValueResult+ bigint inLiteralValueAbsApplyResult {abs,throws}+callTranspiledExportApply(sole wrap point) +$callthrows routingdirective-scansingle-source extractors; directives bind AST nearest Function (nested/class/object methods)stablePathKey/stablePathKeyGraphfor L0/LSP/CLI/disk path identity
Product / CLI / migrate:
check --jsonpath errors enter the CheckJson envelope (pathErrors,ok:false); ok↔exit single source- migrate: missing paths error (no parent
package.jsonfallthrough); retire is atomic with rollback; rewritten paths are single-quoted - malformed directives warn instead of silent drop;
@nudo:skiprequires explicit types
Service / cache:
- disk-cache atomic write + portable path keys (incl. maxForks in cache key)
- pure memo replays may-throw; bounded memo maps; sidecar EACCES ≠ missing
IDE / extension:
- LSP path-key unify (Windows drive forms); directive diag watermark; hover follows G2 scope
- VS Code client catches start/sendRequest; selectCase rollback
Release / CI supply chain:
gen-llmsconfines slug writes under build root (path-escape fix)- gate-major: 2.x / major jumps / first 1.0.0 need
confirm_major; 1.x train auto-publishes - release: quoted secrets, tag whitelist + semver precedence incl. prerelease, pinned website actions
-
Updated dependencies [f10066d]
- @nudojs/core@1.4.0
- @nudojs/service@1.3.0
0.4.12
Patch Changes
- Updated dependencies [8df9215]
- @nudojs/core@1.3.1
- @nudojs/service@1.2.4
0.4.11
Patch Changes
- Updated dependencies [6bc08c7]
- Updated dependencies [d925692]
- Updated dependencies [c717017]
- @nudojs/core@1.3.0
- @nudojs/service@1.2.3
0.4.10
Patch Changes
- Updated dependencies [662aeb5]
- @nudojs/core@1.2.2
- @nudojs/service@1.2.2
0.4.9
Patch Changes
- Updated dependencies [7b8df37]
- Updated dependencies [af8cb68]
- Updated dependencies [ff37d91]
- @nudojs/core@1.2.1
- @nudojs/service@1.2.1
0.4.8
Patch Changes
- Updated dependencies [5ff4202]
- Updated dependencies [5ff4202]
- @nudojs/core@1.2.0
- @nudojs/service@1.2.0
0.4.7
Patch Changes
- Updated dependencies [634932f]
- @nudojs/core@1.1.4
- @nudojs/service@1.1.4
0.4.6
Patch Changes
- Updated dependencies [3bf9997]
- Updated dependencies [43fb345]
- @nudojs/core@1.1.3
- @nudojs/service@1.1.3
0.4.5
Patch Changes
- Updated dependencies [c1f3e93]
- @nudojs/core@1.1.2
- @nudojs/service@1.1.2
0.4.4
Patch Changes
- Updated dependencies [86d1f87]
- Updated dependencies [892899d]
- Updated dependencies [faccd76]
- @nudojs/core@1.1.1
- @nudojs/service@1.1.1
0.4.3-beta.1
Patch Changes
- Updated dependencies [4305674]
- @nudojs/service@5.0.0-beta.1
0.4.3-beta.0
Patch Changes
-
P1–P3 engineering hardening (review follow-ups) — no product-face breaks
- @nudojs/parser: export typed Babel AST narrowers (
ast-guards.ts); serviceanalyzer-ast/ lspsymbolsno longer useas anyon nodes. - @nudojs/cli: extract pure decision modules (
check-gate-config,check-json-map,check-ci-flags,export-format) and cover them with in-process unit tests; per-package coverage floors raised. - @nudojs/service: host cache-invalidation contract documented (
docs/design/cache-invalidation.md) + C1–C8 regression tests; LSP targeted eviction now clears path-env and abs-module cache for changed deps. - @nudojs/lsp:
server.tssplit into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction. - @nudojs/service:
interface-derivation/analyzer-orchestratesplit into cohesion modules with stable facades. - Docs: trust-boundary note in Quick Start, version narrative consistency, env mock-boundary checklist, CheckJson
actions[]field table. - vite-plugin: named
logAnalysisSummaryhelper (logging surface unchanged).
- @nudojs/parser: export typed Babel AST narrowers (
-
Updated dependencies [22baf33]
-
Updated dependencies [0e1432a]
-
Updated dependencies [3c3f9d2]
-
Updated dependencies
-
Updated dependencies [279d73a]
-
Updated dependencies [5a5e167]
- @nudojs/core@3.0.0-beta.0
- @nudojs/service@5.0.0-beta.0
0.4.2
Patch Changes
- Updated dependencies [69ebbf6]
- @nudojs/service@4.0.0
- @nudojs/core@2.1.0
0.4.1
Patch Changes
- Updated dependencies [9731238]
- @nudojs/core@2.0.1
- @nudojs/service@3.0.0
0.4.0
Minor Changes
-
aea83f6: BREAKING (fix-2: close TypeScript DX gaps):
- C0.1 contract model: body-AST required-slot inference removed.
nudo:arg-structurenow means HOF argument not callable / arity mismatch only. Obligations come from explicit*.nudo.js/@nudo:refinecontracts or call-site facts; no evidence → any. Migration: add a sidecar shape contract where you need structure checks. - A1 analysis default:
package.json#nudo.analysis.modeshipped default is nowexports(wasdirectives). Files withexport/ sidecar /@nudo:directives are analyzed by IDE/build. Escape hatch:"mode": "directives"(previous silence) or"all"(every target path). Named-path CLI commands still analyze the named file regardless of mode.
Release notes / policy:
docs/versioning.md. Scope defaults:docs/design/cli-semantics.md.Feature highlights (after accepting the defaults above):
- Core algebra: Map/Set literal tracking + fork join, loop early-return fold, catch param binding,
==/!=fold, logical assignment, HOF relations, class-method sidecar keys (Class.method/Class_method, local declaration name forexport { Local as Public }) - Interface product:
nudo interface --draft(code-first contracts), enforcement tiers, CJS/default/class export forms - IDE: LSP buffer-aware sidecars, quickfix/code actions, validate cancel + debounce, diagnostics tiers, agent/LSP parity
- Scale: disk CheckJson cache, analysis session memo, call-site budget, watch invalidation (sidecar/config/env)
- dts projection quality (tsc-clean HOF/unions), vite-plugin aligned to
analysis.mode
- C0.1 contract model: body-AST required-slot inference removed.
Patch Changes
- Updated dependencies [aea83f6]
- @nudojs/core@2.0.0
- @nudojs/service@2.0.0
0.3.4
Patch Changes
- Updated dependencies [61b8a6c]
- @nudojs/core@1.0.1
- @nudojs/service@1.0.1
0.3.3
Patch Changes
- Updated dependencies [0fd253f]
- Updated dependencies [a2aac9e]
- Updated dependencies [0f0b7d5]
- Updated dependencies [de47d84]
- Updated dependencies [78f6752]
- @nudojs/core@1.0.0
- @nudojs/service@1.0.0
0.3.2
Patch Changes
- Updated dependencies [1d6bb01]
- Updated dependencies [1d233a7]
- @nudojs/core@0.4.0
- @nudojs/service@0.3.2
0.3.1
Patch Changes
- bee69d4: Publish built dist instead of TypeScript source: packages now ship compiled ESM + .d.ts, CLI bin gets a shebang,
nudo --versionreads the real package version, andnudo checkaccepts multiple paths. - Updated dependencies [21427eb]
- Updated dependencies [df1726c]
- Updated dependencies [bee69d4]
- Updated dependencies [8d85d99]
- @nudojs/core@0.3.1
- @nudojs/service@0.3.1
0.3.0
Minor Changes
-
5786fa5: Ship TypeScript-aware defaults and Abs check diagnostics in the Vite plugin.
- Default include covers
.js/.mjs/.ts/.mts; exclude also skips*.d.ts. - Glob matching is a real anchored RegExp (not
endsWithheuristics). - Runs
analyzeFileAsyncpluscheckSourceso Abs constraint issues surface as Vite warnings/errors. - Exposes
clearAnalysisSessionCachesfor long-lived Vite processes.
- Default include covers
Patch Changes
- Updated dependencies [5786fa5]
- Updated dependencies [5786fa5]
- @nudojs/core@0.3.0
- @nudojs/service@0.3.0
0.2.1
Patch Changes
- @nudojs/service@0.2.1
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version
Patch Changes
- Updated dependencies [6c38283]
- Updated dependencies [9f7f819]
- Updated dependencies [c175f71]
- @nudojs/service@0.2.0
0.1.0
Minor Changes
- Conceptual design and basic implementation.
Patch Changes
- Updated dependencies
- @nudojs/service@0.1.0
nudo-vscode 0.3.7
Unreleased
- Settings wiring is real now:
nudo.analysis.modeis forwarded to the language server asinitializationOptionsand re-pushed onworkspace/didChangeConfiguration(only fornudo.*changes). Priority: an explicit projectpackage.json#nudo.analysis.modealways wins; the VS Code setting only provides the default when the project does not set it (also stated in the setting description).nudo.coexistence.suggestMuteTsValidationis consumed extension-side: when false,Nudo: Apply coexistence settingsno longer offers the tsserver mute suggestion — only the guide link. - Case highlight decorations now parse via
@nudojs/parser(parse+extractDirectivesQuiet, the same@nudo:casegrammar as the server) instead of a parallel regex implementation in the extension; pure span computation lives insrc/case-decorations.ts(unit-tested), the extension only maps spans tovscode.Range. - Bundle fix:
tsupauto-externalizeddependencies, soout/extension.jsshipped unresolvablerequire("vscode-languageclient/node")(and would have for the new@nudojs/parser) while the vsix excludesnode_modules/.tsup.config.tsnow bundles both into the self-containedout/extension.js.
Version history (3)
0.3.7
- Current published line (Marketplace + Open VS X via release CI).
- Launch the bundled
server/server.js(compiled@nudojs/lspdist) over IPC instead oftsx+packages/lsp/src/server.ts. The vsix is self-contained — no monorepo sibling path or tsx loader required at runtime. - Commands:
nudo.selectCase/nudo.contract/nudo.contract.draft/nudo.contract.emit. - Intermediate 0.3.1–0.3.6 were release-CI auto-bumps alongside the monorepo
@nudojs/*line; see gitVersion Packagescommits.
0.3.0
Minor Changes
- Ship the B-path engine line with the monorepo 0.3 packages (
@nudojs/*0.3 /@nudojs/lsp0.4): faster incremental analysis, Abs module graph, and LSP hover via Abs node tables.
0.2.0
Minor Changes
- 6c38283: docs and ci
- 9f7f819: fix pkg info
- c175f71: version