Skip to main content

Full release history

Generated by pnpm run docs:gen from packages/*/CHANGELOG.md — do not edit. Breaking entries carry **BREAKING** and a one-line migration.

Full history (including archived older versions). Current snapshot: Releases.

PackageCurrent version
@nudojs/core1.20.1
@nudojs/service1.12.3
nudojs (CLI)1.9.3
@nudojs/parser1.5.11
@nudojs/lsp1.10.3
@nudojs/env0.5.11
@nudojs/harvester0.6.3
vite-plugin-nudo0.7.4
nudo-vscode0.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 .ts constructor annotation (including parameter properties) is now the instance field's domain, so constructor(private size: number) + area() { return this.size * this.size } reports number instead of an any-arithmetic nudo:entry-may-throw error while the dts face already said number;
    • definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero, in on 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-level const (false red) and destructured declarations reach the obligation check (false green);
    • a classic for (const i = 0; …; i++) head is a const again, so the always-throwing step is reported instead of staying green;
    • nudo:capability-denied joins the check-face diagnostic whitelist, so nudo check can report the cause of unknown like nudo test — gated on the report actually showing an inference failure (nudo:unknown-inference), so a plain module.exports = … file does not grow a warning about the module global while the same exports written as exports.x report nothing.
    • cross-file evidence from --from now resolves the default export name on both sides, so a renamed default import, import { default as g } and ns.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 from effectiveContract'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 for export 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>Input keys a destructured parameter by its field names rather than the internal _p0 placeholder, 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) alongside module.exports = value keeps the named-export projection (TS forbids export = next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than one return projects unknown instead 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 check entry 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.

  • 161d156: Switch the check entry 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 false nudo: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 typed Evidence verdict; it only records divergences and does not change any export decision. Stage 1 slice 4.2 switches only the diagnostic surface: nudo export now prints degraded evidence codes (nudo:internal, nudo:unknown-inference, …) instead of silently dropping them; blocking and exit codes still follow EXPORT_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() includes NaN and ±Infinity, so a sequential guard such as if (x < 1) return 0; return x + y; cannot assume x >= 1 on the fall-through path (NaN < 1 is 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 $refineNotNaN also count as evidence). NaN guards (Number.isNaN(x), x !== x, x === x, !Number.isNaN(x)) establish ne(x, NaN) on the arm where that holds; Number.isFinite(x) is one-sided (true arm only). A const / let / var alias such as const 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-shadowed Number disables the builtin guard fact (fail-closed). De Morgan spellings (x < 1 || y < 2) are complemented per disjunct. The previous unproven results for bare number() are unchanged.

    Literal NaN / ±Infinity arguments (including 0/0, Number.NaN, Number.POSITIVE_INFINITY) now violate a finite precondition instead of passing silently; NaN and ±Infinity globals are modeled as literals.

    兼容性:新增 builder 方法与非 NaN 证据下的精度收紧;未使用 .finite() 的 既有契约输出逐字节不变。

Patch Changes​

  • c93a32d: Cache directive-scope scanning per AST and version facet keys.

    listFnDirectiveScopes was re-walking the whole AST for every function query (findFnDirectiveScope is called per function by checkSource), 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 and parseSource returns the same object for the same source, so caching cannot change results; a regression test pins the identity.

    facetKey now carries a v1: 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 of leqAbs / 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.

    parseSource already 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. Threading filename from analyzeFile, transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors and localNamedExports drops 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% (checkSource path 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.

    • matchRelIdentLitComposite keeps every guarded name in a relational conjunction (x >= 1 && y >= 2), exposing the non-first names as RelGuard.others; narrowRelArmThunk applies them all as $refineRel shadow rebindings in the fact arm. Same-name bounds stay in extra (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) keeps x's bound inside the right side.
    • New relGuardOfNegation / narrowRelNegationArmThunk: when the test is !(A ∧ …), the false arm (early-return rest path, if else arm, ternary alternate, || right operand) soundly asserts every relational conjunct of A — ! is exact boolean negation, so NaN cannot slip through (!(x < k) false ⟺ x < k true). 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, and if (!(x >= 1 && y >= 2)) return 3; return x + y now discharge return number().ge(3); the sequential guard-clause and De Morgan spellings stay nudo:unproven-return because number() 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).

    • Shape fn branch gains optional overloads?: FnOverload[] ({ paramTypes, returnType }[], declaration order = TS resolution order). Absent ⇒ every existing shape, key, and projection is byte-identical.
    • instantiateReturn dispatches on overloads: first arm in declaration order whose arity matches and whose params accept the arguments (per-param leqAbs, α 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). HarvestSig gains overloads so disk-cache round-trips keep the dispatch face; HARVEST_DISK_ABI v13 → v14 (old entries miss cleanly instead of silently losing overloads).
    • absKey includes overloads (distinct overload sets no longer share memo/fingerprint); substShape substitutes arm Abs data; snapshotAbs deep-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 check goes from 2 L2 entry-may-throw false reds (method 'toFixed' missing on string receiver / symmetric) to OK, matching tsc --strict exit 0; useNum() => string / useStr() => string exact. 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:assume and @nudo:invariant accept 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. EffectiveContract carries a cross-slot binder table so fn({...}, array(ref("b"))) can reference a binder declared in a callback slot. Unbound refs fail closed (nudo:contract-load) and never degrade to any().
    • 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 / rel builders plus BinderTable and resolver helpers (public API snapshot updated).
  • ca8005b: ABS-02: explain where unknown / any came 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 or leqAbs change; 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:budget cannot help.
    • nudo check --explain-unknown prints the list after the human report; default output is byte-identical and --json / --gitlab machine contracts are unaffected.
  • 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 >= c proves when A has non-NaN evidence (c <= 0), or a non-strict lower bound L >= 0 with fl(L*L) >= c (monotone rounding). Strict targets stay unproven — x > 0 ⇒ x*x > 0 is false at x = 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) and x >= 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.
  • 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-inferred info 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:invariant declaration enters the proof (audited via nudo: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).
  • df56e83: ABS-09: coinductive leqAbs for recursive types.

    • leqAbs now 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 with leq 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 post Abs of 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 PolyFn instance (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.
  • 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.
    • formatConstraint renders 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.ts now carries optional formals / argKeys / bounds / pre / eff and a per-function entry (fn\0<scope>) on the SAME Map; fnSummaryStats() keeps its instance-level meaning, function-level hits/rejections are exposed by fnSummaryFnLevelStats() (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.bounds is 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 sorted varOrder used to transpose arguments (f(z,y) → f(p,q) returned q - p);
      • arg isomorphism: per-position α-normalized absKeyWithConf keys (shape × term × pred × conf) — a kind-only signature used to reuse {x:1} summaries for {y:"s"}, length-2 summaries for length-3 tuples, and Date summaries for RegExp;
      • full precondition: the formation-time Φ (pre, renamed formals → current argument vars) must be implied by the current Φ — checking only the simple bounds projection dropped app-term conjuncts, so x % 2 === 0-formed summaries leaked to unconstrained calls. Then substAbs(post, map) is applied instead of re-running the body. bounds stays as observable metadata only.
    • All three conservative channels are on by default (crossModule, bodyUnavailable, budgetTruncated); the degraded channels are verified independently (abs14-degraded-channels.test.ts), gated off symbolic runs 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) plus abs14-fastpath.test.ts calling diffAgainstBodyBaseline. 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 asserts applied grew — 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).
  • 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 / 指纹,无需手工清缓存。core formatShape 的展示面不发布生成器身份(既有契约,逐字不变)。

    残余批次(同批发布):

    • A2 声明/收割面:declare class 类值挂 callable:false;JSON.stringify(obj, 类构造器) 由 may-throw 升为确定抛 TypeError。HarvestSig.fn 新增 callable 字段、HARVEST_DISK_ABI v14 → v15(~/.cache/nudo/deps/ 旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs 的 absFunction mock 重建也整包搬运槽位。
    • 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 interface terminology to contract end to end.

    • Core: effectiveInterface → effectiveContract, InterfaceSource → ContractSource, InterfaceTierInfo → ContractTierInfo, interfaceTierOf → contractTierOf, takeInterfaceDiags* → takeContractDiags*, and the algebra/interface/ directory → algebra/contract/.
    • Service: emitInterface / draftInterface / interfaceSurface → emitContract / draftContract / contractSurface; interface-*.ts files → contract-*.ts; ifaceCacheKey → contractCacheKey and the disk-cache namespace iface → contract.
    • Diagnostics: nudo:interface-* → nudo:contract-* (no alias layer).
    • CLI/LSP: CodeLens titles ⚡ persist contract / ↻ update contract / ⚡ draft contract; agent messages no contract found / no contract changes; CheckIssue actions and hover/inlay fields use contractSource / contractDisplay / contractActive.
    • Docs, examples (contract-derivation/, contract-draft/), API snapshots, and website references updated.

    TypeScript's interface keyword, Babel AST TSInterface*, and historical release notes are intentionally unchanged.

  • 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 标注。

  • 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() 时提前落地(native 1 / "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.ts c3/c4 断言重订 + 2 例推进用例(14 例全绿);eval-generator-cross-function-consume.test.ts 的步骤 4 it.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 $gen body (all four emission sites: declaration, function expression, object method, class method): snapshot the outer free-written bindings ($copy with a shared identity memo) before the eagerly-collected body, fold back n = $join(before, after) in a finally (body throws fold too). Reuses collectFreeAssignedNames (same analysis as the fork protocol, minus param pattern names and body var hoist names — those are generator-local) plus expandAliasNames (const alias partners snapshot together). $copy/$join are existing runtime exports — no public-surface change.
    • Symptom rows go from wrong-exact to sound over-approximation: construction-point n 1 → 0 | 1, log "ab" → "" | "ab" (native construction values 0/"" are in the join); same for the it.next() observations (5 → 0 | 5, "ab" → "" | "ab"). Residual (needs true suspension, doc §5.4): the first-yield suspension-point intermediates (native 1/"a") are still not in the join — the Abs domain has no timeline axis.
    • Load-bearing eager collection untouched: element face and conf still baked at construction (generator object pins { "0": 1, "1": 5 } #exact unchanged) — Generator<any | number> signature face does not degrade. Generators that write no outer bindings transpile byte-identical; body-local var/let/params never enter the snapshot set (no TDZ).
    • One pinned expectation updated: exec-generator-consumption.test.ts nested-generator Bug 52 case — the leak carrier is now the sound join undefined | 77 (native: undefined at construction, 77 after drain) instead of exact 77; 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 exact formatAbs pins, all four emission sites, element-face preservation, and negative controls (protocol/yield sequence, destructuring lowering, no-outer-write, body-local var/param).
  • c6cf8fa: Fix: substAbs no 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 the attachFnImpl side-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 to any/unknown where the un-substituted signature was precise.
    • Carrying discipline (substFnImpl in hof.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 (fingerprint sharing matches the documented same-signature budget-key semantics); the relation slot is Abs data and is substituted by the map, sharing references with the substituted shape slots (the relationFn double-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) and slots (dual-facet callable-with-members), matching the snapshotAbs fn-branch discipline; slot values are substituted by the map.
  • fb54d1a: ABS-05: conf and cache-key audit — instantiate memo no longer shares results across confidence levels.

    • Added absKeyWithConf (internal): the default absKey plus a recursive conf digest over the same traversal order. The default absKey stays 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, analysisFileCacheKey do not depend on conf; instantiateMemoKey does.
    • Fixed the consumer instead of widening the default key: instantiateMemoKey now includes the conf digest, so an identity function instantiated with a #widened argument returns #widened instead of inheriting a cached #exact result. Same-conf calls still share (memo hit by object identity).
    • Cold/warm equivalence pinned: a repeated checkSource run produces byte-identical CheckJson.
  • 9886482: Fix ABS-14's TypeParam.bounds always being empty.

    entryReqs[].pred comes from instantiateConstraint(c, paramName) and therefore uses argument names (typeof x = number, x > 0), while the bound registration validated it against TypeParam.id / formals in alpha space (A1, A2). Every variable was rejected as unbound, so bounds was never written.

    • key/summary-bounds.ts gains alignSimpleBounds: rename params[i] -> ids[i] via renamePred, then apply the existing collectSimpleBounds simple-condition / one-way-dependency checks. Unmapped names (binders, undeclared vars) and app terms stay fail-closed and are dropped.
    • generalize.ts now registers bounds through that helper. entryReqs and Phi keep their original argument-name space (display and body monotonicity propagation depend on it), so display, symbolic, check and export output are byte-identical.
    • With fn({ x: number().gt(0) }), typeParams[0].bounds goes from undefined to [typeof A1 = number, A1 > 0]; with two parameters the bounds land on A1 and A2 respectively.
    • 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 α-space Preds that implies can decide directly and that behave correctly when used as a summary entry's pre). Reverting the rename makes 8 cases fail.

    TypeParam.bounds is 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.refine still disables summaryScope (ABS-10), so contract-bearing functions do not write function-level summaries. attachHofSnapshot not passing refine is 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 as debug/src/common.js's function debug(...args) { args[0] = ... } therefore threw V8's native TypeError: Assignment to constant variable during module evaluation, making nudo check fail closed with nudo:module-throw. Both emit sites now use let (native rest bindings are mutable). Regressed by eval-rest-param-rebind.test.ts; reverting to const makes all 9 cases fail.
    • ABS-14 degraded channels enabled: bodyUnavailable and budgetTruncated now default on alongside crossModule. The replacement logic is extracted to key/summary-fastpath.ts#tryDegradedChannel and verified independently by abs14-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 stays unknown #opaque. The read side is gated off symbolic runs (same as the write side and the cross-module channel, so a prior instantiate can 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.ts now translates expressible contract Pred leaves into type-parameter constraints — primitive typeof tags, eq(var, lit) literals, and fully-expressible or unions. Numeric bounds, lengths, negations and typeof object|function are honestly omitted; unbound declarations stay byte-identical. Projection reads contract.params[].abs.pred directly, so AnalysisResult and its cache cloning are untouched. Covered by abs14-dts-extends.test.ts including a tsc --noEmit round-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 existing VERSION_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-debug now states that the return face depends on whether the real debug package resolves; verify:examples pins only OK / 0 error / export names, not nudo:opaque-result.

    The TypeParam.bounds empty-field debt noted in this changeset was fixed in a follow-up commit (Pred variable-space alignment via alignSimpleBounds + abs14-bounds-integration.test.ts); attachHofSnapshot not passing refine was re-checked and confirmed to be correct design, not a defect.

  • 53d8248: Fix async-generator replay rejection. When a replayed finally throws during .return()/.throw() on an async generator, the runtime now returns the rejected promise directly instead of wrapping it again in deliver, so awaiting the call rejects like native. Fixture: async function* g() { try { yield 1 } finally { null.x } } + await it.return(0) now yields promise<"rejected"> instead of promise<"resolved">. Side-effect finalizers keep resolving (promise<true>), pinned by abs13-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 SharedArrayBuffer at evaluation: NAMESPACE_ONLY_HOST_CTORS (exec/runtime/members.ts) and NAMESPACE_GLOBALS (exec/runtime/containers/member.ts). In non-crossOriginIsolated contexts Chrome does not expose it ⇒ ReferenceError: SharedArrayBuffer is not defined at 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 Float16Array guard 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.
  • 949ddce: Restore call-site scan cost: one dependency fingerprint per scan instead of one per call site. scanLiteralCalls asked generalizeFromAst for the same function once per literal call site, and each call recomputed refineDepsFingerprint (a disk BFS over loadModule deps + 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 — commander checkSource regressed 601ms → 2475ms since the call-site enforcement batch, which is what kept the OSS baseline gate red (commander: check all 3.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 as depsFp to the own-call and inline same-file generalizeFromAst sites; 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. commander checkSource returns to 678–881ms (baseline 601ms) and the OSS check all total 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 in module.builtinModules on 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-denied diagnostic (ABS-12 R12-D, strict by default). Host globals and node: modules classified as denied now report this code — values stay unknown and are never executed natively — instead of nudo:builtin-unknown; denied modules are reported at the import/require site. Module classification only covers builtins (node: prefix or module.builtinModules), so relative paths and npm packages keep their existing missing-module channel. NUDO_CAPABILITIES=trusted (or setCapabilityMode("trusted")) restores the previous builtin-unknown surface and limits runtime identity blocking to the hand-written high-risk list; unclassified names (typos) remain builtin-unknown in both modes. Docs updated (EN + zh-Hans). Pinned by capability-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.ts classifies 188 host globals and all node: builtins as allowed/denied with default-deny, plus snapshots for drift gates; neverExecHostName now blocks every denied host function by identity (aliases such as const f = BroadcastChannel included), not just the hand-written fetch/timer list. Denied values still degrade to unknown (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: the nudo:capability-denied diagnostic code, module-resolution denial, and the --capabilities trusted opt-out.

  • 49cdb00: Fix whole-file checkSource memo thrashing on medium monorepos: raise MAX_CHECK_MEMO from 256 to 1024 (aligned with MAX_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 — warm check all degenerated into a full recompute (real corpus: 43.9s; a 200-file control run inside the old capacity was 433.7ms). The per-round evalRunMemo keeps 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. copyWithMemo now 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 one WeakMap query is saved on every leaf (71.4% of calls in the ABS-17 reproducer). The obj / fn slot loops also switch from Object.entries to Object.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 earlier setSlot fast path the same file goes from 8524ms to 3297ms (-61%). Copy semantics (leaf sharing, fresh non-leaf copies, alias preservation, slot flags) are pinned by copy-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, with N = 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/internal so 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:mock skeleton per host family — fetch gets @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) gets stub().returns({ … }) (an arrow mock is not constructible — new on it would trade the Info for a throws TypeError may-throw). All skeletons verified end-to-end: pasted verbatim into the calling function's JSDoc, the diagnostic disappears and the result regains precision. The structured mock action in check --json carries the same skeleton.
    • nudo:recursion-truncated: the depth/calls arms of the suggestion (and the @nudo:budget quickfix in nudo check --fix / LSP code actions) now carry concrete values derived from the observed depth/call counts — @nudo:budget depth=128 / calls=40000 floors (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 a reason keep the old forks=64 quickfix shape.
  • 018bc20: Refactor: engine review clean-up batch — consolidate duplicated logic and add drift guards, zero behavior change.

    • runtime: route $for exit-join through the shared applyLoopExitJoin entry (container-widen hook parameterized); extract arrayFamilyElementDomain as 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.ts onto one parameterized skeleton; split stmt/statement.ts (2619 lines) into module-stmt / loop-stmt / switch-stmt / try-stmt domain files; converge the emitMemberTargetAssign fallback arm onto a member-path.ts planning function.
    • class: extract resolveChainSpec cursor primitive (replaces 6 hand-copied BUG-172 chain walks); table-drive the Number/BigInt prototype radix/precision domains; split class/invoke.ts (2283 lines) into prim-methods.ts + proto-borrow.ts; drop the dead no-hasExtends legacy arm of $class.
    • guards: new nudo-injection-names drift gate pinning the 12 __nudo* host injection names against emitted code; new invoke-arr-method-parity test pinning the Array.prototype generic-borrow path against invokeArrMethod.
    • docs: kernel-merge.md collector-scope table — move yieldStack / genPathSensitive / genJoinOverride to the scoped row (matches createScopedSlot reality).
  • 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 — $invoke in-place mutation under Bug 49/51, expression-position self-contained IIFEs) to emitStmtWritebackRebinds; its sole remaining duty is the Bug 96 statement-position RegExp state write-back ($reStateCall). Split transpile/helpers.ts (2016 lines) into domain leaf files under transpile/helper/ behind the unchanged helpers.ts facade barrel (all existing import paths keep working).
    • class: split class/declare.ts into definition-time ($class spec + registration) and construction/lookup-time ($new / constructClass / findMethod family) modules; lift the ten duplicated validateCallableArg(args[0], …) preflight checks in invoke-arr.ts callback-family methods into one shared wrapper with byte-identical diagnostics; fix the stale registerClassDecl reference 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) from runtime/members.ts into runtime/brand-tables.ts with re-exports preserving the import face.
    • deprecations: registerEvalClass on the public face is marked @deprecated — the registry is internal machinery (core consumers import exec/class-registry.ts directly); the public export is retained for compatibility only.
    • docs: kernel-merge.md collector-scope table — classify the synchronous save/restore-paired flags awaitUnsettledHit and loopSignalFromAbstractArm under the retained row (finally-restored before any await window, no cross-analysis leak).
  • e4dc7df: Surface finalizer throws on generator abrupt completion. When a safely extractable finally thunk 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 by abs13-abrupt-completion.test.ts). Async generators wrap replay errors into a rejected promise where the runtime path reaches it. Remaining follow-ups: finalizers with yield/return/throw statements, for-of break replay 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. LoadDepsFingerprint now exposes the existing root sidecars the ambientAllowed gate could prune (gatedSidecars), and LoadDepsFingerprintOpts accepts loaderIdentity / ambientLoaderIdentity so 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 for opts === undefined calls (a gated result can never leak into an ungated key). check --watch hub rounds drop from 718ms to 456ms analyze (total 667ms) on the 48-file semver corpus, leaf 345ms -> 210ms. Default (no epoch) behavior is unchanged; pinned by load-deps-fp-epoch.test.ts.

  • 06bd8ee: Stop reporting native-impossible fixed values for generator abrupt completion. When .return(), .throw(), for-of break or yield* forwarding terminates a generator inside try/finally, the enclosing finally runs 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. false where native is true). Abrupt completion now joins the suspension snapshot with the terminal frame per captured binding (joinGenSuspendTerminal), which is sound: case results widen from false to false | true. Precision (replaying the finalizer itself) remains a follow-up; no-finally generators and normal exhaustion are unchanged, pinned by abs13-abrupt-completion.test.ts.

  • f7d105a: Replay safely extractable finally blocks 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/$yieldStar so .return() / non-catch .throw() can restore the suspension snapshot and execute them innermost→outermost. Results tighten from the sound false | true guard to native-exact values for .return() and .throw() through side-effect finally, 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-C join fallback. for-of iterator close and async-generator finalizer throws remain follow-ups. Pinned by abs13-abrupt-completion.test.ts (11 cases).

  • fdc0a5a: Replay finally for for…of exits over generator objects. $forOf eagerly drains a generator's elements before the loop, so a break (or throw/return in 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 attaches returnAt(k) to each generator object: it rewinds the consumption cursor to the k-th yield, restores the suspension snapshot, replays the finalizer (and forwards through yield*), 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()) break across try/finally now yields the native-exact cleanup value; yield*-delegated breaks and finalizers with their own control flow keep the plan-C over-approximation. Pinned by abs13-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 $rebindable predicate.

    • 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 (including let x = $lit(void 0)). The fork/switch/generator binding join ($join($copy(host), …)) and the member-write root rebind used to write an asAbsVal wrapper back into globalThis: debug/src/node.js (top-level Object.keys(process.env) + save()'s process.env.DEBUG = … inside if/else) replaced the host process object (process.exit / prependListener gone → tsx preflight crash), and @changesets/cli's lazy error-code classes (Error.stackTraceLimit-style host-function member writes) replaced globalThis.Error with a facade Abs (every later err instanceof Error crashed).
    • Fix: emit name = $rebindable("name", name) ? <join / rebind> : name at every binding join (fork, switch pack, generator free-write fold-back) and at member-write root rebinds (single-layer, propagation, read-modify-write, delete). $rebindable is 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 to globalThis[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 — host process/Error identity & shape unchanged across top-level if/else member writes, host-function member writes, generator bodies; local fork join still applies).
    • Evidence: analyzeFile over all of debug (4 files) and @changesets/cli (22 files) leaves process/Error intact (previously corrupted after the first file).
  • b6cdf66: Stop invalidating the whole dependency chain for inert edits. Dependency contents now enter every cache key through the same stableAnalyzeKeySource projection the entry file already used: trailing comments/whitespace that carry no @nudo directive no longer flip the dependency fingerprint (check disk keys, evaluator memo, generalize L0, per-fn memo), while real code, line shifts and @nudo directives still do. check --watch now 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 edit analyze 3313ms → 2597ms, leaf 1009ms → 875ms. A single dependent's analyzeFileAsync drops from ~663–734ms to 9.9ms after an inert dependency edit, while a semantic edit still misses (172ms). The residual watch cost is the check verb's own checkSource (~500ms/file, memo keyed by module-map identity), tracked as the next ABS-18 item. Pinned by load-deps-fp-stable.test.ts and abs18-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-drift test (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 under new 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 four asyncBodyPlan consumers covered (function / object method / class method / top-level await).
  • 4ea0cbc: Speed up slot writes on the object-copy hot path. setSlot no longer calls Object.defineProperty for every key: plain assignment has the same semantics for an engine-owned slot record (own, enumerable, writable, configurable data property), and __proto__ keeps the defineProperty path 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%). setSlot self-time in that stack falls from 33% to noise. Semantics are pinned by set-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) — checkSource no longer crashes on bundles that return host globals.

    • generalize's symbolic run declared Abs but could return a leaked host value (a function body return process / return JSON / a host object flowing out of the transpiled unit) ⇒ formatPoly → formatShapeSlot read .shape of a non-Abs and crashed (Cannot read properties of undefined (reading 'k'), reproduced by checkSource on @babel/types/lib/index.js).
    • Fix: after runCore, non-Abs results go through asAbsVal (host functions → stable facade Abs, other host values → wrapper Abs) — the same host-bridge normalization already used by $call / member reads. undefined keeps the existing fail-closed unknown+opaque path.
    • Regression: checkSource over the full @babel/types bundle completes; covered by the OSS-corpus candidate re-check.
  • f66e104: Speed up Abs key serialization on cold full-tree analysis: termKey now accumulates app arguments in a loop instead of allocating an intermediate array with map().join(","). Output is byte-for-byte identical, pinned by term-key-serialization.test.ts. On the synthetic 120-file corpus with a clean host env, one cold analyzeFile pass 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): relationFn gains an optional throws carrier (impl.relation.throws — same representation as AbsApplyResult.throws, never/absent = no throw; not written into the fn shape, which has no throws consumer). The $call relation arm routes it through the single routeApplyThrows entry (may-throw → pushThrowExit into 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 passes opts.throws through (opt-in; no existing declaration changes behavior).
    • A4 (construct paths dropped the apply throws slot): the two bare-unpack sites — $new's impl.apply branch (exec/class/construct.ts) and the bind-product [[Construct]] facet (exec/class/invoke.ts) — now route through routeApplyThrows instead of peeling .abs, so constructor-declared throws take effect on new X() too (previously call-face only). Under @nudo:env node, new URL(<invalid or abstract>) now records may-throw TypeError instead of silently succeeding; definite always-throw constructor applies surface as NudoThrow at the construct point. A source gate forbids reintroducing isAbsApplyResult(x) ? x.abs : x peeling 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 pin env-bug-64 2.4 rewritten as a positive assertion.
  • 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()) break across yield*/finally now yields the native-exact cleanup value.
    • Finalizers containing throw are replay-safe: conditional throws observed at the suspension point propagate exactly (sync throw / rejected promise for async generators). When replay is unavailable the runtime records may-throw (YIELD_FINALLY_THROWS) instead of folding a possibly-throwing finalizer into a definite normal completion. Remaining: finalizers with their own yield/return statements still need true suspension. Pinned by abs13-abrupt-completion.test.ts.

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 → new core/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). scanWithStrings was dead after the move and is gone.
    • bigint operand predicates (isNullishLitOperand / isKnownNonBigintNumeric / isMaybeBigintOperand): surface.ts carried a forked copy of arithmetic/coerce.ts — its isMaybeBigintOperand lacked the Bug 946 arr/tuple arms and only stayed sound by accident of the catch-all throw. Single source in coerce; foldNumericBinOp now mirrors foldBigintBinOp's explicit arr/tuple hard-throw so 1n & [] still throws deterministically.
    • Bug 946 member-level fix (behavior): isMaybeCoercionThrowOperand now recurses into sum members and skips arr/tuple members — x & 1 / 1 - x with x: 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 + x on the same union still records may-throw: the number member genuinely throws).
    • collectNestedBodyRanges wiring completed: core exported it via @nudojs/core/internal and its comment claimed parser reuse, but parser still ran a full local copy. file-directives.ts now 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.
    • absShapeForTsTypeText via @nudojs/core/internal: service's tsAnnotationShape was 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.ts and interface-emitter.ts duplicated the export-statement → {names, bindings} extraction (31 lines) and stripSections (14 lines); both now share service/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.
  • 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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • 7d7abe4: Dedup batch 4 (jscpd --min-tokens 70 audit 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 → core formatEntryParamShape via @nudojs/core/internal (the old comment claimed "core adds no export"; the internal face is the sanctioned route).
    • lsp server-code-actions norm/resolveRel copy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) → @nudojs/service/emit exports normPosixPath / resolveRelativeSpec; the lsp-only extensions stay at the call site.
    • standard-schema brand ctor list: GLOBAL_BRAND_CTOR_NAMES local array + Set → schema-generator RUNTIME_GLOBAL_CTOR_NAME_LIST (single array source; Set + isRuntimeGlobalCtorName predicate derive from it; the embedded validator serializes the same array, byte-identical).

    In-file twins single-sourced:

    • core hof.ts: predUsesMappedVars / mapHasShapeOnlyVar → parameterized predAnyVar walker.
    • core scan/literal-shapes.ts: 21 structurally identical constraintViolated issue 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.all dual reject faces → allRejectFace.
    • core check.ts: handwritten return-contract recording block (skip branch + main branch) → recordReturnContract.
    • core leq.ts/postcondition.ts: duplicate primOf single-sourced in leq.
    • core builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) → taOwnKeysTuple; gOPD class/Error/.prototype slot→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/$forOf applyExitJoin closures → new pure loop-exit-join.ts applyLoopExitJoin (the discovered exhausted && widen gate difference is an explicit parameter; $forOf passes exhausted: true, provably equivalent).
    • core directive-scan.ts ↔ parser fn-directives.ts: CASE_TAG_REGEX scan loop → core iterCaseTags(text, caseArgSpans) via @nudojs/core/internal (Bug 978 diagnostic actions and downstream regexes stay consumer-side).
    • service dts-generator.ts: DtsClassMemberSurface base interface — scanClassSurface return type no longer re-declares the member fields (BUG-168/151 docs live once).
    • lsp: replay.ts async env-preload twins share preloadEnvsThen, function scope walkers share walkFnScope; server-navigation.ts references/rename share the gate+parse prologue; hover.ts generalize blocks share tryGeneralizeEnclosing.

    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).

  • 5769211: Dedup batch 5 (jscpd --min-tokens 70 audit 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.ts yield try-context bits (raw 1|4|8 / & 2 / ~(16|32|64) literals pinned by a "钉死同步" comment to runtime control.ts YIELD_* constants) → new zero-dependency leaf exec/yield-bits.ts; runtime (control.ts re-export removed, async.ts) and transpile (statement.ts) both import the named constants.
    • parser case-arg.ts TYPE_EXPR_CHAIN_METHODS hand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exports CONSTRAINT_CHAIN_METHOD_NAMES (public barrel, next to CONSTRAINT_BUILDER_NAMES); parity pinned by constraint-chain-methods.test.ts (method-face drift ⇒ CI red).
    • service builtin-prototype.ts BUILTIN_ERROR_CLASSES verbatim 8-name copy of core ERROR_CTOR_NAMES → imported via @nudojs/core/internal (the dead module-level re-export is removed; no public face change).
    • core promise.ts aggregateErrorAbs local error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated in eval-bug-293-promise-combinator-settle.test.ts (slot-key set / non-enumerable flags / inherited name vs errorBrandAbs).

    Whole-function twins single-sourced:

    • core builtins/error/binary.ts makeArrayBufferAbs / makeSharedArrayBufferAbs → parameterized makeBufferAbs (brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved).
    • core transpile/member-path.ts memberWriteIfe / memberWriteRootIfe → shared memberWriteIfeImpl (only real difference: return written value vs new root).
    • nudojs version.ts three walk-up-to-package.json loops → findPkgDirUpwards + readVersionAt.
    • nudojs migrate.ts planWorkflowRewrites → delegates to planWorkflowRewritesIn(findWorkflowDir(from)); readPackageJsonDetailed / readMarkerFile → shared readJsonObjectDetailed(path, label) (missing / invalid / unreadable / ok grading unchanged).
    • service emit/quickfix-edits.ts sidecarClearsEntryThrow / sidecarClearsConstraintViolation → shared sidecarClearsDiags(input, codes) (Bug 556 dual-code gate preserved).
    • core generalize.ts ctorParamCountOf / ctorFormalsOf twin class-ctor walkers → single ctorParamNodesOf walker (Bug 1031 null-declaration skip lives once; count still raw param length, formals still formalParamsFromNodes — the this-param skip semantics unchanged).
    • lsp server-commands.ts handleSelectCase / handleSelectContract ~20-line resolve→read→caseTargets→knownFunctionNames preamble → resolveCaseTarget (error strings byte-identical).
  • 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_OPS in 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 superSpec reference 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 single rebrandClassAbs primitive 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:examples 251 checks green, build + lint + lint:tests clean, public-api-freeze green (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 into TranspileOptions.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, cmp clean; __nudoLv* / __nudoSw* / __fir* / __swBody* base names unchanged).
    • PrivateName key extraction unified: new privateNameKeyOf (bare #name or null) is the single extraction point; privateNameKeySrc builds on it. The three inlined copies (expr/call.ts, expr/optional-chain.ts, class-emit.ts keyOf) now call it. The dead || undefined branch in optional-chain (#${… ?? ""} is always truthy) deleted.
    • transpile/stmt-predicates.ts → transpile/stmt/predicates.ts (statement-domain file now lives under stmt/).
    • userIdentCache: whole-table clear at 64 → BoundedLruMap(64).

    core runtime:

    • isAbsLike (shape+conf) added to abs.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 local isAbsVal re-definition now aliases it. Behavior delta (bugfix): host objects that merely carry a shape data property are no longer misdetected as Abs values — they now take the host branch as DEC-006 intends. The one inline check inside run.ts:712 generated-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) and callLocStack / absOrigins (member-diag.ts) migrated to createScopedSlot + registerCollectorScopeParticipant; module-global fallback behavior unchanged (generator evaluation is synchronous, push/pop paired).
    • $assumeAnchor (≈80 lines) moved out of runtime/ops.ts into runtime/assume.ts; ops.ts back to pure arithmetic delegation. Export surface unchanged.
    • runtime/containers.ts is a pure re-export barrel again: the five isomorphic guard wrappers ($idx/$idxSet/$get/$set/ $iterCheck) collapsed into guarded-entry.ts's guardedEntry factory (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's evalRunByFile) replaced with BoundedLruMap; 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 from analyzer-abs-eval.ts and the @nudojs/service export 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 calls composeEvalModules; the real differences (mock seeds enter the graph on the analyzer face vs runtime injection on the inject face, fileDirectives vs from-source, structured mockModuleErrors) 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 keeps tryRunEval/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 in mock-abs.ts; all five stamping sites go through it, seed-fn entries now stamped too; the reader (absSeedPart) consumes impl.fingerprint only (single "nofp" marker when absent, no format-string reconstruction). Cache keys change once (harmless miss).
  • 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

Patch Changes​

  • 01a550b: Dedup batch 6 (same-file fragment twins from the jscpd --min-tokens 70 audit; 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 / invokeKey hop 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) — extracted emitInvokeTail; the two arms now only define callOf ($invoke vs $invokeKey) and the method-value read ($get vs $idx). Emitted code text unchanged.
    • algebra/term.ts: surviveMulOne / surviveSubZero verbatim-twin closures → shared toNumberDomainTerm (Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).
    • algebra/check.ts: assume / invariant segment processing shares anchorSurfaceOf (#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) share pushEntryMayThrowIssue — only the actual line 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 share mapElements (index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).
    • builtins/object/methods.ts: Object.keys / Object.entries string- literal receiver arms share stringIndexTupleAbs (code-unit indexing, exact conf; element construction injected).
    • algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk share walkChildren.
    • arithmetic/muldiv.ts: div / mod share 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 as messagePortSlots (same cross-brand sharing pattern as the existing streamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.
    • lsp/src/symbols.ts: FunctionDeclaration / FunctionExpression visitor bodies merged into a single "FunctionDeclaration|FunctionExpression" visitor key (babel traverse alias syntax), bodies were verbatim twins.
  • fd0fb09: Dedup batch 7 (jscpd --min-tokens 70 re-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) → single storageObj const (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → shared execSyncOptions; 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 → emitterCoreSlots shared by the EventEmitter brand and the process global object.
    • env node.ts path family — the drifted manual-sync pair: the top-level pathModule inlined the whole member table next to the platformPathMethods(posix/win32) factory and had already drifted (join.required only on the top-level copy). pathModule now 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 .searchParams slot table and the global URLSearchParams constructor share searchParamsCoreSlots (toString / iterator face / size stay per-site; insertion order preserved).
    • core builtins/error/binary.ts: DataView ctor and makeTypedArrayFromBuffer share bufferByteLengthLiteral (brand→inner obj→byteLength slot fold); TypedArray.of's inlined copy of the number-domain item enforcement now calls enforceTaItem (the .of cause variant is unified into the shared text — no pins).
    • core builtins/object/methods.ts: getOwnPropertySymbols obj arm and brand-inner arm share the ownSymbolsTuple tail (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) share unwrapExportDecl.
    • harvester harvest-dts.ts: resolveIfaceDecls inner-first relative namespace resolution loop (qualified arm + short-name arm) → addRelativeNsHit; absExtends' two es.k === "sum" member folds → foldSumFlags (the cs.k === "sum" fold is intentionally different and untouched).
    • service analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) share actualSlotTable (obj direct / brand inner-obj unwrap).
    • lsp server-navigation.ts: onDefinition now uses the shared navigationIdentAt preamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept.
    • lsp agent-tools.ts: suggestCase / trace share the analyzeToolFile preamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).

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 as nudo:unproven-return instead of silently staying green.
    • BUG-027: export --format dts no longer widens a non-same-prim literal union to its base type, so the published .d.ts matches 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.ts now express the same optionality.
    • BUG-208: sidecar fn()'s throws slot splits separators like @nudo:throws, so throws: "TypeError, RangeError" no longer silently becomes one unknown kind.
    • BUG-209: pick() / omit() / partial() preserve the optional flag, so legal calls are no longer judged violating and dts keeps 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.ts y>1 ⊢ y+1>2truefalseBUG-200:136 触发形态;(1+2**-52)+1 === 2(ties-to-even)
    pred-assume-finite.test.ts 同款truefalse同上
    arithmetic.test.ts x>0 ⊢ x+1>1truefalseBUG-200:14-16,27,30;反例 Number.MIN_VALUE
    example0.test.ts cmp("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} 对 optional string 仍失败(未放宽)。

    回归: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-freeze 9/9。e2e:optional 夹具 nudo check exit 0 且无 nudo:constraint-violated(tsc 亦通过),required 夹具 exit 1 且有该码(tsc TS2322)—— 引擎与 tsc 结论一致。三面同源:check-case-scan.ts 的 witnessViolations 字段循环(@nudo:case 见证面) 也改用同一判定;并补真 CLI e2e cli-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 —— 这是 ES OrdinaryToPrimitive 的规定(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 逐字同形 ⇒ 信息在 降级处丢失,需专用 $toStr op)。

    追加:BUG-058 模板插值 / String.prototype.concat 面已修(专用 $toStr op)​

    ${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​

    模板插值的 $toStr op 是 ./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.js now reports the same three drifts as top.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 (and health stops exiting 1).
    • BUG-030: a contract conflict between two disjoint finite literal sets is an error that short-circuits the undecidable path, so @nudo:assume bounds no longer produce a contradictory "not computable" warning alongside a green gate.
    • BUG-084: @nudo:invariant attribution is driven by a consumption ledger, so nudo:invariant-relied is emitted only for invariants actually consumed.
    • BUG-128: the nudo:entry-may-throw suggestion lists the gate's full remaining kind set (folding the Error family to Error, else a comma list) instead of an arbitrary first kind, so acting on the suggestion clears the diagnostic.
    • BUG-137: a sum containing a true unknown member is reported as inference failure, so nudo:unknown-inference is no longer missed inside a union.
    • BUG-138: a ReferenceError suggestion 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 declaredThrowsForEntry and effectiveInterface().throws.kinds (* wins), so a sidecar's throws is no longer lost when the source carries @nudo:throws.
    • BUG-223: interfaceTierOf classifies only real top-level function bindings (same criterion as the LSP's topLevelFunctionSlots), 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:contract exists (a persisted @generated section 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-syntax instead 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.ts or nudojs/src/commands/test.ts — nudo test never calls checkSource, so nudo:recursion-truncated cannot reach it); BUG-247 (needs axiom seeding in core/algebra/generalize.ts or the LSP hover.ts / inlay.ts callers).

    追加: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 ⇒ 两面同口径。 公共 API checkCall 语义不变。

    回归:core-bug-211-min-max-prim-gate.test.ts(14 例,含手写纯数据约束与返回位同结论)、 core-bug-197-arity-contract-optional.test.ts(5 例,本地 / 跨文件 + 真缺必填对照);mutation 反向验证(删掉那一行 / 退回旧调用 ⇒ 恰好对应断言失败)。相关面 363 通过 + 1 expected fail。

  • aed8e00: Fix bug-report category 03 (evaluation engine) — verified subset.

    • BUG-194: $copy / $set on a host global no longer crash the engine with a bare TypeError (nudo:internal false red); the fork/copy path handles host objects.
    • BUG-218: Proxy has trap 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 a false the host can never produce.
    • BUG-219: delete <host global>.x / "x" in <host global> route through $del / $in correctly instead of raising a bare TypeError.
    • BUG-243: Array.prototype.indexOf no longer clamps fromIndex to len - 1; fromIndex >= length returns -1 like the host (the sibling lastIndexOf clamp 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 as TypeError (host kind) rather than a generic Error.
    • BUG-249: strictEqAbs's "same Abs ⇒ same value" fold now honours the domain-sharing gate, so xs[0] === xs[1] over a contract-typed array no longer folds to true.
    • BUG-254: env-global injection no longer splices names verbatim into let bindings, so a strict-mode reserved word can no longer produce a new Function SyntaxError 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.sh exit 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-throw error —— 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。

  • 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 own name / length / prototype slots.
    • BUG-009: a regexp literal's flags are canonicalised, so /a/gi and /a/ig agree.
    • BUG-132: a boxed primitive's internal slot is modelled.
    • BUG-157: URLSearchParams entries()/keys()/values() are no longer reported as carrying an internal slot.
    • BUG-164: the Object.prototype legacy accessor allowlist and the descriptor table are now the same source of truth.
    • BUG-176: Reflect.construct on a user class is no longer reported as may-throw.
    • BUG-181: Reflect.set with a primitive receiver is a definite TypeError, not a false red.
    • BUG-182: a host function's constructibility facet is decided by IsConstructor, not by the presence of a prototype property.
    • BUG-230 / BUG-260: Set / Map cardinality from an abstract iterable is no longer a definite value, and MapTable carries insertion order so key iteration matches the host and new Set(xs).size agrees with Array.from(new Set(xs)).length.
    • BUG-276: class-instance enumerable flags are correct, so getOwnPropertyDescriptor / Object.keys agree with the host.
    • BUG-277: a builtin brand's user-defined keys are enumerated (entries / getOwnPropertyNames / getOwnPropertyDescriptors / JSON.stringify).
    • BUG-278: an Error subclass's inherited name ordering matches the host.
    • BUG-281: getOwnPropertyDescriptors on a brand instance matches keys/values.
    • BUG-282: a nested same-name @nudo:case scope resolves to the nearest binding, and shape contracts fall back to a prototype-chain HasProperty check.

    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 toJSON half (needs exec/runtime/members.ts BUILTIN_BRAND_METHODS.URL — its host half 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 / closed facet(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.ts slot 类型 + 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 promise node tests instanceof Promise in both the library and the inlined copy, so a non-promise value is rejected instead of accepted.
    • BUG-031: litPredValue became litPredValues and recognises or(eq(...arm), ...), so a literal-union contract renders as 1 | 2 | 3 in the signature face, matching the dts face byte for byte.
    • BUG-087: showLits renders the type (3, "a") instead of leaking the contract DSL spelling (lit(3)) into signatures and slot displays.
    • BUG-092: predAsJs / termIsValue emit Number.isInteger(v) for a %1 === 0 predicate and compare field items by value, so nested numeric bounds agree across all four faces.
    • BUG-095: the arr branch uses Array.from(v).every(...) (holes filled with undefined), matching the standard face — [1, , 3] is no longer accepted by the guard.
    • BUG-097: a slot named like an Object.prototype own member is read with bracket access, so the guard compiles under tsc --strict (TS2367 gone).
    • BUG-098: the brand branch drops observed literals deeply, so a brand built from an observed /abc/i or new 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 FunctionDeclaration without an id).
    • BUG-158: an Arguments brand no longer emits an Array.isArray premise while keeping its length/index semantics, so the guard accepts arguments at runtime.
    • BUG-250: the guard declares const data: any when the contract carries an identity clause, so instanceof narrowing no longer blocks index reads (tsc --strict TS7053 gone).

    Also updates core-bug-348-lit-literal-signature.test.ts, which pinned the f(x: lit(1)) spelling that BUG-087 declares wrong, to the corrected f(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 (needs schema-generator.ts), BUG-108 / BUG-169 (need dts-generator.ts + schema-generator.ts), BUG-156 (needs schema-generator.ts), BUG-191 (needs dts-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 的 declaredParams case "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 透传 view facet(否则形参位会退回对象字面量);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 的 joinObjects facet 传递(objects.ts)。

  • 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(CJS module.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 测试随之复绿。
  • 250f0ba: Fix bug-report category 09 (nudo check gate) — 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.js no longer exits 0 with broken.js unchecked.
    • BUG-047: check --fix advances its plan text outside the --write branch, 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: --only values are validated against the diagnostic registry (unknown codes are a usage error; valid-but-unmatched codes are reported) instead of silently producing 0 edits.
    • BUG-049: a sidecar write failure is reported (check --fix cannot write <path>) instead of aborting the whole run with a bare EACCES.
    • BUG-066: --quiet is evaluated before --abs, so --abs --quiet prints one line instead of the full signature block.
    • BUG-067: --fix refuses to write a sidecar that would conflict with a sibling file (.js / .mjs, .ts / .mts) and names the sibling.
    • BUG-115: the --json envelope gains an unambiguous summary.pathErrors, so path failures are readable from the summary (the green shape is unchanged).
    • BUG-264: sidecarPathOf strips .d after .nudo, so a .d.ts source yields api.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 --gitlab always emits exactly one parseable array and --gha emits ::error.
    • BUG-285: GHA annotations move to stderr when GitLab owns stdout, so --gha --gitlab emits its ::error lines 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 (need migrate.ts, handed to the migrate category), BUG-262 (needs packages/lsp/src/validation.ts), BUG-056 (needs per-round module isolation; check still prints bump() => 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/* 经 package exports 解析到 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 表。已排除的无效方案(逐条实测):service evictAbsModuleCacheFiles / evictEvalCacheForFiles、core evictGeneralizeMemoForPaths、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 不一致(未动)。

  • d4ab7fb: Fix bug-report category 13 (nudo migrate status / strip / verify / retire) — 20 of 21 bugs, plus two defects that were filed under other categories but live in migrate.ts.

    • BUG-234: migrate strip rewrites an enum's computed member references to E["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. A enumComputedMemberRewritten report flag records the rewrite.
    • BUG-050: strip refuses to write when a TS-only construct survives the stripper (namespace, import x = require(...)) instead of writing a .js that fails node --check/nudo check with exit 0.
    • BUG-226: migrate verify's env merge uses mergeHarvestUnderEnv (the check path), so harvest-only exports are no longer dropped ⇒ verify no longer reports unknown where check reports a precise type.
    • BUG-064: migrate verify resolves project-level env against the project root and file-level env against the file's directory, and surfaces env load errors as nudo:env-unresolved.
    • BUG-061: migrate verify installs the eval-fallback collector, so an internal analysis failure is an error-level nudo:internal (same code/severity as check).
    • BUG-114: migrate verify runs the strict, extension-aware parse first, so TS-only syntax inside a .js file is a per-file syntax-error instead of verify saying nudoOk: true.
    • BUG-015: migrate's ignoreThrows uses the same lenient parser as check.
    • 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 --all shares retireScope with the single-target path; a leftover migrate-retiring.json is recovered; a repeat run reports already retired with 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; status and retire share the same workflow scope; the product specifier is tried verbatim before candidate rewriting.
    • BUG-178: migrate status uses retire's gate/compiler split for blockers and reports a preserved field; 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}-* and core-bug-234-*.

    Known follow-up NOT covered here: BUG-017 (--json top-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 of cli-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)不变。

1.17.1​

Patch Changes​

  • d726525: Fix the OSS real-package benchmark regressions (perf) and the nudo:assign-mismatch false 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 with errorRecovery, 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 single commander/lib/command.js analysis 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-mismatch no 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 as arr ⊭ 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.assign second-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 one performObjectAssign core. 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/returnType differences no longer fold to a wrong exact value. $copy snapshots 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 break const b = a alias identity across nested functions or shadowed blocks.

    • Make renameShape/snapshotAbs structure-preserving: tuple holes/rest, fn slots/optionalParams/ctor, obj slot symbolKey/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; strict is 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-only import * as ns now emits valid ESM.

    • Fix $set fail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of using undefined as a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on .shape.

    • Fix $switch implicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading to unknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-local let/const/function/class (including nested blocks, for heads and catch params) 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 false ReferenceError/never and an error-level nudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-block let no longer drops a legitimate sibling write from the fork set.

    • Module top level is now an alias-group scope boundary: const b = a at module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object.

    • Object.assign onto 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 phi stack (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 helpers alphaOf/betaOf, and generalizeAll. $staticInvoke also leaves the public surface (previously exported from . and ./exec): it is now engine-internal, still implemented for the check-may-throw class bridge. Retire dead internal language.ts exports (keep getClassChain/wrapPromise).

      Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from @nudojs/core / @nudojs/core/exec; $staticInvoke is no longer reachable from a host.

    • Rename exec/class-regex.ts to exec/regexp-runtime.ts to 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 report nudo:missing-export, transpileSource no longer emits export for 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), dedupe RUNTIME_IMPORT_RE, and share the new Function compile scaffold.
    • Dedupe the A/B call budgets and the two @nudo:pure memo 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 of runtime/async.ts.

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 .ts file was unconstrained and the file was reported as possibly throwing. The declared types are kept now, and a parameter declared a: string is 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 under default. 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 to unknown.
    • 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 check OK / 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。修法:改用既有 helper termEquals(=== + 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):JSON display 带 #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 在所有面上渲染一致,不再出现「一处保真、一处抹零」。

  • 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 arguments exists in it (length 0 for a getter, 1 for a setter). The accessor body was emitted without the arguments slot, so reading arguments inside an accessor threw a ReferenceError instead of returning 0. Accessors now carry the slot like every other function body.
    • String.prototype.match / replace / replaceAll emitted a state write-back that assigned to the pattern argument, whatever it was. With eval or arguments as the pattern the generated module was not valid strict-mode JavaScript, so the whole module failed to load; with undefined it threw a TypeError out 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 the RegExpCreate / ToString rules instead of being reported as throwing.
  • 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 undefined slot to keep the key present and keeps the real getter in a side table. The read path consults the side table, so o.ab reads 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.ts generator now take the read domain of the getter: the getter is evaluated with the object as receiver, a getter that throws projects to unknown, 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 writing o.x = 9 was reported as a definite TypeError. 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 of number().gt(0) while the equivalent if (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, a try block, a catch block or a finally block.
  • 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.from reads an array-like whose length or whose indices are accessors. The getters are now called; before, the result was an empty array and a borrowed call saw zeroes.
    • Array.from and TypedArray.from pass their third argument (thisArg) to the callback, so the callback sees the right this.
    • Object.prototype.toLocaleString delegates to this.toString(). A user-defined toString is now honoured, and a null-prototype receiver throws the TypeError the language throws.
    • Array.prototype.join / toString / toLocaleString report the TypeError they throw when the receiver is null or undefined.
    • The @@iterator method of an iterator object returns the iterator itself. it[Symbol.iterator]() === it is now true for the iterators of an array, a string, a Set and a Map; the Set and Map ones 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 catch branch was unreachable and the domain of the enclosing function was wrong. The rejected arm is recorded now: a try/catch inside 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 then is adopted now and the settled value is used. A value whose adoption cannot be decided is returned unchanged.
    • yield* did not forward the return of the delegating generator to the iterator it delegates to, so the cleanup of the delegated iterator was lost. The return is 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 g was true. 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.
  • 8a5bf7e: await now suspends the async body instead of running it to completion at the call site.

    • An async function used to be evaluated as a straight-line block: the whole body — including everything after an await — ran before the call returned, so its side effects were already visible to the caller. async function f() { await 0; n = 5; } f(); left n at 5; natively it is still 0, because the continuation after an await runs in a microtask, after the current synchronous run has finished. The same applied to counters, log ordering across async calls, and a pending promise, which the engine walked straight through.
    • An async body that contains an await is now compiled to a real generator, and await x suspends 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. await in 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 for async function f() { return await g(); } where g returns 7.
    • A for await loop is treated as one suspension point for the whole loop, rather than one per iteration. That keeps it consistent with how the engine already models for await; natively each iteration awaits separately.
    • An async body whose await sits inside a branch arm, a loop body, a switch arm, 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.
  • 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 字面量 契约缺这条类型义务)。
  • f11510a: Reassigning a const binding declared inside a block scope now throws TypeError again, in every block scope.

    • The constNames set that decides whether an assignment target is immutable was only computed for function bodies and plain blocks. try / catch / finally bodies and for / for-of / for-in / while / do-while bodies are block scopes too, but their statements were transpiled without recomputing the set, so a const declared there was not treated as immutable. Assigning to it silently wrote the new value, and the throws domain was folded to never.
    • 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 const reassignment in those scopes throws TypeError (and the entry point is reported as throws TypeError), while let / var bindings and inner let shadowing stay mutable.
  • 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, and Object(1n) + 1 throws the TypeError the language throws for mixing a bigint with a number.
    • Object(Symbol("x")).description is "x" instead of undefined.
    • Object.getPrototypeOf(Function.prototype) is Object.prototype.
    • Error.prototype has its own name and message properties, so Object.prototype.hasOwnProperty.call(Error.prototype, "name") is true.
    • The prototype chain of the built-in prototypes is no longer flattened: Object.getPrototypeOf(Uint8Array.prototype) is not Object.prototype any more.
    • String(x) no longer reports a possible TypeError for 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.name is "NumberFormat" and Intl.DateTimeFormat.name is "DateTimeFormat", instead of the internal dispatch key Intl.NumberFormat. The same applies to Intl.Collator.name and Intl.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 包侧,不在本包范围)。

  • 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] returned undefined instead of "Map", RegExp.prototype.flags returned undefined instead of "" and Error.prototype.name returned undefined instead 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.add returned undefined even though "add" in s said true. 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] but Math[Symbol.toStringTag] returned undefined. A namespace object now exposes its Symbol.toStringTag.
    • Symbol.prototype.description returned the string "undefined" and did not record a throw; it now throws a TypeError, like the specification says.
    • Map.prototype.size and Set.prototype.size returned "undefined" and did not record a throw; they now throw a TypeError.
    • Intl.NumberFormat.prototype.format returned undefined and did not record a throw; reading a brand-check accessor of an Intl prototype now throws a TypeError.
    • A member that does not exist on a number, boolean or bigint primitive folded to unknown, which made every later read of that value look harmless. It now folds to undefined, so the later read is still recognised as a possible TypeError.
    • Symbol() instances resolved toString and toLocaleString to the matching members of Object.prototype, losing the brand check. The brand check is now performed.
    • The constructor of a class value resolved to a built-in constructor named after the class, so Widget.constructor === Function was false. It is now true.
    • A getter-only static accessor accepted a write; it now throws a TypeError in strict mode, like the instance-level accessors already did.
    • The prototype property of a class value was missing its "not writable" flag, so A.prototype = {} silently wrote through. It is now rejected with a TypeError.
    • process.env and process.versions were shown as Record<string, string | undefined> but reading process.env.HOME returned unknown, and the difference was reported as a failed inference. The read now uses the declared index domain.
    • A host or namespace object such as Math only projected its enumerable own properties, so Object.getOwnPropertyNames(Math) returned 0 and Math.PI could 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.
  • 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 definite TypeError, and the same happened when the method was borrowed with call, apply or bind. The method body is executed now, with the receiver the call site provides.
    • delete X.prototype.m did 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 a TypeError.
    • instanceof compared the name of the constructor of the instance with the name on the right-hand side, ignoring the real prototype chain. After F.prototype = {} or Object.setPrototypeOf(f, null), the instance still was reported as an instance, and the answer was an exact true — 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 to boolean instead of true. Assigning a non-object to F.prototype raises a TypeError, as the specification says.
    • new.target inside an instance field initialiser was the class value instead of undefined. The field initialiser is evaluated outside the constructor frame now, so new.target is undefined there, 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.
  • 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 whose name was the synthetic "AnonymousClass", because the transpiler fixed the class name at emission time and never applied the language's NamedEvaluation rule. The same happened for K = class { … } and for { K: class { … } }.
    • The binding name is now passed back into the class expression, so K.name is "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 name of 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 static block 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 } folded r to NaN; it is now 2.
    • super inside a static block 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 async method was not wrapped in the async protocol, so it returned the raw value instead of a promise and a throw inside 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 @@asyncIterator method, Object.prototype.toString reported [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 a for await loop over an async generator is taken from the generator instead of folding to unknown.
  • 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)同款。
  • 5749924: 族 21 收口接线:把各分片「越界发现」里明确交给主 agent 的接线项补齐 —— 以及一条真源缺口(672 的剥除面在 core,不在 CLI)。

    Bug 672 的真源(core strip-types.ts) —— nudo migrate strip --write 写出的 .js Node 解析不了: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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • 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:

      1. 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024 IsCompatiblePropertyDescriptor 只在 current.[[Configurable]] 为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判;
      2. frozen 被当成 enumerable:false ⇒ Object.freeze 只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);
      3. 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒ defineProperty 把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落 configurable:true ⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen 不再改 enumerable;靶侧三标志 统一复用同文件 currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
    • 项目级 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 build exit 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.sort and toSorted turned the holes of a sparse array into elements, so the array gained a key, in reported 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 length of a union was read as number, whatever the members were, so a contract of number() 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 冻结面零变更(无新增导出)。
  • e3b8791: Control flow and the loop invariants now carry the facts JavaScript guarantees at those points.

    • A break inside a try block was swallowed by the catch block: the body of the catch ran and the loop did not leave. A control flow signal is not an exception, so it is not delivered to a catch block now, and the loop leaves as it should.
    • The write to the loop variable of a for (let i …) loop before a continue was 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 the continue branch uses it.
    • The invariant of a @nudo:invariant directive was silently dropped in a while, a do..while and a for..of loop, 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 switch statement 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 equivalent if/else form satisfied. The path after an early return now knows the negation of the guard, in every block the early return is written in.
  • 2af2bae: nudo check no 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 .shape on it, so let g = parseInt; g = 1; or f = h (with h a function declaration) threw a TypeError that killed the whole nudo check run — 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.
  • 2af2bae: nudo check now compares @nudo:case witnesses 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 fields shape 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 unknown and 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 as missing field <path> and a field whose type does not match as typeof <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\", -1 produced 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, while nudo test saw 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-syntax warning instead of dropping the obligation.
  • 2af2bae: Five nudo check diagnostics that never fired now fire, and three false positives / wrong paths are gone.

    • Call-site verification is no longer dead code (Bug 364). checkArg / checkCall had no producer, so the documented call-site verification surface was silent: nudo:arg-count and friends never appeared in nudo check. The call-site scan now runs the generalized parameter face check as well (nudo:arg-count for a missing required argument, the argument obligation codes, nudo:partial-result as 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), and checkArg now aligns the expected predicate with the argument's own term so a non-literal argument is no longer reported as nudo:constraint-unproven for a constraint it may well satisfy. nudo:fn-not-found stays on the public API only — whether a callee resolves is decided by the call-site scan.
    • Error covers user-defined Error subclasses (Bug 365). @nudo:throws Error and package.json#nudo.check.ignoreThrows: ["Error"] promised instanceof semantics ("covers every subclass"), but coverage was decided with a static set of built-in names, so class 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 typeof predicate counted as falsifiable evidence: the same obligation was an error for return x and a warning for return x + 1. With an unbounded x the 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 (app vs app2) was trimmed to 2/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 Abs object identity, but the cached detail embeds the function name, so the second and third function sharing one never value showed the first function's name. The cache key now covers the function name as well.
  • 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. checkSource built its return-contract issues without a line / column, so every consumer fell back to the top of the file: the LSP drew the diagnostic at line 1 column 0, nudo check --gha annotated line=1,col=1, GitLab Code Quality reported lines.begin: 1, and --json emitted 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 sidecar fn({...}, <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-relied audit 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 0 is 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.
  • 2af2bae: nudo check now sees assignments inside function bodies, judges generated segments against cross-file call sites, and points diagnostics at the offending directive.

    • nudo:assign-mismatch only 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 $assignRecord from 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-drift never 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 --from could not be judged stale. CheckOptions.from now 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-syntax and nudo:interface-conflict carried no position: the LSP drew the red squiggle at line 1 column 1 and nudo check --json reported issues[].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 check no 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 explicit throw new TypeError() therefore passed nudo check with 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 → new with any constructor 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 reports never, 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 Error or --ignore-throws Error accepts it explicitly.
  • 2af2bae: nudo check no 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-mismatch used 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: in ms@2.1.3 the statement str = String(str) compares a new string against an old string whose refinement said typeof text = "string" (derived at the call site parseAge("2d")). The two have the same shape — the assignment is sound at runtime — yet the gate reported str: assignment ⊭ existing shape and turned nudo check docs/examples/retire-real/after/src/age.js red. 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 check also started emitting nudo:partial-result for 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 documented nudo check summary of the troubleshooting and errors-versus-TypeScript guides from 0 info / 1 info to 1 info / 2 info. The product path no longer emits it. The code and the checkCall public API that has always reported it are unchanged.
  • 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:import is ignored instead of taking effect, and an empty @nudo:import payload 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 returned undefined. 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 raises nudo:directive-syntax instead of vanishing.
    • @nudo:env node web was 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:env tag did not even match the tag regex. Both forms were discarded with no diagnostic, so no environment was loaded and everything stayed unknown. Commas and whitespace are now both accepted (trailing comments are stripped), and a bare tag raises nudo:directive-syntax.
    • @nudo:import inside 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:import with 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 raises nudo:contract-syntax.
  • e424592: Function-level @nudo: directives now bind to the right function again: a statement-level JSDoc on a multi-declarator const binds 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, a static method 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, so const a = () => 1, b = () => 2 under @nudo:case "shared" produced the same witness twice — nudo test printed the case under a and under b. 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 and nudo test printed === <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 inner f inside another function took the comment block of the exported f — the exported f then 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 static method and an instance method of the same name shared the directive scope name C.m. Only one @nudo:contract survived 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 named C.static.m; the instance method keeps C.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 name f found nothing: the L1 contract silently did not apply (green gate), a @nudo:throws declaration did not suppress the L2 gate (red gate), and the @nudo:case witness 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.
  • e424592: @nudo:case witnesses no longer evaporate in silence: an escaped quote in an argument no longer swallows the whole case, the => expected part is read on CRLF sources, on the next line and behind a !! throws suffix, redundant brackets around the expectation are stripped, and a glued @nudo:case"name" tag is diagnosed instead of vanishing.

    • @nudo:case "k" ("a\"b") => 3 was 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 by nudo test stays the same.
    • => expected was lost in a CRLF source file. The line was split on \n and the trailing \r stayed in the expectation text, so the expectation failed to parse and was dropped: the case became [unchecked], the assertion never ran, nudo test exited 0 and 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 text 1 !! throws was parsed and rejected. The suffix is now stripped from the expectation expression only — the case line itself is never rewritten, so the function-level !! throws declaration 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 as nudo:directive-syntax instead 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 and nudo test ran no case at all. Both sides now share one grammar, and the glued form is reported as nudo:directive-syntax, the same way a glued @nudo:mock name is.
  • e424592: Malformed @nudo: directives are diagnosed instead of evaporating in silence: an empty or glued @nudo:assume / @nudo:invariant / @nudo:contract / @nudo:throws now raises a syntax diagnostic, and a !! throws suffix is only read where it is actually a directive.

    • @nudo:assume with 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 a nudo:unproven-return whose text blamed inference precision instead of the rejected lemma. An empty or glued @nudo:assume / @nudo:invariant now produces a bad segment and raises nudo:assume-invalid / nudo:invariant-invalid; a glued or empty @nudo:contract / @nudo:throws raises nudo:contract-syntax / nudo:directive-syntax. The strict grammar is unchanged — a tag still needs a separating space — the loose forms are only reported.
    • !! throws was 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, filterGateThrows let them all through, and the nudo:entry-may-throw gate was silently switched off while the signature still printed throws TypeError. The suffix is now only read where it is a directive: after the argument list of a @nudo:case line, 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 raises nudo:directive-syntax. The @nudo:as side keeps the behaviour already merged for Bug 842: a tag whose name is extended (@nudo:asXYZ) is not an @nudo:as directive 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)。
  • 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 参数), 摘下调用按来源侧定方法体,不再「不可判」。
  • ec0a9e4: Borrowed String.prototype and Error.prototype methods no longer throw where the language does not, and borrowed Array.prototype methods now follow the spec on non-array receivers.

    • The brand-check table treated the whole String.prototype as brand-checked, so every one of its 30 generic methods threw a TypeError when borrowed onto another value (String.prototype.toUpperCase.call(1) is "1" natively). Only toString and valueOf really require a String receiver; the rest are generic (RequireObjectCoercible plus ToString) and are now dispatched on the coerced receiver.
    • Error.prototype.toString is an ordinary method: it reads this.name and this.message and has no brand check. Borrowing it onto a plain object threw a TypeError instead 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.prototype mutators (push, pop, shift, unshift, splice, sort, reverse, fill, copyWithin) threw a TypeError on every primitive receiver. Only a string receiver throws, because ToObject("ab") has a non-writable length; every other primitive becomes an ordinary extensible object, so push.call(5, 1) is 1 and pop.call(5) is undefined.
    • Array.prototype.concat spread the receiver even when it was not an array, so concat.call("ab") produced two elements instead of one. The spec only copies the receiver's elements when IsArray(O) holds; otherwise the receiver is appended as a single element.
    • sort, reverse, fill and copyWithin operate 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.with always throws a RangeError on a primitive receiver, because the receiver's length is 0 and the index is out of range. The engine reported no throw at all, so the L2 gate reported a false green.
  • 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)⇒ L2 nudo:entry-may-throw 门禁不再假绿。
    • Bug 1051:lastIndexOf(x, undefined) 的起始下标按原生取 0(fromIndex 缺省 ⇒ len-1;显式 undefined ⇒ 0)——fromIndex 引入「缺省 / 显式 undefined / 数值」第三态(toIOIArg)。
  • 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 门禁 假红。现按各方法真实元数分流校验。
  • 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 = 2 now owns that member: B.m reads 2 and B.m() throws TypeError, like it does natively. The static-method lookup only consulted the method registry and walked the super chain, so the inherited A.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 throws TypeError, consistently with the class-instance branch.
  • 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 class declaration or a class expression) only has a [[Construct]] slot. Calling it as a plain function threw a TypeError natively ("Class constructor A cannot be invoked without 'new'"); the engine folded the call into unknown and did not record a may-throw, so nudo check reported 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 a TypeError natively; the engine treated every proxy as callable and reported "never throws".
    • A proxy call never reached the target and never dispatched the apply trap: the trap name was missing from the proxy trap table, so trap side effects were dropped and the result was always unknown. The apply trap is now dispatched with the native argument order (target, thisArg, args), and a proxy without an apply trap falls back to the target's own call.
  • 0366b6d: Proxy traps now reach the enumeration and extensibility faces.

    • Object.isExtensible(proxy) dispatched no trap at all: the isExtensible trap was missing from the handler lookup table, so the call always folded to a definite true. A proxy whose trap reports false while its target is still extensible makes the native engine throw a TypeError (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 with ToBoolean, and a mismatch against the target's real extensibility raises the TypeError the native engine raises. The target's real extensibility follows Object.preventExtensions / Object.freeze on the proxy, which freeze the target in the native engine.
    • for (const key in proxy) enumerated the target's own enumerable keys and ignored the ownKeys trap, so it produced an exact but wrong key sequence. The enumeration now goes through [[OwnPropertyKeys]] (the ownKeys trap, including the spec's invariant checks — duplicate entries or a missing non-configurable target key raise a TypeError) 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 prepended let <name> = …, while the import rewrite emits let <name> = … for the same name, so new Function raised a SyntaxError (duplicate declaration). The file then degraded to fail-closed unknown and nudo check exited 0 — 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:mock keeps 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 an Abs with no host object identity to preserve — shadowing the host global is the point of a mock).
    • Bug 275: the optional require form (try { d = require(a) } catch (e) { d = require(b) }) missed the cjsMain branch, so a module shaped module.exports = X was returned as a namespace instead of X itself — the plain require and the optional require disagreed 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 plain unknown value instead of throwing, so the user's catch arm was dead code and the engine claimed "does not throw" — the nudo:entry-may-throw gate under-reported (a missing module was diagnosed as nudo:module-missing while the runtime said "no throw"). A missing module now throws a NudoThrow carrying an Error brand (same class as the native MODULE_NOT_FOUND), so the catch arm is live and an uncaught one is reported honestly. The load-time case (a require executed 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 to unknown ⇒ green gate over an unanalysed file); the missing module is still reported by the nudo:module-missing diagnostic.
    • Bug 277: in a CommonJS module the top-level this was undefined instead of module.exports, so this.x = v always threw a TypeError and the whole module failed to evaluate (green gate over a file that was never analysed). The top-level this is now bound to the module's exports object (=== module.exports), so this.x = v is visible through module.exports exactly as in Node. ESM sources keep undefined (the native ESM semantics).
    • Bug 280: export const a = …, b = … only exported a — the second declarator was missing from the export table, so b was not an export, its signature collapsed to unknown and cross-module imports of b were unknown as 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 with export ), 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 to unknown and a bogus nudo:unknown-inference was appended — the nudo:entry-may-throw gate went green on a file that did throw. The capture groups now accept JavaScript identifiers ($, _, Unicode), and the same pattern source is shared with the export * as rewrite.
    • Bug 289: export * as "<name>" from "…" (the ES2022 arbitrary module namespace name) was not rewritten, so the statement leaked into the transpiled output, new Function raised a SyntaxError and 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.
  • 0366b6d: structuredClone now 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, …): structuredClone runs 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 (L2 nudo: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 as TypeError, while the host throws a DOMException whose name is DataCloneError. The throws face now carries DataCloneError, so @nudo:throws DataCloneError is 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 / the Weak family are not, and an unconstrained (any) argument still honestly records a DataCloneError may-throw.
  • 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 to unknown. ctorParamCountOf treated the specifier statement as a declaration and dereferenced declaration.type on a null declaration, raising a TypeError inside the class-method bridge. The bridge swallowed the error in an empty catch {}, so the method signature silently degraded to unknown and picked up a misleading nudo:opaque-result diagnostic. Worst of all, a violated return-type contract on such a method was downgraded from an error to a warning, so nudo check exited 0 and 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 the export { … }; statement.
    • Bug 990 (core): collectAbsExports decided 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, and export { default } from "./m.js" invented a default export — the very existence of a default slot 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. bindImports also resolves import { default as d } from "./m.js" through mod.default, so it now matches import d from "./m.js" instead of binding unknown.
    • Bug 286 (service): call records for namespace member calls (ns.helper(…), both ESM import * as ns and CJS require) only carried the member name, never the receiver. The attribution side splits the callee name on a dot, so the split never happened: targetModule / targetExport stayed empty, the record was dropped by the matching side, and the error-level nudo:interface-domain-exceeds gate 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 CJS require binding is registered as a namespace import. Ordinary calls (local functions, named imports, host globals) keep their existing record names.
  • 0366b6d: @nudo:pure now 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 (_memoize marker 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.
  • 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 no default slot. The import folded to unknown, every exported function of that file degraded to unknown, and the check reported a misleading nudo:unknown-inference warning (the binding was never connected; nothing failed to infer) while still exiting 0. Importing the very same module as import * 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:fs is the module object itself, with the named exports on it. The environment module table now carries that default slot (the namespace of the module) and marks the module as an interoperability module, and the default-import binding has a single source of truth: the default slot when present, the namespace for an interoperability module that has no default slot, unknown otherwise.
    • Ordinary user modules are untouched: a module table without a default slot still binds a default import to unknown rather 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(假抛 ⇒ L2 entry-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。
  • 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 假红(tsc exit 0 的合法代码被门禁判红)。 修法:加跨 kind 臂(arr 形参 × tuple 实参 ⇒ 取首元素; tuple 形参 × arr 实参 ⇒ 取 arr 的元素类型)。 ⚠ 同 kind 臂排在前 —— hof-relation.test.ts 的既有用例 「deep α: T[] param binds T from number[] arg (lodash-style)」保持绿。
    • 未变:core 公共 API 冻结面零新增导出(parseSource 签名不变、 extractAllLoadSpecs / loadModuleDepsFingerprint 只改内部实现)。
  • 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 --target prints a real return domain instead of ?.

    • A function type inside an array or a union is now grouped with parentheses. formatShape rendered an array of functions as (number) => number[], which TypeScript reads as "a function returning number[]" 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.ts renderer 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.
  • e59c991: Type guards now keep the structural obligations the type actually carries.

    • A branded value (Date, Map, …) was projected as "is an object", so {}, [] and new Map() passed a guard that was supposed to accept a Date. 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 contains undefined could not tell a missing key from an explicit undefined. 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 as value.length comparisons.
  • 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, readable len.
    • A literal -0 was rendered as 0, and because the union members were de-duplicated with a key that did not distinguish -0 from 0, one of the two union members was dropped entirely (0 | -0 displayed as 0). Literal text and the de-duplication key now follow the repository's canonical literal rendering, so -0 survives and both union members are kept.
  • 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 by nudo 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 already string would 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 --json no 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 / pred unconditionally. 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 gave len#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[].display is now rendered with the same formatShape projection the terminal uses, so the machine face and the human face of one command agree: nudo check prints f() => number while --json used to report number = len#0 where len#0 ≥ 0 #path for the very same function. The confidence marker and the branch-join note are still available — through the conf field and the detail / abs fields.
  • 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 the Object.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 formatObjectKey writes __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 null prototype 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 条)均已摘旗转正。
  • 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, and string().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 raw TypeError of the host. Both now report which builder got the wrong argument.
    • array(...) requires an element constraint. Without one the element became undefined, so every ordinary array argument was reported as a violation. Write array(lit(undefined)) when undefined elements are meant.
    • The field tables of shape, partial, omit and pick are 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 错误。
  • 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 现在也进实参位。
    • 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 字面量拼法展示。

  • 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 export exit 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 ⇒ 该文件不是任何源码的侧车 ⇒ 契约永久静默失效。
  • 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。
  • 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(此前该形参的义务 在调用方蒸发,负参调用假绿)。两条路径复用同一段计算与同一条文案。
  • 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, so f(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 undefined cannot 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, with null and undefined kept as two separate domains, so f(0) against union(number().gt(0), lit(null)) is reported while f(3) still passes.
    • A union over primitive types is instantiated into typeof atoms, and those atoms could not be decided either, which left contracts such as union(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, so f(true) against union(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) against lit(1n) passed. Bigint literals are read as literals now, and the expected value keeps its n suffix in the diagnostic.
  • 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 才跳过」。
  • 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 name default, 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 -0 and 0 as equal, while an object field or an array element compared them as different. One identity is now used everywhere: === plus the NaN exception, so -0 satisfies lit(0) and NaN satisfies lit(NaN).
  • 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 and nudo check exited 0 — and nudo contract --emit --all replaced the handwritten contract with the observed values. A header now counts only when the comment starts with @generated and names nudo, and a section boundary stops at a const that the export does not reference. The legitimate generated shapes (the alias section, the composite downstream section with its prelude const, 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.
    • get and set members 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.
  • 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 the export default dts export-name fix, and by resolving a callee's @nudo:import sidecar against the callee's own directory). The pins exist so the fixed behaviour cannot silently regress.

    • A parameter whose contract is exactly lit(null) or lit(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. null and undefined are two distinct domains, so lit(null) rejects undefined and lit(undefined) rejects null. The pin also records that a bare literal contract (one eq atom) and a union / nullable contract (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 default shapes — named function, class, anonymous function and arrow — and asserts that the emitted export name is default in 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-load or nudo:contract-syntax diagnostic, and the call site still reports the real precondition violation.
  • 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 — null against union(number().gt(0), lit(null)), undefined against nullable(number().gt(0)) — was still reported. The disjunction is now decided branch by branch and one satisfied branch is enough to pass. null and undefined remain two separate domains, so null against union(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, so f(2n) against lit(1n) is reported and f(1n) against lit(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 -0 and 0 differ), while the contract side asks whether a value falls inside a contract's domain (=== plus a NaN special case, so -0 is 0). A pin now records this division so the two are not made to look alike later.
  • 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) against lit(1n) was reported and f(1n) against lit(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 }) against shape({ v: lit(1n) }) and f([2n]) against array(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)) reports 3n and passes 1n and 2n.
    • The typeof label of a bigint literal is matched against bigint values, so a bigint is no longer treated as a value of some other type.
  • 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 的公开导出面零新增。

  • 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) 互相「满足」⇒ 精确 期望被静默放宽(native Object.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 依赖它才不假证)。
  • 97f28ed: fix(core): + 的 bigint 臂不再短路数组臂;0 / x 折叠保留分母符号

    • Bug 946:add() 的数组臂(ToPrimitive → join(",") ⇒ string)前移到 bigint 臂之前 —— + 的第一步是 ToPrimitive,原生 1n + [] 得字符串 "1"、从不抛, 此前 bigint 臂先命中 ⇒ 硬抛 TypeError ⇒ 返回值折 never ⇒ L2 nudo: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)时仍不折(保守)。
  • 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)——消费侧算必选元数不再靠名字后缀猜。
  • 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(> 严格、>= 非严格);没有声明界时不写界(不替用户发明更强的默认界)⇒ Φ 只承担 跨变量 / 额外前提。
  • 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 实测)。
  • 97f28ed: The function shape now carries which parameters may be omitted, and a TypeScript this: T annotation 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) => x to 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 public requiredFnArity signature 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: T annotation is a receiver annotation, not a runtime parameter, but the transpiler emitted it as one. The emitted function was therefore syntactically invalid — this is not a legal parameter name — so loading the module threw and every evaluation of that module degraded to unknown. 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 this annotation 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 字面量拼法。
  • 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.toJSON returns null for an invalid date (a time value of NaN), as in the language, instead of a string.
    • The result of RegExp.prototype.exec and of a non-global match is array-like again, so array methods, spreading and for…of work on it.
    • A URL carries its searchParams, and a URLSearchParams carries its entries. new URL("https://x/?a=1").searchParams.get("a") is "1", searchParams.get("z") is null, searchParams.size is the number of entries, and searchParams.toString() is the query string. set, append and delete update the same object.
  • 4d1a249: Object.prototype.toString now reports the right label for functions that are declared with async or *.

    • export async function f() {} used to report [object Function], and so did export function* f() {} and export async function* f() {}. A function declared with async or * 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.defineProperty evaluates its arguments once, and delete / Object.defineProperty now 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] and Object.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 the delete in the same expression still saw the old value (delete a[0] followed by 0 in a reported true). 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) 精确空元组,与原生 [] 一致)。
    • .length slot 在任意 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(引擎的协议方法值与实例内部槽是两个函数对象)——本次只修「可读 + 可调 + 借用调用按接收者派发」。
  • 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 @@iterator method — has no index slots, so every element folded to a confident undefined instead 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 throws TypeError.

    • 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 a SyntaxError: the whole module failed to evaluate and every export folded to unknown. 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 a TypeError that 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 read o["k"] and returned undefined for every such destructuring — and k was 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 } = o no longer leaves k's property behind in r.
    • Literal computed keys ({ [1]: v }, { ["x"]: v }) and plain keys ({ x: v }) are unaffected.
  • 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, a let or var loop head. Assigning to such a binding inside the body threw a TypeError although the original code does not throw, which turned into a false entry may throw report and an unknown return value. A parameter or a let / var head now keeps its binding mutable, while a const head still throws.
    • export const { a } = … and export const [a] = … exported the internal temporary name instead of the destructured names, so the real export was missing and importing it from another module produced unknown. The export now lists the names that were actually bound.
  • 7fea13a: The @nudo:as and @nudo:replace directives now affect exactly the node they annotate, and this inside a default parameter binds to the function that owns the parameter.

    • @nudo:as is 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.parse failures 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:replace had 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.
    • this inside a default parameter expression bound to the this of the enclosing scope. In JavaScript the default value is evaluated in the scope of the function that owns the parameter, so this is that function's own this. The transpiler only looked for this in the function body, so the default expression used the outer this: a default of this.v returned the outer object's value instead of throwing, and a default of this returned undefined instead 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: when o.b was nullish, the rest of the chain was still evaluated and undefined.c was reported as a definite TypeError. The whole chain is now short-circuited, like the optional member access o.b?.c already 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 双报)完全保留。
  • 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-inference warning。

    修法:给 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: for loop 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 lowered i++ to $add(i, 1), which is the binary +: a bigint counter raised TypeError (bigint + number takes the mixed-bigint arm) and a string counter concatenated ("5"++ is 6 natively, the engine produced "51", "511", … and ran to the iteration bound). The main for path now uses $updateAdd / $updateSub, matching the three other step lowerings in the tree.
    • The step closure's return value was used as the $for state 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 } folded 11 instead of 33). The step now only contributes side effects and the state thread is always the loop variable itself, the same contract the non-declaration for fallback path already used.
  • edc7590: Statement-level if / switch no longer roll back the side effects of their own test / discriminant.

    The fork snapshot (__fk0_* for if, __sw0_* for switch) 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()) { … } folded 0 instead of 1, if ((n = 5) > 0) { … } folded 0 instead of 5, and switch (f()) { … } folded 0 instead of 1. The test / discriminant is now evaluated into a temporary first, the snapshot is taken afterwards, and $fork / $switch use that temporary.

  • 5c750f2: Object.prototype.toString now 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):for fallback 的 $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 变更。诊断语码与门禁口径不变。

  • 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), but s.imported is a StringLiteral node in that form, so String(node) produced "[object Object]". The generated import statement was therefore invalid JavaScript, the whole module failed to evaluate, and the imported value silently degraded to unknown — nudo check then 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 的该条断言。
  • e3b8791: Iteration follows the protocol of the value being iterated, and the iteration protocol is now honoured when it is left early.

    • A Map or a Set was 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, return or throw — never told the iterated value about it. The return method 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..in over 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.isArray reports true for it, as in JavaScript.
    • A String wrapper object was not iterable, so spreading one was reported as a possible TypeError even though JavaScript spreads it into its characters. A Number wrapper is still not iterable, and is still reported as a possible error.
    • A user-defined @@iterator method was never called by for..of or by Array.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.
  • 5c750f2: JSON.stringify and JSON.parse handle the values the language handles.

    • JSON.parse calls the reviver. The callback used to be dropped entirely, so its side effects never happened; JSON.stringify has always called its replacer, and the two now agree.
    • A nested built-in no longer makes JSON.stringify report a possible TypeError. JSON.stringify({p: Promise.resolve(1)}) is '{"p":{}}', and the same holds for a Map, a Set or 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 as Map is callable and is still reported as a possible TypeError.
  • c80456a: Logical assignment (||= / &&= / ??=) only writes in the branch that actually assigns.

    Only the branch that performs the assignment does a PutValue — o.a ||= 2 does not write when the left-hand side is truthy (no setter call, no TypeError on 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 spurious TypeError (the nudo check gate reported may throw TypeError for 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 上投影——CLI nudo test 已经打印该事实。 调用方文件现在出现与 CLI 同形的 call@L4 lens;被导入函数的 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)—— 与 CLI buildCheckInjection 同口径(@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。
  • 5c750f2: Math.min and Math.max now keep a satisfiable range.

    The bounds of min and max were merged the wrong way round, so Math.min(x, 0) claimed both > 0 and ≤ 0 at the same time. A function that always returns 0 satisfied 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.p read 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 own readPathSrc(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: false flag 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 a TypeError, a non-writable or frozen property raises a TypeError, and a setter is invoked. An instance of a user class is covered too.
    • A write through a proxy rejected only the literal false returned by the trap, so a trap returning 0, "", null or undefined was 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, reading Array.prototype.push still 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 length accepted values that are not numbers: a.length = undefined and a.length = {} did not raise a RangeError. The value is converted to a number first, then checked to be an integer in range.
    • A sealed array accepted a truncating length write, pop() and shift() without raising a TypeError. 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.length was reported as successful. The length property of an array is not configurable, so the delete now raises a TypeError.
  • 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 reading o.m, so a getter on o.m ran 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 = v wrote back through every level of the path, so a getter on o.a was 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 that if tests, switch discriminants 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 SyntaxError when it was compiled, the whole module failed to evaluate, and every export of that module degraded to unknown. 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 its extends clause.

    • 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 to unknown. 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() before classSpecOf read the extends clause, so the prototype chain and the class registration were both lost: new B() instanceof A folded false and extends null did not raise its TypeError. An empty body now only takes the fast path when the class has no superclass.

  • 169ed52: nudo check and nudo check --fix now analyse the same program, and the gate no longer accepts TypeScript-only syntax in a .js file.

    • nudo check --fix fed the analyzer a different input set than nudo 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.
    • --fix also 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 .js file 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 check no 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 EACCES message. With --json the 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 a fix: hint.
    • The warning about an unknown package.json#nudo.check.profile always said using default strict, even when an explicit check.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 --fix printed 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 produced a//…). The diff now has a single header with a relative path, exactly like the sibling nudo test --freeze --dry-run output, and can be consumed by git 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 check reported 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 reports nudo:interface-load and turns red.
  • 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_FORKS still served the previous run's result. The effective value (environment variable, then package.json, then the default) is now part of the key.
    • An invalid nudo.check.entryThrows value was reported once per checked file. The warning is now printed once per distinct invalid value.
    • @nudo:as did 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-if attached 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.
  • 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) ⇒ 一处修,两面同时保真。

  • f47fd50: Numeric literals that overflow to infinity are no longer folded to null.

    Babel parses 1e400 as a NumericLiteral whose value is Infinity (the raw text stays "1e400"). The transpiler rendered the literal back to source with JSON.stringify(expr.value), and JSON.stringify(Infinity) returns the four-character string "null" — JSON has no representation for infinity. That text was pasted into the generated code, so 1e400 became $lit(null), the JS null literal rather than the string "null".

    return 1e400 folded null instead of Infinity, -1e400 folded -0 instead of -Infinity, Number(1e400) folded 0 and String(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 -0 keeps its sign.

  • 5c750f2: Object.defineProperty now validates the descriptor, and the reflection helpers behave like the spec instead of guessing.

    • Object.defineProperty runs ValidateAndApplyPropertyDescriptor. Redefining a non-configurable or non-writable property used to succeed silently and rewrite the value; it now throws a TypeError, 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 through ToObject, so a primitive becomes a wrapper with no own properties and nothing is defined.
    • Object.create(o, undefined) no longer throws. Passing undefined explicitly skips the whole step, exactly like omitting it.
    • Reflect.defineProperty(proxy, …) returns false when the trap refuses, instead of throwing a TypeError.
    • Reflect.get now runs getters, so an object literal with a getter returns the getter's value rather than undefined.
    • Reflect.set honors its fourth argument (the receiver) and uses [[Set]] semantics on a proxy, so a trap that returns false yields false rather than a thrown TypeError.
    • Reflect.set(array, "length", 3) now actually changes the length.
    • Object.keys / values / entries no longer claim an exact empty tuple for an object with an open key set (the shape produced by Object.groupBy); they report a string[] 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 an Error);
    • swallowed the ReferenceError of 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 to unknown, 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.

  • 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:mock tag pattern, so a correct file produced a fabricated nudo:directive-syntax warning ("Malformed @nudo:mock …"). The mock tag now requires a name boundary that excludes the - suffix of the file-level family.
    • @nudo:mock with 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 through nudo: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 from f() => number to f() => any — an any leak 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:case expectation with a trailing comment (=> string() // the result is a number) failed to parse and fell back to an explicit unknown, which satisfies every expectation — the assertion was silently voided and the command reported "1 passed" with exit code 0. The trailing comment is now stripped before the expectation is parsed.
    • A malformed @nudo:case did not register an argument-region mask, so @nudo:mock / @nudo:skip written 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-module written 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 through nudo:directive-syntax, while top-level positions (file header, export line, 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.
  • 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 1e3 or "a\tb" therefore did not denote the value the user wrote, and the contract gate reported witness ⊭ contract for 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 --freeze wrote 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 check but invisible in the function census of nudo 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.
  • 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)unprovableproved
      x > 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 test 1757 文件 / 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 this binding.

    • A throwing executor now rejects the promise. The rejection used to be swallowed, which turned catch into dead code and reported a confident wrong value.
    • Promise.all / race / any keep the rejection channel instead of dropping it, and race / any no longer settle with the element promise itself.
    • Promise.allSettled projects each entry correctly: value holds the resolved value, reason holds the rejection reason, and status distinguishes fulfilled from rejected.
    • A non-callable then / catch handler passes the value through unchanged, as in the language, instead of rejecting the promise.
    • Promise.resolve / reject / all / race / any / allSettled are ordinary functions that receive this. Promise.resolve.call(null, 1) now throws a TypeError (it used to return a value and report no throw), while Promise.resolve(1) and Promise.resolve.call(Promise, 1) keep working.
  • 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」的既有口径)。

  • e3b8791: Proxy traps are now dispatched and the invariants of the proxy specification are checked.

    • A proxy with a get trap 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 a TypeError.
    • A proxy with an ownKeys trap 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 from Reflect.ownKeys, Object.keys and Object.getOwnPropertyNames.
    • Reflect.set raised a TypeError where the original returns false, and Reflect.deleteProperty reported success where the original raises a TypeError for a non-configurable property of the target.
    • Reflect.get and Reflect.getOwnPropertyDescriptor did 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 get trap 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.
  • b6abab4: Proxy traps now receive the real Symbol key, 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 Proxy get / set / has trap dispatch passed that internal name on as the trap's key argument. Handlers that dispatch on the key therefore all failed: typeof k was "string" instead of "symbol", String(k) was "@@iterator" instead of "Symbol(Symbol.iterator)", and k === Symbol.iterator was always false.
    • Symbol.iterator in proxy was worse: the has trap was never dispatched at all, because the in operator bailed out early on symbol keys.
    • Symbol-projected keys are now restored to the real symbol at the trap boundary. The in operator looks the key up by its host identity, so the has trap 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 from Symbol.iterator and is still handed to the trap as a string.
  • 356172a: RegExp state calls evaluate their arguments once, and delete dispatches the Proxy deleteProperty trap 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 back lastIndex). Every argument expression therefore ran twice — a counter incremented by the argument ended up at 2 instead of 1. 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 a Proxy each call dispatched the deleteProperty trap, 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 a ReferenceError. The brands that are not globals are downgraded to z.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 new both dispatch to it.
  • 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.

    $fork only 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 ?? 5 folded 2 instead of 1 for 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 读出 exact undefined(原生是 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)仍折 exact undefined,仍记 TypeError ⇒ 没有把整张表改成全放行。

    顺带把「表与宿主同名集同源」这条不变量钉住:新回归钉逐名对拍 Object.getOwnPropertyNames(String.prototype)(node v26.10.0 实测:自有方法 50 个 = 本表 50 个,无漏列 / 无多列),防止「派发面认识、读面不认识」的分裂 再次发生。

  • 7fea13a: switch statements and loop bodies now carry the facts that JavaScript guarantees at those points.

    • A break inside a switch arm — including inside an if inside the arm — was emitted as a return, which only ended the innermost thunk. The statements after it still ran. A break in an arm now ends the arm and the switch, and a break that belongs to an enclosing loop still ends only that loop.
    • The test of a case was emitted like an ordinary argument, so every case test of the switch ran before the switch was 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 with n = 10 instead of n = 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 …) or for (var … in …) was lowered to a callback parameter. That shadowed the function-level var binding, so reading it after the loop gave undefined, and every iteration created a new binding, so a closure captured the wrong value. The var head is now a function-level binding, shared by all iterations and still visible after the loop; let and const heads keep their per-iteration binding.
    • for (o.x of …) and for (o.x in …) did not write the iteration value back to the member at all, so o.x kept its old value. The head target is now assigned on every iteration, like in JavaScript.
    • The body of a for, while or do-while loop did not receive the facts of its own test. A for (; x > 0; ) { return x; } was judged to violate a contract of number().gt(0), and for (; v !== null; ) { return v.length; } was reported as possibly throwing on null, 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 a do-while body is not narrowed, because it runs before the test is evaluated.
    • A break or continue in the body of a do-while escaped the whole function, because the body was executed once outside the loop. The body now always runs inside the loop, so break ends the loop and continue goes to the test.
    • A case label 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 of number().gt(0), and switch (v) { case null: return 0; default: return v.length; } was reported as possibly throwing on null. The arms now know the matched value and the excluded values.
  • 56f308e: Two switch defects are fixed: a default that follows an empty case no longer runs its body twice, and a break inside a loop nested in a switch arm breaks the loop again.

    • In case 1: default: body the 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 break inside such a loop was lowered as "end of arm" instead of "end of loop": the loop ran to completion (f() => 3 instead of 1). Loop bodies no longer inherit the marker.

  • 5c750f2: Symbol-keyed properties stay symbol-keyed, and prototypes no longer leak their constructor into enumeration.

    • A property defined with a symbol key is no longer reported as the string "@@X". for…in, Object.keys, Object.getOwnPropertyNames and Object.getOwnPropertyDescriptors only list string keys, and Reflect.ownKeys returns the symbol itself (so typeof is "symbol", as in the language).
    • Object.assign copies a symbol key as a symbol key instead of downgrading it to a string property.
    • "@@toStringTag" in obj is now false: the string "@@toStringTag" is not the same key as Symbol.toStringTag.
    • Object.getOwnPropertyDescriptor(proxy, key) dispatches the proxy's getOwnPropertyDescriptor trap. It used to never run and always reported a broken descriptor.
    • Object.freeze / Object.seal / Object.preventExtensions record key-level flags, so Object.isFrozen / Object.isSealed report the right answer, and a frozen property stays frozen.
    • A function's constructor property 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 lastIndex property, and Object.getOwnPropertyNames(/x/) lists it.
  • 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 ⇒ TDZ ReferenceError ⇒ 被 用户自己的 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、无关导出仍拿到签名;负控:内部名逐字不变;确定性:两次 转译逐字相同)。

  • ed4d259: fix(core): this 载体名 __this 避让用户标识符(附录 A#4 · Bug 1160)

    Bug 1058/1059 约定「引擎内部临时名必须避开用户标识符」。附录 A#4 把 __this 载体登记为「实测无害」并显式留到独立一波(1149 / 1151 的钉子断言了该字面 形态)——经逐点探针全部可达:__this 是跨发射器协议(真函数 prologue let __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 return statements in the same lexical block inside a try no longer break the whole module.

    A return inside a try region is emitted with a fixed temporary name (const __nudoRet = …). Two such returns in the same block were a duplicate const declaration, which fails at compile time with SyntaxError: Identifier '__nudoRet' has already been declared — the whole module then fails closed, so every function in the file degraded to unknown / never and nudo check lost 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 return stays inside that block, which does not change the function-exit semantics.

  • 5c750f2: Typed array construction and set now 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 a RangeError instead of being silently truncated to a shorter array.
    • %TypedArray%.prototype.set checks that source and target hold the same kind of element. Copying an Int8Array into a Uint8Array is rejected with a TypeError; copying between two arrays of the same element type keeps working.
    • %TypedArray%.prototype.set converts every element with ToNumber (or ToBigInt for bigint arrays) and reports the failure. A source holding a value that cannot be converted now throws a TypeError (or a SyntaxError for 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)(…) for if (arguments.length === 0) style discriminant/nullish/typeof/rel guards), and arguments/eval are illegal binding names in strict code — the whole module body then died at new Function compile 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: static import / any export statement ⇒ definitely ESM); sources without it follow Node's .js-without-type:"module" default and stay CommonJS/sloppy, so sloppy-legal constructs (implicit global writes, arguments bindings) no longer miscompile in CJS files. Docs: the levenshtein @nudo:invariant example splits its L2 expectation (--ignore-throws RangeError, mirroring the engine test suite) for the legitimate Array.from array-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.toString tags abstract bigint prims as "[object BigInt]" via an explicit prim-tag map, and bigint .toString routes through BigInt.prototype.toString with literal-radix domain checks (Bug 105); abstract bigint prims are recognized by arithmetic/bitwise coercion — mixed bigint ⊗ number folds the native TypeError (or records may-throw for abstract sides) instead of the impossible number | string, and b / 0n / b % 0n / b ** -1n throw RangeError (Bug 106); borrowed builtin-prototype methods brand-check the receiver (Number.prototype.valueOf.call("5") throws instead of folding "5"), with Object.prototype / Array.prototype staying generic and Array mutators on primitives now throwing (Bug 108); new <proxy> routes to the proxy's target [[Construct]] (or construct trap with result validation) instead of re-entering the Proxy constructor (Bug 122); typeof/instanceof on a proxy see through to the target (typeof new Proxy(fn, {}) folds "function", p instanceof Function folds true) (Bug 123); the object-level proxy traps deleteProperty / defineProperty / setPrototypeOf / preventExtensions / getPrototypeOf are 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 (host fn.prototype member read, Bug 92) and the proto projection used by Object.getPrototypeOf (protoBrandAbs) were two distinct Abs values for the same native object, so Object.getPrototypeOf(g) === Function.prototype folded wrong-exact false. functionProtoAbs() is now the single resident value used by both the fn-shape and base-class-value arms of protoOfRecv and the host-function .prototype read (Bug 58/85 suite restored; native extends null class values still resolve to Function.prototype). @nudo:invariant levenshtein main-target case now splits its L2 expectation (ignoreThrows: ["RangeError"]) for the legitimate Array.from array-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 of while ((m = re.exec(s))) … return null now joins (Bug 99), so parts/named/orAlt keep their native null arm 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, so Object.prototype names (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, and c.constructor === C folds true (Bug 90). DataView.prototype dispatch consults DATAVIEW_ACCESS_BITS with Object.hasOwn, so unmodeled methods (toString, valueOf, hasOwnProperty, …) no longer fold the number domain 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's this read failed and builtin brand checks assumed a throw, folding exact never (native: the real result). New $invokeKey / $optionalInvokeKey runtime helpers fold the key (ToPropertyKey literal + well-known symbol → @@name slot) and re-enter the full $invoke dispatch with the receiver bound; optional chains (obj?.[key](), obj[key]?.(), mid-chain hops) route through a new invokeKey chain hop instead of the receiver-less call hop. Bonus precision: static "ab"[Symbol.iterator]().next().value folds "a" (iterator face reuses the values single source of truth), and generator it[Symbol.iterator]() === it folds true.
  • 471ddb3: Loop-return join soundness (root-cause class C9) from the differential bug report: a return inside a while/for body 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) with any folds any | 0 instead of the unsound exact 0); NudoThrow still 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; } folds promise<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.stringify renders regex match results as arrays: a String.prototype.match / RegExp.prototype.exec result is a native Array (only index elements enumerate into JSON), but the engine modeled it as a plain object shape whose length/index/input slots 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 the length slot explicitly non-enumerable (the only non-enumerable own prop on the native result); Object.keys({...m}) enumeration matches native. MatchAll elements are remodeled as matchResultAbs itself, so [...ms][0].index / .input fold exactly. The #136 member-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 .prototype brand — the read folds exact undefined and Function.prototype types as "function" (Bug 92); generator functions keep a distinguishable .prototype object (declaration
    • expression forms) while async/arrow controls stay undefined (Bug 93); string-form TypedArray indexes (v["1"]) fold the element domain instead of exact undefined (Bug 102); writes to getter-only builtin accessors (v.length = 5) throw the strict TypeError (Bug 103); new <function declaration>() instances resolve f.prototype members 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.prototype legacy accessors (__defineGetter__ family) now answer in exact true (Bug 15 family). Bug 6/10/14/15/16/17 were already fixed at HEAD (verified, no change).
  • 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-chain delete o?.a (Bug 87/111); String.prototype.match/matchAll honor the pattern brand's tracked lastIndex with the spec matchAll flag rewrite (Bug 94); argument-position global match/replace/replaceAll reset the regex binding's lastIndex (Bug 96); RegExp.prototype.compile recompiles the receiver — source/flags/flag getters/lastIndex fold fresh values and invalid patterns throw SyntaxError (Bug 126); String.prototype.replace/ replaceAll dispatch through a @@replace slot installed on the pattern (Bug 81); accessor→data descriptor redefinition drops the stale getter and merges flags (Bug 84); Object.defineProperty/defineProperties on tuple/array receivers install/truncate/extend indexes and length instead of silently dropping (Bug 86); descriptor keys coerce via ToPropertyKey — symbol/boolean/null/undefined keys install (well-known symbols behind the @@X projection) (Bug 117); non-primitive descriptor values (fn/obj/ tuple/bigint/symbol) keep their Abs instead of folding undefined (Bug 118); Object.assign uses [[Set]] semantics — the __proto__ accessor fires and inherited non-writable data properties throw (the proto-slot-key assign 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 @@iterator slot is now a self-returning method (it[Symbol.iterator]() === it folds 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 an apply hook that re-enters ordinary dispatch with the caller-supplied receiver, so borrowed m.call(c) / m.apply(c, []) / m.bind(c)() and HOF-passed method values fold the real result instead of exact undefined (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/Map consumes the same element side tables as spread/for..of/Array.from ([a, b] = new Set([1,2]) binds real elements; Map destructuring yields [k, v] tuples) instead of folding undefined and false TypeErrors (Bug 82); for..in re-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.from consults the object's @@iterator before 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.setPrototypeOf on frozen/sealed/non-extensible targets throws TypeError (shared protoChangeAllowed with Reflect) (Bug 120); Object.keys/values/entries/getOwnPropertyNames, for..in, Object.assign and 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/seal on a non-empty TypedArray throws / records may-throw (Bug 129); String.raw misuse throws / records TypeError (Bug 97); new <TA>(buffer, byteOffset, byteLength) validates bounds and alignment (Bug 101); Array.from({length: 2**32}) hits the RangeError ceiling (Bug 104); literal digits/radix domain checks hoist above the receiver guard (Math.random().toFixed(500) throws) and toLocaleString no longer passes args to the redirected host toString (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 Function seam prefixed with "use strict" and arguments.callee read/write/delete throw (Bug 116); TypedArray construction and .from convert 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 ||= v on private fields transpile instead of raising nudo:unsupported and fail-closing the whole module (Bug 80); function-declaration bindings passed to Object.*/Reflect.*/ in/JSON.stringify/coercing globals are normalized to Abs at the $invoke argument choke point, so Object.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.x in a static field initializer resolves through the parent constructor's statics instead of the instance prototype chain (Bug 119).
  • 725c8e4: Reflect.construct argument-slot fix (root-cause class C10): the shared enforceArgsList call indexed args[2] for both apply and construct, so the valid two-argument Reflect.construct(A, []) was analyzed as an unconditional TypeError while genuinely invalid forms (non-object argsList, non-constructor newTarget) passed silently. argsList is now validated at args[1] for construct, and a present newTarget is checked for constructability (Bug 121).

1.15.0​

Minor Changes​

  • 8faa2b0: BREAKING (runtime floor): engines.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

Patch Changes​

  • aae0f96: Fix stale-cache windows in cache keys and session eviction. nodeHarvestCacheKey floored mtimeMs to whole seconds (same-second, same-size rewrites of @types/node reused a stale harvest — now uses the raw float mtime, matching the repo-wide mtimeMs+size strict-equality contract). The path-env cache key/validation only compared mtimeMs (coarse-mtime filesystems could keep serving a stale defineEnv factory and re-register it, self-perpetuating — now mtimeMs+size, and the direct-import URL query carries size so the ESM module cache can't replay old content). The path-env fallback copy filename hashed only path: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, so pnpm install / watcher rounds see upgraded or newly installed @types without a process restart. checkMemoKey now normalizes filePath via stablePathKey (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-16 proved x + y > 1 while f(1, 1.05e-16) returns exactly 1 in 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)), so x > 0 ⟹ x + 1 > 1 now correctly reports > 0.9999999999999999. Non-strict bounds are unaffected (fl monotonicity). Also: gt(x, NaN) (a vacuously-false predicate from 0/0 literals) 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. the interface-derivation example's x>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).

    • hostGlobalFnIds skips accessor properties by descriptor shape (deny-by-default) instead of a name denylist — bare-node embedding consumers no longer emit ExperimentalWarning/DeprecationWarning for 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:env when the file imports builtin modules with no env active.

1.14.0​

Minor Changes​

  • 0d9e7de: Pure-expression equality folding and the @nudo:invariant loop 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 - d now proves ge(0) with no directive, and levenshtein-style DP loops gain a user-declared invariant channel.

    • sub folds x − x to exact 0 (NaN arm preserved) when both operands carry structurally equal terms that pass isDeterministicTerm — len#N identity-minted leaves plus a deterministic host whitelist (Math.max/min/…, arithmetic). Adoption re-anchors, get member reads and arg${i} placeholders are rejected, so structurally-equal-but-distinct values never fold
    • sub now consumes @nudo:assume premises (symmetric to divAssumeBounds): @nudo:assume d <= max proves max - 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): abstractLen mints a fresh len#N per read and the reflexivity fold rejects marked operands — xs[0].length - xs[1].length no longer falsely folds to 0
    • @nudo:invariant <name><path> <rel> <number> (dp[*][*] >= 0, scalar last >= 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 via nudo:invariant-relied info (+ nudo:invariant-invalid for bad syntax). Unguarded dp[m][n] keeps its honest number | undefined OOB read face
    • Array.from({length}, mapFn) hands the callback a bounded index (ge(0), plus lt(length) when the length term is available); the same bounds now apply to abstract-receiver .map/.forEach/.reduce/... callback indices and entries(); the array-like missing-slot seed no longer pins a false literal 0

1.13.0​

Minor Changes​

  • f5c0c6e: Guard-equality path facts and sum anchoring close the normalised-similarity derivation chain (#170) — @nudo:assume d <= max now proves 1 - d/max ∈ [0,1] when max comes from Math.max(a.length, b.length) and the body guards max === 0, with no per-callee sidecar bounds.

    • === / !== on undecided operands now carry symbolic eq/ne predicates (previously folded to an unconstrained boolean), so $fork pushes the equality fact into branch Φ — the else arm of max === 0 ? … : … knows ne(max, 0)
    • numericBounds tightens an endpoint when a ne(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 requires
    • cmp no longer applies brand ToPrimitive unboxing for eq/ne — strict equality has no coercion (new Number(5) === 5 stays false)
    • @nudo:assume local 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 a d = cond ? 0 : Math.max(...) callee result still matches the lemma; literal members keep their exact identity
    • 0 / x with a provably non-zero, non-NaN denominator folds to literal 0 — the literal arm of such a sum no longer poisons the joined quotient bounds

1.12.0​

Minor Changes​

  • e4e491f: @nudo:assume name resolution extends from parameters only to parameters ∪ top-level const/let/var locals of the anchored function's body (#165).

    • names resolve against plain Identifier declarators among the body's direct statements — destructuring, nested blocks, and for-init declarations stay out; unknown names fail with nudo: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))

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 $call thisVal channel — dynamically-assigned/re-assigned/computed-key methods bind this (no more false always-throw TypeError)
    • super.x = v (instance methods/ctors, incl. compound + computed) emits $setSuper/$setSuperObj with native setter-lookup semantics (was: invalid transpiled JS, hard SyntaxError)
    • 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/set traps (set returning false throws strict TypeError); Array.isArray(proxy-of-array) → true
    • arguments is branded (Array.isArray(arguments) → false); error subclasses joined NAMESPACE_GLOBALS (X.prototype.constructor === X, family toString dispatch); $get(Ctor, "prototype") returns a memoized proto brand instead of an anonymous obj
    • instanceof learns Object.prototype terminator (false for everything), class static [Symbol.hasInstance], and .prototype-suffixed brand chains (RangeError.prototype instanceof Error → true); Object.getPrototypeOf handles class values (B → A), extends null (A.prototype → null), and B.__proto__
    • array entries/keys/values return real iterator objects (isArray false, .next callable, spread/for-of exact)

    Effects & control flow (Bug 49/51/52/53/54, F2/F3, fork-try join):

    • array mutators mutate in place at $invoke time — 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 (.catch absorbs; await chains reject; thenable adoption); setter bare early-return; keeps the receiver
    • return/throw inside try regions nested in if-arms join correctly (was: folded to fall-through value; also fixes latent callee-frame loopExits drops and NudoReturn leaks 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-throw TypeError; symbol-keyed slots never serialize (literal "@@x" string keys still do)
    • Symbol.for interns container keys via ToString (Symbol.for([1]) === Symbol.for("1")); non-concretizable keys degrade to unknown identity
    • String.prototype.replace passes the named-groups object to function replacers (groups.d works, no false TypeError)
    • Function.length stops at the first default/rest param (declarations, expressions, arrows, methods)
    • missed throws fixed: '' + Object.create(null), free arguments (ReferenceError), (5n).toFixed, sort with throwing/impure comparators (effectFree facet; effect-free comparators execute with ES2019 stable-order exact fold), Object.assign('ab', {0:'x'})
    • error instances: name inherited, message/stack own non-enumerable (hasOwnProperty/propertyIsEnumerable native-correct); accessor-form Symbol.toStringTag getters invoked by Object.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 a knownMissedThrows pin ledger (rationale-carrying, loud warnings); 638 stale masking pins removed from skip-baseline.json.

    Precision residuals (native-exact where native is definite):

    • generators: .throw() into a returning catch folds done: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 .catch handler is dead code (exact passthrough); effect-free closed .then/.catch/.finally handlers 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-class unsettled facet
    • identity: fresh instance ids (WeakMap side table) — distinct promise/generator/iterator/class-instance/literal objects fold === false; aliases and adopted references stay true
    • super.x += 5 on a closed parent chain folds exact NaN (missing proto slot reads undefined); static super writes land on the receiver class (native), not the parent
    • static methods model this as the class value (B.m() === B, arrows capture lexically, this.y = 5 writes the class, static field initializers see the class); @@hasInstance adapter forwards the receiver
    • inherited static member reads walk the constructor's [[Prototype]] chain: class B extends A { } reads B.x / B.m / B.g (fields incl. computed keys, static blocks, and dynamic A.y = … writes; same Abs reference so B.o === A.o), multi-level chains, own-shadow first; builtin parents dispatch through the host static channel when extends targets a real host builtin (class B extends Object {} → B.keys({a:1}) exact, class E extends Error {} → typeof E.captureStackTrace is "function" — was wrong-exact "undefined"); presence ("m2" in A / "x" in B) uses the static face (instance methods no longer fold true on class values, statics no longer fold false); instance receivers no longer dispatch statics (a.staticM() was folding the static result instead of the native TypeError); 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 lexical this, arguments-reading and rest defaults all fold exact ($arrRest now delegates the Arguments brand)
    • static field initializers resolve the class's own name: class C { static n = 3; static x = this === C; } folds true (thunks emit let <Name> = __this; mirroring the native class-body lexical binding — inner-class references, named class expressions, shadowing params, and static name = "custom" overrides all native-exact)
    • error introspection: Object.getOwnPropertyDescriptor on error brands builds exact data descriptors (flags-aware); Object.hasOwn folds own-vs-inherited exactly; gOPN returns the native install order (stack, message[, cause][, errors]); catch-param payloads gain the stack slot (was missing)
    • dev infra: every package gets a package-local vitest config delegating to a shared factory — cd packages/<p> && ../../node_modules/.bin/vitest resolves @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 unsettled facet (new Promise(res => { if (c) res(1); }) no longer folds bare promise<1>); exit arms (early return / uncaught throw / swallowed catch) are clocked so join-after-exit settles don't cover them; await of 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.m folds true across inheritance, distinct/overridden fold false; class values expose .length (ctor arity before first default/rest — implicit derived ctors are 0, 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 through evalBuiltinNew (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 definite TypeError — 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
  • 1881f97: Fix fork-arm × try-region early-return join: return/throw inside try/catch/finally nested in an if-arm folded to the fall-through value instead of the arm's early exit.

    • stmtReturns learned TryStatement (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 by settleForkArms (double-ret throws joined NudoReturn; single-ret enters the exits channel — no longer pre-pushed and double-counted)
    • transpiled function bodies are self-contained: $catchReturn absorber keeps raw host calls (nudo export .mjs imports, e2e) from leaking NudoReturn — also fixes the latent leak for loop-returns
    • callAtFunctionBoundary and the compiled-body $call path join frame loopExits (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 undefined completion (if (g) return "s"; throw E was undefined | "s", now "s" — the statement has no fall-through path, so the join yields never)
  • 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.m is undefined — statics live on the constructor, not X.prototype); the engine previously degraded to unknown (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 an Object.prototype name), $invoke throws a definite TypeError
    • guards keep everything else unchanged: c instanceof C → true, instance-method calls, member reads (typeof c.m → "undefined"), optional calls (c.m?.() short-circuits to undefined), 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 definite TypeError (was: silent rebind — N4's documented sound over-approximation); routed through the existing const-assignment channel (constNames on class-body member opts)
    • the outer binding stays mutable on purpose: native class C {}; C = 5 is legal (ClassDeclaration IsConstantDeclaration is false — verified on Node 26: no-throw, C becomes a number); the engine's outer-let emission already matched native and is unchanged, as are let D = class {}; D = 5 and 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 const too):

    • function-boundary params are subtracted from inherited const bindings: const K = 1; function f(K) { K = 5; } no longer folds TypeError (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 outer const K/class-body name no longer falsely throws

1.11.3​

Patch Changes​

  • 08d7a55: Fix five exec-surface wrong-concrete bugs (80–84) found by differential testing:

    • #x in obj (private-field in operator): the left PrivateName operand fell through isExpression and compiled to $lit(void 0), so the presence test always returned false. The in arm now emits the mangled "#x" key via the shared privateNameKeySrc helper (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 (+=1 assigned 1). It now applies compoundFn to the current $get value, mirroring the member-path branch.
    • o + "x" with a Symbol.toPrimitive hook: coerceToStringParts folded 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.concat ignores Symbol.isConcatSpreadable: spreadable objects are now spread as array-likes (ToLength(o.length) elements), lit false suppresses spreading, abstract flags degrade to arr (sound).
    • Private fields leak as enumerable own properties: private slots are now flagged internal at 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, and JSON.stringify exclude internal slots; direct this.#x access and #x in obj slot-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 (runtime defineProperty flags and dynamic getters included) instead of the conservative descriptor|undefined domain; JSON.stringify folds class instances with prototype getters exactly ({"pub":2} — prototype accessors are not own properties, native never invokes them during stringify; only toJSON methods keep the conservative fold).

1.11.2​

Patch Changes​

  • 82eaae8: Fix nudo:recursion-truncated misattributing call-cycle truncation to "depth/size budget", and make nudo check --json budget stats see the B-path ($callNamed) truncation (issue #158):

    • enterCall / evalEnterCall now attribute a truncation reason — cycle (same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers or grow-style recursion) vs depth / calls (real budget exhaustion). The check diagnostic message, suggestion, structured action, and a new reason field 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 reports truncated:false alongside a nudo:recursion-truncated info: B-path counters are latched across execution sessions within one host entry and surfaced as evalCalls / maxEvalCalls / evalCallTruncated, plus cycleTruncated and a sorted reasons[] 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-reported nudo:fork-truncated).
    • The @nudo:budget quickfix (nudo check --fix / LSP code action) is no longer offered when the truncation reason is cycle; the reason is plumbed through check --json, the disk cache, LSP diagnostic data, and materializeAction.
    • Raising @nudo:budget on 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 own nudo:loop-truncated info with an honest message and suggestion (the call-budget knobs cannot lift a loop budget — @nudo:budget calls=/depth= does not apply), gets a loopTruncated flag in the check --json / health budget block (single-file and multi-file envelopes), and no longer offers the misleading @nudo:budget quickfix 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 + push return 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 through arrify — element domain = join of all observed element domains. No fabricated unknown element arm from the empty initial tuple, no baked out-of-bounds undefined (OOB is a read-site fact: $idx on an abstract index already joins the marker; concrete-index optimism matches the engine-wide arr invariant shared with splice/sort degradation).
    • Packed-container slot joins produce sums of objects (joinValues does not structurally merge object slots); normalizeForWiden structurally 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 into arr(unknown).
    • control.ts widenLoopJoin: 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) against array(...)/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 stay unprovable; interrupted loops (abstract break) keep the honest unknown[] top.
    • No-growth loop exits now collapse array-family sums in packed binding slots (collapseArrSums): a parameter-position arr binding whose element domain is unknown absorbs push values (growth detection sees nothing), and the widener's accumulated joinAbs used to smear the sequential states into a two-arm sum (unknown[] | (unknown | {v})[]). Sequential states of one binding now union into a single arr (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 like 1 - d/max ∈ [0,1] become provable (#152).

    • @nudo:assume a >= b is normalized to le(b, a); malformed lemmas or names outside the formal parameter list report nudo: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:assume for cross-variable references.

Patch Changes​

  • cce5e58: Fix false nudo:unproven-return warnings when a return value was widened to a prim domain top by the loop-carried-binding widener (issue #151):

    • postcondition.ts now treats conf="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 isValueSetUnknown gate in assertImplies no longer swallows conf="widened" returns before arm distribution; the per-arm gates in assertImpliesSingle (new proved exit) and assertSumArms keep everything else conservative.
    • isWidenedSumArm also accepts arm-level conf="widened" (loop-widen sums carry widened on both parent and arm), enabling the existing provesBarePrimDomain discharge for union members such as union(string(), lit(null)).
    • Guards unchanged: widened arms with mismatched prim or bounded contracts (number().gt(0)), and any-derivation FP protection, stay unprovable (never proved, never disproved); 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 of emitArrMutatorRebinds in transpile/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' returned Abs[] flattens element-wise into $arrMutContainer.
    • Element precision restored: const findings = []; findings.push(...check(x)); return findings keeps the precise per-element tuple from check instead 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 native push(..."ab") semantics.

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/asyncIterabilityKind now treat a brand shape as a nominal label delegating to its inner structural face: a brand wrapping an array/tuple/string/@@iterator object is total (no more may throw TypeError — iteration over possibly non-iterable on for…of/spread over env Array<T> brands such as fs.readdirSync). Non-total inner faces stay may and never degrade to definite (TypedArray/Buffer brands wrap an empty object whose prototype @@iterator is not modeled). Element domains delegate the same way (elemsOf/$concat): the for…of loop variable and spread elements now fold to the inner array element (string | Dirent) instead of unknown, and a brand wrapping a tuple keeps the precise tuple shape when spread ([...t, ...brandT] stays a tuple, not T[]).
    • Env-global injection in runTranspiled binds globals with let instead of const: a member write like process.exitCode = 1 compiles to a root-rebinding write-back chain (process = $set(process, …)), which against a const binding threw a native TypeError and poisoned the whole eval (return folded to unknown + nudo:unknown-inference + nudo:entry-may-throw). Env globals are writable globalThis properties 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/joinObjects built 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 its undefined placeholder ({ get q() { return 42; } } joined with { q: 0 } read undefined | 0 instead of 42 | 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 module algebra/accessors.ts so objects.ts can 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(核心变更):transpile recordPositions 插桩($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 | undefined sound)。重放 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,参数折叠文本注册表按路径键在命中路径补登记;此前第二个同内容侧车路径查不到折叠文本、回落谓词全展。

Patch Changes​

  • 334b914: Discriminant narrowing visible in slot display; mid-token hover resolution

    • $narrowMemberEq keep-arm refinement: surviving union members with a compatible discriminant slot now carry the eq(slotTerm, lit) fact on that slot (conjoined with any existing pred). formatShape(showLits) renders it via litPredValue, so the open-tail arm displays { type: lit("TemplateLiteral") } after node.type === 'TemplateLiteral' instead of the unrefined { type: string }; memberEqClass upgrades those members to only, improving chained discriminant narrowing and complement-arm pruning. any/unknown slots stay untouched (fail-closed markers).
    • litPredValue now reads eq(self, lit) facts through and-conjunctions, not only top-level eq preds.
    • LSP A0 hover replay resolves mid-token cursor positions: record keys are Babel start positions ($nodoPos uses loc.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; 不记录)。LSP absNodeAtPosition 词中回落从 Identifier 泛化为任意带 loc 节点(候选仅当起始键已有记录,取最小 span——词中标识符行为不变);新增无 ident 分支——hover return 关键字或表达式内非标识符位(?.[、[0]、.)直接显示推导类型(无 ident 前缀,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 host TypeError: Reduce of empty array with no initial value escaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades to unknown.
    • 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 like if (x >= 0) return x; console.log(x); return 1; under @nudo:contract return nonNeg.
    • extractImportEdges skips import edges whose target resolution throws ModuleReadError (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).
    • $copy snapshots 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 } via formalParamSignatureNames instead of the _p0 evaluation 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)。
  • 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.ts CollectAbsInlaysOpts 增加 modules 透传给 generalize;server-ide.ts hover/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)不参与选择器(推导面)。

1.9.2​

Patch Changes​

  • c8e0417: Propagate member truthy-guard facts into union containers (issue #129). $removeMemberNullish now classifies sum members per the guarded key: members whose read is definitely nullish — a closed shape without the key whose absent read yields undefined (no open/index signature, no Object.prototype/constructor key, no getter), or a getter-free all-nullish slot value — cannot survive the truthy arm and are pruned; members with T | nullish slot values or optional flags 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) return followed by a chained re-read node.property.type on a discriminated union with a lenient catch-all arm no longer records a false property 'type' on undefined may-throw. Keys whose absent read is unjudgeable — open/index shapes, Object.prototype method names and constructor (proto-chain reads a function), and getter-backed keys (the read returns the getter result, not the placeholder slot) — stay conservatively, as do any/unknown slot values and non-object members; all-pruned sums pass through unchanged and single-member remainders collapse, matching $narrowMemberEq conventions.

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-while under abstract conditions and for-of over 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 definite break/continue) keep their exact behavior. Array-literal spread stops polluting element domains ([...xs] → number[] not number | unknown[]; empty-tuple join identity is never, abstract strings spread to string[]), for (const c of s) / yield* s over abstract strings yield string instead of unknown, no-initial-value reduce/reduceRight seed the accumulator from the element domain (killing the phantom string arm of +), array HOFs pass their thisArg to callbacks (native GetThisBinding — [1,2].map(function(){return this.k},{k:7}) now evaluates to [7,7] instead of never + false may-throw), and new Array(n) for abstract number n gives a decidable undefined[] element domain (sparse holes) instead of unknown[]. The widened bare-prim arms this produces no longer trip return-contract discharge: a loop-widened number arm proves against nullable/union contracts with an unbounded same-prim member (issue #102 regression — lev-style DP tables under nullable(number()) return contracts no longer emit a spurious nudo:unproven-return warning 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/toLocaleString now render `${name}: ${message}` and Object.prototype.toString tags the whole family [object Error] ([[ErrorData]]); Error brands carry a stack: string slot. new ArrayBuffer/new SharedArrayBuffer/new DataView store 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 single makeBoxedAbs builder and dispatch instance methods through the unboxed primitive face (valueOf unwraps; charAt/toFixed/… fold). Map/Set keys/values/entries return iterator objects (stateful next() → {value, done} plus element side table) so spread/for-of/Array.from/.next() chains evaluate. RegExp brand construction converges on one declarative slot builder covering source/flags/lastIndex for abstract patterns too, plus the 7 flag getters (global/ignoreCase/multiline/unicode/dotAll/sticky/hasIndices) folded from the flags string. URL brands expose hostname/pathname/search/hash/port/username/password slots. Date.prototype.getYear/setYear dispatch as number getters/setters. new BigInt() and new Math()/new JSON()/new Reflect() now deterministically throw TypeError (previously a silent bogus brand, or an internal specOf crash swallowed into unknown + 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.raw tagged templates (exact splice on all-literal quasis/subs), Object.defineProperties (returns target, reuses the defineProperty machinery via shared helpers) and Object.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 in GLOBAL_FNS with exact literal folding, string result domain for abstract string args, and per-function may-throw faces (URIError for decode*, InvalidCharacterError for btoa/atob). ES2024 statics: Array.fromAsync (promise of from's element projection with thenable unwrapping), Promise.withResolvers (three-slot object), URL.canParse (exact boolean on literals; URL added to the namespace routing/env-shadow tables in parity). String method table gains trimLeft/trimRight aliases, Annex B HTML methods (bold/anchor/link/… exact tag folding), and search/match/matchAll arms for abstract/template receivers (number, null | match array, iterator brand; non-global matchAll is a definite TypeError); string-literal patterns now fold through RegExpCreate semantics ("abc123".search("c") → 2), and s.at(n) on abstract receivers includes the undefined arm. Array.from(<obj>) array-likes read index slots (Array.from({0:"a",1:"b",length:2}) → ["a","b"] exact tuple) and fold length via ToLength ("2"→2, missing→0, abstract → element domain). Host global function values are first-class: returning parseInt yields a function type, [1,2,3].map(parseInt) → [1, NaN, NaN], and .call/.apply/object-slot/then positions dispatch through the called-position bridge (shared callHostGlobalFn) 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 (@@split delegation never stringifies it); JSON.stringify on 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 $invoke apply path (Math.max → 2 exact) 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 → -1 exact, + → string per the Date default-hint rule), boxed new Number(5) → the wrapped primitive, RegExp/Map/Set/Error/URL → toString → numeric coercion (abstract-string operands coerce to number, was unknown).

    Promise rejection channel (Bugs 36+37): the promise eff shape carries a rejected reason — Promise.reject(v) and executor reject(v) produce promise<never> (definite rejection), .catch/two-arg .then receive 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] against array(number().gt(0)) reports array element [0] ⊭ … (precise index) instead of silently proving; abstract elements degrade to unproven-return, empty tuples stay vacuously proved.

    Expression-position splice/copyWithin fold exactly ([1,2,3].splice(1,1,9) → [2]); arr-of-union signatures render with parens ((3 | 1 | 2)[], was the ambiguous 3 | 1 | 2[]); BigInt(x) on abstract number/string operands records the native RangeError/SyntaxError may-throw; new URL(...).toJSON() folds href (was unknown); rest parameters in signature symbolic execution bind an open array (sigLen(...r) => number, was the fixed-1-tuple error 1); delete o?.a short-circuits nullish receivers to true (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 yields string | undefined (was unknown); function value properties f.name/f.length/f.prototype are decidable (declaration names and native arity plumbed through host-fn asAbsVal and closure absFunction; arrows fold prototype → 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.m folds "function" (was silent undefined/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/preventExtensions now 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/entries classify non-string primitives ([]) and builtin brands (boxed String → ["0","1"], gOPN includes length); accessor properties are visible to Object.entries/Object.values/Object.getOwnPropertyDescriptor (accessor descriptors {get,set,enumerable,configurable}) and JSON.stringify through a single readProperty [[Get]] entry point — getter thunks are invoked, the defineProperty+enumerable stringify variant loses its false may-throw, and for (k in new String(…)) no longer enumerates length.

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 $narrowMemberEq runtime helper to the subset of members whose key domain 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 / may via shape assignability plus implies over the slot pred, with a local literal-disequality rule for strings/booleans the prover does not cover). Kind-specific field reads stop recording false computed 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, if statements, 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 like shape({ 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/instantiateOnTerm degrade to trivially-true predicates, constraintAdmitsNullish / throwConstraintToKinds / literalMeetsConstraint terminate cycles via thunk-identity seen-sets, assertImplies uses 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 to unprovable, i.e. the conservative nudo:unproven-return warning rather than a false error), formatConstraint renders two expanded levels plus …, and derefConstraint memoizes one-level derefs by thunk identity. partial/pick/omit/andC now deref lazy wrappers before their structure checks. lazy is sidecar-injected via CONSTRAINT_BUILDERS; the directive grammar still rejects arrow functions, so @nudo:case-style use falls back to unknown (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.js sidecar fn(…) 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 (unconstrained any / non-lit unknown args) are bound to the declared faces (constraintToEntryAbs), so the callee body re-executes inside the contract domain instead of worst-case any — the issue's levenshtein callers (levenshtein(a,b) <= 1 and const/literal/var variants) no longer inherit the DP body's ToPrimitive of abstract relational operand (Symbol) may-throw; call sites passing already-informative args keep their own face (L1 nudo:constraint-violated at 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 and never/opaque (budget) results are never whitewashed. Return-constraint predicates flow to callers: a callee declared number().ge(0) makes caller-side bounds like d + 1 ≥ 1 / 100 - d ≤ 100 (the issue's 1 - d/max ≤ 1 chain shape) provable. The callee's own check semantics are unchanged — its honest nudo:unproven-return warning and inferred signature (marker arm included) stay exactly as before. Faces are attached per checkSource run (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 like m[2].trim() inside the loop body / cons arm no longer report false entry-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 $whileSeq copy (first run precedes any test evaluation). (2) member loose-equality guards — o.p == null / o.p != null falsy/truthy arms imply the slot is present and its value non-nullish (loose eq treats a missing slot's undefined as null), same facts as truthy-member guards; strict o.p !== null stays un-narrowed as a documented boundary (undefined remains possible). (3) multi-name composite guards — obj == null || node.property == null fall-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/pred when $copy snapshots obj-shaped Abs values. objOf builds 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 same callBudgetKey fingerprint, and the cycle guard cut parent/child frames as a false cycle — the truncated unknown#opaque result then poisoned signatures and return-contract proofs (surfaced by issue #120's recursive lazy templates).

1.7.10​

Patch Changes​

  • 427da20: Fix false entry-may-throw reports 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 the optional flag (the $get join with undefined was the FP source for property 'grade' on undefined); (2) composite mixed disjunction/conjunction — !doc || typeof doc !== 'object' fall-through now narrows doc (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 narrows files before for (const f of files) (no more iteration over possibly non-iterable value). Single-level member paths only (computed keys and nested o.p.q guards are not recognized); unguarded reads/iterations still report.
  • 427da20: Fix false entry-may-throw ("ToString coercion of abstract operand (Symbol)") on template interpolation of optional()/nullable() slots (issue #119): isMaybeBigintOperand no longer treats lit(null)/lit(undefined) sum members (shape unknown + literal term) as maybe-bigint/Symbol — ToString/ToNumber of nullish literals is total. Value domains unchanged; unconstrained any operands 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 < y on narrowed string 字段)保持返回 sum 不合并时,Number(x) - Number(y) 派生臂是 term-less partial prim number(parent sum conf=partial,isWidenedSumArm 按 any 派生污染臂口径整臂跳过)→ 诚实的 return number() 契约被误降 nudo:unproven-return warning(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 全绿。

  • 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-safe parseVersion(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 支持 ctor facet 并给 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 宿主路径同口径)。

1.7.6​

Patch Changes​

  • 856d8bf: fix(core): SequenceExpression 发射统一括号包裹 —— 逗号序列裸发射 a, b 在任何嵌套位都会撕裂宿主结构:对象字面量属性值/类计算键里后续项被解析成新属性的键 → new Function SyntaxError → 整文件 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])并入的 oobUndef marker(conf=partial 合成 undefined)是引擎精度产物而非用户域 undefined;postcondition 对该臂降级 unprovable(nudo:unproven-return warning,gate 不再变红),与 widened 污染臂同口径;契约显式承认 nullish(nullable(...) / union(..., lit(null)))时 marker 臂 discharged(多臂与单臂 proved 口径对称)。真实 nullish 返回臂仍照常 nudo:constraint-violated error;其余真实臂证据充分时仍 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 Function SyntaxError(如顶层 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.* 精度损失可观测。leqAbs pred 失败文案改用 predToString 渲染(pred ⊭ x > 5 替代裸 op 名),nudo:assign-mismatch suggestion 直接可读。内部: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-unresolved warning(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 Function SyntaxError(如顶层 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.* 精度损失可观测。leqAbs pred 失败文案改用 predToString 渲染(pred ⊭ x > 5 替代裸 op 名),nudo:assign-mismatch suggestion 直接可读。内部: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-unresolved warning(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 of any() — an any() 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. BodyReadField gains optional fields?: BodyReadField[]; shapeDslFromFields recurses.
    • core/scan: any actuals against a shape precondition are no longer nudo:constraint-violated errors — no info, don't guess, matching the scalar-pred channel ("any ≤ 任意目标") and the same function's unknown handling. Determined non-object and missing-field actuals still violate (controls pinned).

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-return null | number is provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings to unproven-return warnings instead of errors.

    #69 DX​

    • actionsForIssue kinds 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 empty shape({}).
    • L2 entry-may-throw suggestions 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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

    assertImplies distributed shape contracts (constraint.fields) over the members of a sum return 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 / decide return contracts went from nudo:constraint-violated errors to clean, with no other diagnostic movement.

1.3.0​

Minor Changes​

  • c717017: fix(dx): sidecar load failure reported once (#64) + contract/DX improvements

    1. Sidecar load failure dedup (defect): a broken *.nudo.js no longer reports the same nudo:interface-load once 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 says for 'X' (reads like X itself is broken).

    2. L2 entry-may-throw actions: the most honest fix (sidecar fn({ … }) param contract) is now the first suggested action, ahead of @nudo:throws.

    3. Destructured param contracts render: decide({ grade, findings }) with a sidecar field contract shows { grade, findings }: { grade: string, … } instead of decide(_p0: any).

    4. @nudo:budget function-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 global maxForks.

Patch Changes​

  • 6bc08c7: fix(env): env globals no longer shadow the host undefined / NaN / Infinity

    runTranspiled injects every @nudo:env global as a module-scope const <name> = __nudoEnv["<name>"], which shadows the host global for the whole transpiled body. @nudojs/env/es declares undefined: undef(), and web / node imply es — so any nudo.env declaration shadowed undefined:

    • the transpiler's own bare undefined text (stmt missing else arm, implicit return) and $lit(undefined) received an Abs object;
    • effect: a conditional return inside a loop joined to unknown, so for (const s of list) { if (s === "high") return "l1"; } return "l0"; folded to unknown instead of "l0" | "l1";
    • NaN bound as prim.num() degraded 0 === NaN from the definite false of native semantics to boolean.

    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 test went 39/39 → 23 passed / 10 failed; with this fix it is 33 + 6 planned cases green again, plus opaque-result 34 → 28, unknown-inference 9 → 6, host-effect-blocked 1 → 0 (env-declared builtins now fold instead of failing closed).

  • d925692: fix(core): transpile emissions no longer depend on host undefined / NaN / Infinity identifier identity

    Follow-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 no else arm (previously emitted a bare undefined sentinel that broke if the name was shadowed);
    • share one HOST_INTRINSIC_NAMES table 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.

1.2.2​

Patch Changes​

  • 662aeb5: fix(env): env-declared Number/Array/Promise/Date no longer shadow away call/construct

    Declaring nudo.env (e.g. "es") bound these globals as namespace-only objAbs objects. Once shadowed, Number(x) and new Array(n) found nothing callable/constructible and degraded to unknown — the opposite of the host identity path (no env), which folds via GLOBAL_FNS / $new's cls === Array.

    Dual-facet globals now model both faces (issue #58 option 1):

    • Abs fn may carry static slots (Number.isFinite, Array.isArray, …). $get / $in read them; typeof stays "function".
    • $new dispatches Abs constructors by name through evalBuiltinNew (Array/Date/Promise/Number/String/Boolean/Map/Set/Error), instead of only the Error/Promise special cases.
    • ES env declares Number/Array/Promise/Date as callable envFn with static slots and a ctor name, so call, construct, and statics all keep builtin semantics under env shadowing.

    Number(s) folds to number, new Array(n) to a holey tuple, and Number.isInteger / Array.isArray stay precise with nudo.env declared.

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 gets 1n); postfix caches the old value (IEEE 2^53 safe). "5"++ is 6, not "51".
    • Optional chains short-circuit the remaining chain (a?.b.c ≡ a == null ? undefined : a.b.c), including o?.length / o?.[k] / g?.() / o.m?.(). RegExp test/exec inside a chain still rebind lastIndex.
    • for-in / Object.assign honor enumerable (shared enumOwnKeys / isEnumerableView with Object.keys).
    • ToPropertyKey stringifies null/undefined/boolean computed keys (o[null] ≡ o["null"]) for get/set/in/delete.
    • copyWithin overlap 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) is false.
  • af8cb68: fix(core): JS semantics soundness — JSON space, bigint throws, __proto__ keys

    • JSON.stringify space goes through to the host (min(10, ToIntegerOrInfinity)); Infinity / (0,1) fractions no longer collapse to compact.
    • Mixed / invalid bigint ops hard-throw TypeError/RangeError when the other operand is definitely non-bigint (number/bool/null/undefined). Abstract operands (any/obj/string-prim for +) no longer fold to never — 1n + s is string concat, 1n + x (any) is bigint | string with soft may-throw.
    • __proto__ own keys survive (JSON.parse, computed literal, method named __proto__, spread/assign copy) via defineProperty; non-computed {__proto__: v} is the ES prototype special form; Object.setPrototypeOf missing/undefined proto throws.
  • ff37d91: fix(core): string-face typing — concat/template with an any operand, abstract .length

    Two gaps that made provably-string expressions come out as unknown (and raised nudo:unknown-inference on real projects):

    • concatString fell back to unknown whenever one side had no string-parts view — including any/unknown. But a string operand determines the result type: "s" + x, x + "s" and `${x}` are all string (the ToString-throws-on-Symbol path is not modelled here). This contradicted docs/design/limitations.md's mixed-+ narrowing discipline (number ⊗ obj/unknown → number | string) — 1 + x narrowed, "s" + x did not. Now a definitely-string side yields string (path conf); all-other cases keep the previous unknown.

    • $len had no branch for an abstract string prim (template / concat result / abstract string), so `${x}`.length and String(x).length fell to the trailing unknown. String length is always number; literal strings still fold exactly.

    Verified on a real project: tarballUrl-shaped templates and printScore / printPublishResult-shaped helpers stop reporting nudo: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 Function on Abs).

    Breaking renames (no major bump — package has no external users yet):

    OldNew
    tryBPathCall / tryBPathCallFulltryEvalCall / tryEvalCallFull
    tryRunBPathtryRunEval
    isBPathCapableisEvalCapable
    clearBPathCache / trimBPathCache / getBPathCacheSizeclearEvalCache / trimEvalCache / getEvalCacheSize
    evictBPathCacheForFilesevictEvalCacheForFiles
    collectBPathDiagnostics / collectBPathReplacementscollectEvalDiagnostics / collectEvalReplacements
    BPathRunResult / BPathDiagnostics / BPathFallback / …EvalRunResult / EvalDiagnostics / EvalFallback / …
    BCallRecord / setBCallCollector / getBCallCollectorEvalCallRecord / setEvalCallCollector / getEvalCallCollector
    noteBPathFallback / setBPathFallbackCollectornoteEvalFallback / setEvalFallbackCollector
    MAX_B_CALL_DEPTH / MAX_B_TOTAL_CALLS / MAX_B_TOTAL_FORKSMAX_EVAL_CALL_DEPTH / MAX_EVAL_TOTAL_CALLS / MAX_EVAL_TOTAL_FORKS
    maxBRuns (sessionCache)maxEvalRuns
    NUDO_CACHE_MAX_BRUNSNUDO_CACHE_MAX_EVALRUNS

    Source files bpath-run.ts / bpath-diagnostics.ts / bpath-*.test.ts are now eval-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.of packs 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

    $get returned absFunction([], { body: noBody }) for Array.prototype methods (concat/sort/…). $invoke treated that hollow impl as an object method and $called it, folding a.concat(b) to exact undefined and arr.sort() to never/TypeError — false precision vs the previous conservative unknown (benchmark gate: array-03 / complex-01 regressed unknown → mismatch).

    First-class reads still expose a function-shaped Abs (typeof a.push === "function"), but without a callable impl so method calls fall through to invokeArrMethod / conservative unknown.

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; split keeps 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 exact true when the value may be NaN
    • JSON.stringify of top-level function/symbol returns the JS undefined value
    • NaN literal identity uses SameValue (assignment/leq), not ===
    • drop unsound x*0=0 / x+0=x algebra identities (NaN/-0/string domain)
    • n % 0 folds to NaN; x % k bounds only for finite dividends
    • 0n is falsy; Number.is* fold non-number lits to false; global isNaN coerces
    • string index methods (charAt/slice/…) honor ToNumber and default args
    • unary minus and parseInt/parseFloat honor 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, not undefined lit

    fix(parser): directive scanners (splitTopLevelArgs / colon / arrow / balanced parens) respect string literals.

    Review follow-ups folded in: split(undefined) special case, indexOf returns number shape on abstract receivers, Math method allowlist.

1.1.2​

Patch Changes​

  • c1f3e93: fix(core): never-execute host side-effect guard also covers new

    $new was not identity-guarded against the host side-effect list (WebSocket / XMLHttpRequest / EventSource), so new WebSocket(url) only avoided real network I/O by falling through to an empty brand — a coincidence, not an explicit block. Both $callNamed and $new now share blockHostSideEffect: identity match fails closed to unknown#opaque and reports nudo:host-effect-blocked.

1.1.1​

Patch Changes​

  • 86d1f87: fix(core): never execute host side-effect globals in the B path

    $callNamed executed any host function it could not fold, so a module calling fetch(url) made the analyzer issue a real network request with Abs arguments ([object Object]): nudo check / nudo test died with TypeError: Failed to parse URL from [object Object] (ERR_INVALID_URL) via an unhandled rejection. setTimeout / setInterval scheduled real timers the same way.

    fetch / XMLHttpRequest / WebSocket / EventSource / timers / queueMicrotask / requestAnimationFrame / requestIdleCallback are now identity-guarded (aliases included) and fail closed to unknown#opaque, reported through a dedicated nudo:host-effect-blocked (info) diagnostic — not nudo: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:

    1. execRegexBrand documented "exec → null|tuple 的保守并" for a subject that is not a string literal but returned undefined instead. The caller then fell through to the "method not found" path and the result became the Abs undefined: typeof m folded to the literal "undefined", m === null folded to false, capture groups stayed unknown, and Number(m[1])-style returns collapsed. exec now returns the conservative null | array(string|undefined).

    2. checkReturnConstraint reported a null return as violating a shape({...}) contract. lit null/undefined cannot satisfy any constraint, so reporting it is a false positive (return null means "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 returns null for 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

    checkReturnConstraint only accepted ret.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 as nudo:constraint-violated even when every member satisfied the declared shape({...}) contract. Real-world hit: sidecar fn({...}, 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-level watch / harvest; flags --callsites, --output, --format zod, --dts, --emit-cases; API absToZodSchema; InferJson/serializeInferJson → CaseJson/serializeCaseJson; LSP agent tools nudo.infer / nudo.interface* and aliases → nudo.test / nudo.contract*; config key package.json#nudo.interface.* → package.json#nudo.contract.*. Root scripts infer/types/interface removed.
    • Primary verbs: check / test / contract / export / health / env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell @nudojs/nudojs follows @nudojs/cli majors.
    • L2: undigested may-throw on entry/export functions is nudo:entry-may-throw (default error). Configure with --ignore-throws / --entry-throws or package.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.
    • check always prints signatures on success; unconstrained entry params display as any (true unknown = inference failure + nudo:unknown-inference).
    • test prints every case including synthetic call@/entry@; only declared @nudo:case expectations affect exit. --freeze[=update] solidifies witnesses.
    • Flags: --from, export --format dts|guard|schema|standard|all (--dialect zod for schema), export --out. --json cannot 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.
  • 0e1432a: feat!: source contract directive is @nudo:contract only

    @nudo:refine and @nudo:interface are 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:interface with @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 精化.
  • 3c3f9d2: Reduce @nudojs/core public 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/internal instead.

    • @nudojs/core (.) keeps the product face only (Abs, check, format, projections, contract builders, B-path $op runtime + transpile).
    • New subpath @nudojs/core/internal (minor-escape hatch; no SemVer promise).
    • packages/core/PUBLIC_API.md + public-api.snapshot.json updated; freeze test also asserts product face does not leak internal names.

    Product CLI faces (check / test / contract / export / health) are unchanged. @nudojs/service / @nudojs/lsp already retargeted.

Minor Changes​

  • 279d73a: fix review gaps on the B-path migration (PR #34 follow-up):

    • inject pipeline: CheckOptions.inject is now threaded into generalize, L2 throws, the record channel, and drift recompute (previously CLI computed mocks/env/replacements but only modules reached core; @nudo:mock/env/replace sources were fail-closed unknown#opaque under checkSource). Memo keys use inject content fingerprint (stable across CLI's per-call object allocation). mode: "analyze" always wins; modules prefers opts.modules then inject.modules.
    • L2 class / CJS methods: explicit throw on class static methods and CJS object methods is no longer hard-coded as throws: never — NudoThrow/ReferenceError map to throws Abs (same as callTranspiledExportFull). $call records throw exits before returning never. L2 evaluation now seeds phi from checkSource.
    • freeIdentifiers: lexical scopes (nested params no longer pollute outer free set); non-computed ObjectMethod/ClassMethod keys are not free refs.
    • callBudgetKey: single defensive implementation for non-Abs args (B-run JS function args). $call compiled-body path now uses enterCall/exitCall (same budget as apply). Budget keys use fn object identity (stableCallId) instead of anon#N (false cycles across same-arity functions). MAX_TOTAL_CALLS unified at 20k.
    • method early-return (correctness): ObjectMethod / ClassMethod / property FunctionExpression bodies now go through transpileFnBodyStmts (early-return lift) + implicit return — previously if (c) return X; return Y silently always returned Y (false precision vs native).
    • collectors: setBCallCollector / setBAssignCollector / setMemberDiagCollector / setAbsTruncationCollector return the previous collector; nested call sites save/restore instead of nulling.

    User-visible notes:

    • Sources with @nudo:mock / @nudo:env / @nudo:replace get real B evaluation under nudo 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-derivation class-method roots stay fail-closed (no call-chain derivation) — intentional after ast-eval removal.

Patch Changes​

  • P1–P3 engineering hardening (review follow-ups) — no product-face breaks

    • @nudojs/parser: export typed Babel AST narrowers (ast-guards.ts); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).

2.1.0​

Minor Changes​

  • 69ebbf6: Align product surface with interface-first design: @nudo:case is debug / nudo test only, and the T.* directive grammar is removed.

    • Directive type expressions accept constraint builders (number(), lit(), shape(), union(), array(), any(), …) and concrete literals only. Bare T.* parses as unknown; parseTypeValueExpr is no longer exported — use parseCaseArgExpr.
    • serializeCaseArg / --emit-cases emit builders (number(), union(…)) instead of T.*.
    • LSP typeExprToDirective emits builders (number(), union(…), any()).
    • CLI infer reports call-site facts (call@L…) and debug "name" witnesses with Observed: joins — not Case "…" / Combined: as the type product. Contracts stay on *.nudo.js / @nudo:refine.
    • Constraint builders accept concrete nested literals so directive grammar round-trips.

2.0.1​

Patch Changes​

  • 9731238: BREAKING (behavior) @nudojs/service: handwritten @nudojs/env now 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/env slot if you needed harvest's version; otherwise no code change. Conflicts emit a nudo:env-harvest-conflict warning 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-call onConflict), 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=off stays explicit and uncached. clearNodeHarvestCache() also drops not-found misses so a later @types/node install is visible in-process. nudo:env-harvest-conflict warnings point at the conflicting import specifier when found (file-level line 0 otherwise).
    • @nudojs/env (minor): events / stream / querystring; high-frequency util slots; Promise APIs only under fs.promises / node:fs/promises (callback-style fs.readFile etc. no longer pretend to return Promise). Optional Node params (path.basename ext, url.URL base) keep typed labels (ext?: string) but are not required slots — requiredFnArity skips ? / ....
    • @nudojs/core (patch): formatShape renders fn rest labels (...paths) and optional labels (options?) as ...name: T / name?: T. leqAbs fn arity uses required slots only (requiredFnArity skips ...rest / name?): src is assignable to tgt iff src.required ≤ tgt.required (TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). Pairwise paramTypes contravariance is unchanged.
    • @nudojs/lsp (patch): freeze inventory in public-api.ts (also exported as @nudojs/lsp/public-api); agent slash requests register from NUDO_AGENT_TOOL_NAMES; selectCase / getActiveCases are 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.0 after the next release, and prefer leaf-clean coverage counts (empty { } shapes are not leaf-clean) over raw resolved ratios.

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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

1.0.1​

Patch Changes​

  • 61b8a6c: Fix soundness issues in Abs evaluation:

    • parseInt honors hex/octal/binary prefixes and explicit radix (no forced radix 10)
    • Array.isArray returns unknown boolean for any/unknown/sum, and sees through brand
    • Date.now() is an unknown number, not a folded wall-clock timestamp
    • strict numeric bounds win over non-strict at equal value (order-independent)
    • boundsSatisfiable no longer downgrades strict bounds via redundant ge/le
    • structural absShapeKey stops join/dedup collapsing distinct arrays, overloads, brands
    • denoteGuard renders NaN/±Infinity correctly
    • String.split with non-literal separator returns arr<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: handleInterfaceEmit now passes agentToolDeps so workspaceRoots reach assertEmitTargetAllowed (was dead in production).
    • Emit fail-closed: empty workspaceRoots rejects; no ancestor-package.json authorization fallback; realpath blocks symlink escape; refuse writes under node_modules.
    • autoBind kill-switch complete: threaded through scan generalizeFromAst / same-file eiOpts; empty fromFile no 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 effectiveInterface memo in check; take*Since on memo hit/miss (no LSP diag theft); shift rejects non-finite offsets; @generated marker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
  • de47d84: Review fixes on feat/interface Phase 1:

    • autoBind kill-switch: analyzer's cross-file nudo:interface-domain-exceeds path now reads package.json#nudo.interface.autoBind (was silently ambient-loading sidecars when autoBind: false).
    • nudo check --callsites: inject usage-site call records so CI gate can surface nudo:interface-domain-exceeds (previously only reachable via analyze/interface paths).
    • Sidecar auto-bind coverage: localNamedExports accepts local export { x } / export { local as exported } list form (was declaration-only; silent miss for common style).
    • Directory targets: isNudoTargetPath excludes *.nudo.js / *.nudo.ts so check/infer/doctor no longer treat contract modules as source.
    • VS Code client: documentSelector includes TypeScript; file watcher covers **/*.{js,mjs,ts} (includes .nudo.ts sidecars).
    • LSP emit: failed interfaceEmit no longer claims "sidecar written" and skips the invalidation path.
    • UX: first --emit with empty default targets prints a --fn/--all tip; --fn/--all without --emit warn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
  • 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • Relational compare folds mixed concrete lits ("a" > 3 → false), so if (x > 3) does not join both branches for NaN inputs.
    • joinValues uses Object.is so join(NaN, NaN) stays NaN (NaN === NaN is false).
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]).
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead of call-site B-path nodes.
    • Param inlay no longer invents where x > 3 from if (x > 3) return x — only explicit @nudo:refine contracts show as preconditions.
    • Return inlay is a path summary with source param names: x + 1, x | x * 2 (not the refined number where x>3 | string | … dump).
    • Number range narrowing uses exclusive bounds (> 3, not integer-style >= 4).
    • Concrete if tests no longer narrow the tested value into a range (44 > 3 keeps x as 44).
    • True branch of x > k on unknown refines to number>… | string (JS ToNumber space).
    • flattenSum keys prim members by term/pred so number=A1>3 and number=A1*2 stay 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]), not only the agent object form.
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead 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; …tail into return $fork in B-path transpile, and join partial-return fall-through in AST evalBlock. @nudo:case "A" (92) on a graded if now yields "A"; nudo test expected cases pass; doctor-emitted call@ solidifies correctly.
  • df1726c: Make @nudo:env actually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path $invoke implements string methods and filters union members, and collectAbsCallRecords merges 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 --version reads the real package version, and nudo check accepts 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:path etc.).
    • 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, evaluateProgram is skipped so TypeValue no longer double-reports.
    • CLI check / types / test accept directories; check uses an Abs-only gate.
    • LSP hover / getTypeAtPosition on capable files read the Abs node table; *.nudo.js edits evict L0 and recheck open parents.
    • Public core surface now re-exports the algebra API (Abs, check, generalize, exec, bridge, parseSource, stripTypes).
  • 5786fa5: Speed up repeated analysis with layered memos and tighter cache contracts.

    • Shared parse/AST LRU, generalizeFromAst L0–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.

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 .ts constructor annotation (including parameter properties) is now the instance field's domain, so constructor(private size: number) + area() { return this.size * this.size } reports number instead of an any-arithmetic nudo:entry-may-throw error while the dts face already said number;
    • definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero, in on 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-level const (false red) and destructured declarations reach the obligation check (false green);
    • a classic for (const i = 0; …; i++) head is a const again, so the always-throwing step is reported instead of staying green;
    • nudo:capability-denied joins the check-face diagnostic whitelist, so nudo check can report the cause of unknown like nudo test — gated on the report actually showing an inference failure (nudo:unknown-inference), so a plain module.exports = … file does not grow a warning about the module global while the same exports written as exports.x report nothing.
    • cross-file evidence from --from now resolves the default export name on both sides, so a renamed default import, import { default as g } and ns.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 from effectiveContract'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 for export 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>Input keys a destructured parameter by its field names rather than the internal _p0 placeholder, 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) alongside module.exports = value keeps the named-export projection (TS forbids export = next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than one return projects unknown instead 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 check entry 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.

  • 161d156: Switch the check entry 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 false nudo: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 typed Evidence verdict; it only records divergences and does not change any export decision. Stage 1 slice 4.2 switches only the diagnostic surface: nudo export now prints degraded evidence codes (nudo:internal, nudo:unknown-inference, …) instead of silently dropping them; blocking and exit codes still follow EXPORT_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.

    parseSource already 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. Threading filename from analyzeFile, transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors and localNamedExports drops 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% (checkSource path 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 as export 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.ts JSDoc gains readable Contract: rows (sidecar expression text / constraint rendering). They are notes only — the type face still comes from Abs, and Case: 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/le bounds; new tests pin bounded output and the honest omission of non-expressible relations (x > y).
  • 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 of callSiteBudget by internal records.
    • When a function has both @nudo:case and call-site records, the default run keeps the mutual-exclusion report and prints a both-paths hint naming those functions, pointing at --both-paths (sources stay labeled: directive vs callsite). --json is unaffected; truncation reasons and their next actions keep flowing through the existing nudo:*-truncated diagnostics. Under --freeze the hint is suppressed: --both-paths combined with --freeze is a usage error, so the suggestion is not actionable in that run.
  • 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.
    • formatConstraint renders 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.ts now carries optional formals / argKeys / bounds / pre / eff and a per-function entry (fn\0<scope>) on the SAME Map; fnSummaryStats() keeps its instance-level meaning, function-level hits/rejections are exposed by fnSummaryFnLevelStats() (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.bounds is 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 sorted varOrder used to transpose arguments (f(z,y) → f(p,q) returned q - p);
      • arg isomorphism: per-position α-normalized absKeyWithConf keys (shape × term × pred × conf) — a kind-only signature used to reuse {x:1} summaries for {y:"s"}, length-2 summaries for length-3 tuples, and Date summaries for RegExp;
      • full precondition: the formation-time Φ (pre, renamed formals → current argument vars) must be implied by the current Φ — checking only the simple bounds projection dropped app-term conjuncts, so x % 2 === 0-formed summaries leaked to unconstrained calls. Then substAbs(post, map) is applied instead of re-running the body. bounds stays as observable metadata only.
    • All three conservative channels are on by default (crossModule, bodyUnavailable, budgetTruncated); the degraded channels are verified independently (abs14-degraded-channels.test.ts), gated off symbolic runs 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) plus abs14-fastpath.test.ts calling diffAgainstBodyBaseline. 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 asserts applied grew — 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).
  • 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 as debug/src/common.js's function debug(...args) { args[0] = ... } therefore threw V8's native TypeError: Assignment to constant variable during module evaluation, making nudo check fail closed with nudo:module-throw. Both emit sites now use let (native rest bindings are mutable). Regressed by eval-rest-param-rebind.test.ts; reverting to const makes all 9 cases fail.
    • ABS-14 degraded channels enabled: bodyUnavailable and budgetTruncated now default on alongside crossModule. The replacement logic is extracted to key/summary-fastpath.ts#tryDegradedChannel and verified independently by abs14-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 stays unknown #opaque. The read side is gated off symbolic runs (same as the write side and the cross-module channel, so a prior instantiate can 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.ts now translates expressible contract Pred leaves into type-parameter constraints — primitive typeof tags, eq(var, lit) literals, and fully-expressible or unions. Numeric bounds, lengths, negations and typeof object|function are honestly omitted; unbound declarations stay byte-identical. Projection reads contract.params[].abs.pred directly, so AnalysisResult and its cache cloning are untouched. Covered by abs14-dts-extends.test.ts including a tsc --noEmit round-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 existing VERSION_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-debug now states that the return face depends on whether the real debug package resolves; verify:examples pins only OK / 0 error / export names, not nudo:opaque-result.

    The TypeParam.bounds empty-field debt noted in this changeset was fixed in a follow-up commit (Pred variable-space alignment via alignSimpleBounds + abs14-bounds-integration.test.ts); attachHofSnapshot not passing refine was re-checked and confirmed to be correct design, not a defect.

  • 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 / 指纹,无需手工清缓存。core formatShape 的展示面不发布生成器身份(既有契约,逐字不变)。

    残余批次(同批发布):

    • A2 声明/收割面:declare class 类值挂 callable:false;JSON.stringify(obj, 类构造器) 由 may-throw 升为确定抛 TypeError。HarvestSig.fn 新增 callable 字段、HARVEST_DISK_ABI v14 → v15(~/.cache/nudo/deps/ 旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs 的 absFunction mock 重建也整包搬运槽位。
    • 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:case directives now can also synthesize call@/entry@ witnesses in the same round (teaching comparison face; default exclusivity unchanged). --json separates the paths via source: "directive" | "callsite"; exit semantics unchanged (synthetic cases never fail the run). --only without --both-paths, and --both-paths --freeze, are usage errors.
    • Signed disk cache: package.json#nudo.cache.sign: true + NUDO_CACHE_KEY signs 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.cache also accepts an object form { dir?, sign? }; typo'd keys surface as config-shape report entries.
    • truncation suggestions: fork/recursion-budget fix values in the analyzer now consume the single-sourced suggested{Fork,Depth,Calls}Ceiling helpers 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 in s1-perf-baseline-real.{md,json} with an honest corpus header).
  • 4fc7e19: Rename the remaining Nudo interface terminology to contract end to end.

    • Core: effectiveInterface → effectiveContract, InterfaceSource → ContractSource, InterfaceTierInfo → ContractTierInfo, interfaceTierOf → contractTierOf, takeInterfaceDiags* → takeContractDiags*, and the algebra/interface/ directory → algebra/contract/.
    • Service: emitInterface / draftInterface / interfaceSurface → emitContract / draftContract / contractSurface; interface-*.ts files → contract-*.ts; ifaceCacheKey → contractCacheKey and the disk-cache namespace iface → contract.
    • Diagnostics: nudo:interface-* → nudo:contract-* (no alias layer).
    • CLI/LSP: CodeLens titles ⚡ persist contract / ↻ update contract / ⚡ draft contract; agent messages no contract found / no contract changes; CheckIssue actions and hover/inlay fields use contractSource / contractDisplay / contractActive.
    • Docs, examples (contract-derivation/, contract-draft/), API snapshots, and website references updated.

    TypeScript's interface keyword, Babel AST TSInterface*, and historical release notes are intentionally unchanged.

  • 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 test call@symbolic hint + nudo health precision counts.

    • nudo test: when a report contains call@symbolic (the symbolic aggregate witness folded from call sites beyond callSiteBudget), the report tail now appends one actionable note (SYMBOLIC_BUDGET_NOTE, same "fact — action A or action B" shape as the nudo:recursion-truncated advice): raise package.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 without call@symbolic stay byte-identical.
    • nudo health: the Summary line and the --json summary (same source) now carry precision counts — unknownSignatures (functions whose return the engine could not infer; renders unknown, counted via the shared inferenceFailed predicate; @nudo:skip functions are declared faces and not counted) and widenedWitnesses (occurrences of #widened, i.e. witnesses with conf === "widened" — budget-folded symbolic aggregates / loop widening). Informational only, like uncovered: never gates the exit code. Text Summary reads … · N unknown signature(s) · M #widened witness(es); --json summary gains additive keys unknownSignatures / widenedWitnesses.
    • @nudojs/service exports SYMBOLIC_BUDGET_NOTE (single source for the note text; CLI and tests consume the same constant). Regressions pinned in packages/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 the writeSrcTsconfig convention, so they no longer silently test a stale dist/).

Patch Changes​

  • 56d8227: Add the nudo:capability-denied diagnostic (ABS-12 R12-D, strict by default). Host globals and node: modules classified as denied now report this code — values stay unknown and are never executed natively — instead of nudo:builtin-unknown; denied modules are reported at the import/require site. Module classification only covers builtins (node: prefix or module.builtinModules), so relative paths and npm packages keep their existing missing-module channel. NUDO_CAPABILITIES=trusted (or setCapabilityMode("trusted")) restores the previous builtin-unknown surface and limits runtime identity blocking to the hand-written high-risk list; unclassified names (typos) remain builtin-unknown in both modes. Docs updated (EN + zh-Hans). Pinned by capability-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, with N = 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/internal so 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:mock skeleton per host family — fetch gets @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) gets stub().returns({ … }) (an arrow mock is not constructible — new on it would trade the Info for a throws TypeError may-throw). All skeletons verified end-to-end: pasted verbatim into the calling function's JSDoc, the diagnostic disappears and the result regains precision. The structured mock action in check --json carries the same skeleton.
    • nudo:recursion-truncated: the depth/calls arms of the suggestion (and the @nudo:budget quickfix in nudo check --fix / LSP code actions) now carry concrete values derived from the observed depth/call counts — @nudo:budget depth=128 / calls=40000 floors (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 a reason keep the old forks=64 quickfix 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 臂时同样收紧,由 core denoteGuardB 的递归身份子句与 schema-generator.ts::syncGeneratorTags(约束投影通道丢 facets 后按原始 Abs 树同步)共同保证,四面不再相反裁决。
    • zod 面内联 z.custom((v) => Object.prototype.toString.call(v) === "[object Generator]");standard 面库版 checkNode 与产物内联 __nudoCheck 两份实现同口径;guard 面的身份子句由 core denoteGuardB 递归入口生成(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」——nudo any 是「任意 JS 值、无约束」,对应 TS 的 unknown(top,消费方须先收窄),不是 TS 的 any(关闭类型检查的逃生舱)。此前 .d.ts 是唯一把 nudo any 直译成 TS any 的产物面,而 zod / standard / guard 三面运行时校验器早已把 any / unknown 同映为 unknown。现在 TS 投影面归一,四面同口径。

    • dts-generator.ts::absToTSTypeB 的 case "any" 由 return "any" 改为 return "unknown";另补齐三处绕过该函数的硬编码:classParamDecl(类构造器 / 静态方法形参)、无签名导出的 (...args: unknown[]): any fallback、泛型基类实参占位。源码注解原文解析的 any token 白名单、守卫体内部故意的 Record<string, any>、case-json / contract draft / formatAbs 等 nudo 展示面均不变。
    • abs.md(en / zh)的「unconstrained entry parameters display as any」规则作用域澄清:它只管 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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • 7d7abe4: Dedup batch 4 (jscpd --min-tokens 70 audit 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 → core formatEntryParamShape via @nudojs/core/internal (the old comment claimed "core adds no export"; the internal face is the sanctioned route).
    • lsp server-code-actions norm/resolveRel copy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) → @nudojs/service/emit exports normPosixPath / resolveRelativeSpec; the lsp-only extensions stay at the call site.
    • standard-schema brand ctor list: GLOBAL_BRAND_CTOR_NAMES local array + Set → schema-generator RUNTIME_GLOBAL_CTOR_NAME_LIST (single array source; Set + isRuntimeGlobalCtorName predicate derive from it; the embedded validator serializes the same array, byte-identical).

    In-file twins single-sourced:

    • core hof.ts: predUsesMappedVars / mapHasShapeOnlyVar → parameterized predAnyVar walker.
    • core scan/literal-shapes.ts: 21 structurally identical constraintViolated issue 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.all dual reject faces → allRejectFace.
    • core check.ts: handwritten return-contract recording block (skip branch + main branch) → recordReturnContract.
    • core leq.ts/postcondition.ts: duplicate primOf single-sourced in leq.
    • core builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) → taOwnKeysTuple; gOPD class/Error/.prototype slot→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/$forOf applyExitJoin closures → new pure loop-exit-join.ts applyLoopExitJoin (the discovered exhausted && widen gate difference is an explicit parameter; $forOf passes exhausted: true, provably equivalent).
    • core directive-scan.ts ↔ parser fn-directives.ts: CASE_TAG_REGEX scan loop → core iterCaseTags(text, caseArgSpans) via @nudojs/core/internal (Bug 978 diagnostic actions and downstream regexes stay consumer-side).
    • service dts-generator.ts: DtsClassMemberSurface base interface — scanClassSurface return type no longer re-declares the member fields (BUG-168/151 docs live once).
    • lsp: replay.ts async env-preload twins share preloadEnvsThen, function scope walkers share walkFnScope; server-navigation.ts references/rename share the gate+parse prologue; hover.ts generalize blocks share tryGeneralizeEnclosing.

    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).

  • c48fd48: Engine review batch (evaluation-engine design audit; 3 concurrent domains, behavior-preserving except where noted). Full suite green (2113 files / 16579 tests), verify:examples 251 checks green, build + lint + lint:tests clean, public-api-freeze green (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 into TranspileOptions.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, cmp clean; __nudoLv* / __nudoSw* / __fir* / __swBody* base names unchanged).
    • PrivateName key extraction unified: new privateNameKeyOf (bare #name or null) is the single extraction point; privateNameKeySrc builds on it. The three inlined copies (expr/call.ts, expr/optional-chain.ts, class-emit.ts keyOf) now call it. The dead || undefined branch in optional-chain (#${… ?? ""} is always truthy) deleted.
    • transpile/stmt-predicates.ts → transpile/stmt/predicates.ts (statement-domain file now lives under stmt/).
    • userIdentCache: whole-table clear at 64 → BoundedLruMap(64).

    core runtime:

    • isAbsLike (shape+conf) added to abs.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 local isAbsVal re-definition now aliases it. Behavior delta (bugfix): host objects that merely carry a shape data property are no longer misdetected as Abs values — they now take the host branch as DEC-006 intends. The one inline check inside run.ts:712 generated-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) and callLocStack / absOrigins (member-diag.ts) migrated to createScopedSlot + registerCollectorScopeParticipant; module-global fallback behavior unchanged (generator evaluation is synchronous, push/pop paired).
    • $assumeAnchor (≈80 lines) moved out of runtime/ops.ts into runtime/assume.ts; ops.ts back to pure arithmetic delegation. Export surface unchanged.
    • runtime/containers.ts is a pure re-export barrel again: the five isomorphic guard wrappers ($idx/$idxSet/$get/$set/ $iterCheck) collapsed into guarded-entry.ts's guardedEntry factory (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's evalRunByFile) replaced with BoundedLruMap; 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 from analyzer-abs-eval.ts and the @nudojs/service export 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 calls composeEvalModules; the real differences (mock seeds enter the graph on the analyzer face vs runtime injection on the inject face, fileDirectives vs from-source, structured mockModuleErrors) 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 keeps tryRunEval/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 in mock-abs.ts; all five stamping sites go through it, seed-fn entries now stamped too; the reader (absSeedPart) consumes impl.fingerprint only (single "nofp" marker when absent, no format-string reconstruction). Cache keys change once (harmless miss).
  • 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

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 → new core/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). scanWithStrings was dead after the move and is gone.
    • bigint operand predicates (isNullishLitOperand / isKnownNonBigintNumeric / isMaybeBigintOperand): surface.ts carried a forked copy of arithmetic/coerce.ts — its isMaybeBigintOperand lacked the Bug 946 arr/tuple arms and only stayed sound by accident of the catch-all throw. Single source in coerce; foldNumericBinOp now mirrors foldBigintBinOp's explicit arr/tuple hard-throw so 1n & [] still throws deterministically.
    • Bug 946 member-level fix (behavior): isMaybeCoercionThrowOperand now recurses into sum members and skips arr/tuple members — x & 1 / 1 - x with x: 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 + x on the same union still records may-throw: the number member genuinely throws).
    • collectNestedBodyRanges wiring completed: core exported it via @nudojs/core/internal and its comment claimed parser reuse, but parser still ran a full local copy. file-directives.ts now 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.
    • absShapeForTsTypeText via @nudojs/core/internal: service's tsAnnotationShape was 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.ts and interface-emitter.ts duplicated the export-statement → {names, bindings} extraction (31 lines) and stripSections (14 lines); both now share service/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.
  • 5769211: Dedup batch 5 (jscpd --min-tokens 70 audit 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.ts yield try-context bits (raw 1|4|8 / & 2 / ~(16|32|64) literals pinned by a "钉死同步" comment to runtime control.ts YIELD_* constants) → new zero-dependency leaf exec/yield-bits.ts; runtime (control.ts re-export removed, async.ts) and transpile (statement.ts) both import the named constants.
    • parser case-arg.ts TYPE_EXPR_CHAIN_METHODS hand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exports CONSTRAINT_CHAIN_METHOD_NAMES (public barrel, next to CONSTRAINT_BUILDER_NAMES); parity pinned by constraint-chain-methods.test.ts (method-face drift ⇒ CI red).
    • service builtin-prototype.ts BUILTIN_ERROR_CLASSES verbatim 8-name copy of core ERROR_CTOR_NAMES → imported via @nudojs/core/internal (the dead module-level re-export is removed; no public face change).
    • core promise.ts aggregateErrorAbs local error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated in eval-bug-293-promise-combinator-settle.test.ts (slot-key set / non-enumerable flags / inherited name vs errorBrandAbs).

    Whole-function twins single-sourced:

    • core builtins/error/binary.ts makeArrayBufferAbs / makeSharedArrayBufferAbs → parameterized makeBufferAbs (brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved).
    • core transpile/member-path.ts memberWriteIfe / memberWriteRootIfe → shared memberWriteIfeImpl (only real difference: return written value vs new root).
    • nudojs version.ts three walk-up-to-package.json loops → findPkgDirUpwards + readVersionAt.
    • nudojs migrate.ts planWorkflowRewrites → delegates to planWorkflowRewritesIn(findWorkflowDir(from)); readPackageJsonDetailed / readMarkerFile → shared readJsonObjectDetailed(path, label) (missing / invalid / unreadable / ok grading unchanged).
    • service emit/quickfix-edits.ts sidecarClearsEntryThrow / sidecarClearsConstraintViolation → shared sidecarClearsDiags(input, codes) (Bug 556 dual-code gate preserved).
    • core generalize.ts ctorParamCountOf / ctorFormalsOf twin class-ctor walkers → single ctorParamNodesOf walker (Bug 1031 null-declaration skip lives once; count still raw param length, formals still formalParamsFromNodes — the this-param skip semantics unchanged).
    • lsp server-commands.ts handleSelectCase / handleSelectContract ~20-line resolve→read→caseTargets→knownFunctionNames preamble → resolveCaseTarget (error strings byte-identical).
  • fd0fb09: Dedup batch 7 (jscpd --min-tokens 70 re-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) → single storageObj const (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → shared execSyncOptions; 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 → emitterCoreSlots shared by the EventEmitter brand and the process global object.
    • env node.ts path family — the drifted manual-sync pair: the top-level pathModule inlined the whole member table next to the platformPathMethods(posix/win32) factory and had already drifted (join.required only on the top-level copy). pathModule now 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 .searchParams slot table and the global URLSearchParams constructor share searchParamsCoreSlots (toString / iterator face / size stay per-site; insertion order preserved).
    • core builtins/error/binary.ts: DataView ctor and makeTypedArrayFromBuffer share bufferByteLengthLiteral (brand→inner obj→byteLength slot fold); TypedArray.of's inlined copy of the number-domain item enforcement now calls enforceTaItem (the .of cause variant is unified into the shared text — no pins).
    • core builtins/object/methods.ts: getOwnPropertySymbols obj arm and brand-inner arm share the ownSymbolsTuple tail (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) share unwrapExportDecl.
    • harvester harvest-dts.ts: resolveIfaceDecls inner-first relative namespace resolution loop (qualified arm + short-name arm) → addRelativeNsHit; absExtends' two es.k === "sum" member folds → foldSumFlags (the cs.k === "sum" fold is intentionally different and untouched).
    • service analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) share actualSlotTable (obj direct / brand inner-obj unwrap).
    • lsp server-navigation.ts: onDefinition now uses the shared navigationIdentAt preamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept.
    • lsp agent-tools.ts: suggestCase / trace share the analyzeToolFile preamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
  • 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_OPS in 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 superSpec reference 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 single rebrandClassAbs primitive 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 as nudo:unproven-return instead of silently staying green.
    • BUG-027: export --format dts no longer widens a non-same-prim literal union to its base type, so the published .d.ts matches 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.ts now express the same optionality.
    • BUG-208: sidecar fn()'s throws slot splits separators like @nudo:throws, so throws: "TypeError, RangeError" no longer silently becomes one unknown kind.
    • BUG-209: pick() / omit() / partial() preserve the optional flag, so legal calls are no longer judged violating and dts keeps 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.ts y>1 ⊢ y+1>2truefalseBUG-200:136 触发形态;(1+2**-52)+1 === 2(ties-to-even)
    pred-assume-finite.test.ts 同款truefalse同上
    arithmetic.test.ts x>0 ⊢ x+1>1truefalseBUG-200:14-16,27,30;反例 Number.MIN_VALUE
    example0.test.ts cmp("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} 对 optional string 仍失败(未放宽)。

    回归: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-freeze 9/9。e2e:optional 夹具 nudo check exit 0 且无 nudo:constraint-violated(tsc 亦通过),required 夹具 exit 1 且有该码(tsc TS2322)—— 引擎与 tsc 结论一致。三面同源:check-case-scan.ts 的 witnessViolations 字段循环(@nudo:case 见证面) 也改用同一判定;并补真 CLI e2e cli-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 —— 这是 ES OrdinaryToPrimitive 的规定(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 逐字同形 ⇒ 信息在 降级处丢失,需专用 $toStr op)。

    追加:BUG-058 模板插值 / String.prototype.concat 面已修(专用 $toStr op)​

    ${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​

    模板插值的 $toStr op 是 ./exec 的导出(exec/index.ts),快照面必须同步记录—— public-api-freeze 的 ./exec 分母因此从 208 变 209。该条目属于快照正常演进 (导出面确实多了一个算子),不是放宽门禁。

  • aed8e00: Fix bug-report category 03 (evaluation engine) — verified subset.

    • BUG-194: $copy / $set on a host global no longer crash the engine with a bare TypeError (nudo:internal false red); the fork/copy path handles host objects.
    • BUG-218: Proxy has trap 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 a false the host can never produce.
    • BUG-219: delete <host global>.x / "x" in <host global> route through $del / $in correctly instead of raising a bare TypeError.
    • BUG-243: Array.prototype.indexOf no longer clamps fromIndex to len - 1; fromIndex >= length returns -1 like the host (the sibling lastIndexOf clamp 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 as TypeError (host kind) rather than a generic Error.
    • BUG-249: strictEqAbs's "same Abs ⇒ same value" fold now honours the domain-sharing gate, so xs[0] === xs[1] over a contract-typed array no longer folds to true.
    • BUG-254: env-global injection no longer splices names verbatim into let bindings, so a strict-mode reserved word can no longer produce a new Function SyntaxError 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.sh exit 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-throw error —— 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。

  • 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 own name / length / prototype slots.
    • BUG-009: a regexp literal's flags are canonicalised, so /a/gi and /a/ig agree.
    • BUG-132: a boxed primitive's internal slot is modelled.
    • BUG-157: URLSearchParams entries()/keys()/values() are no longer reported as carrying an internal slot.
    • BUG-164: the Object.prototype legacy accessor allowlist and the descriptor table are now the same source of truth.
    • BUG-176: Reflect.construct on a user class is no longer reported as may-throw.
    • BUG-181: Reflect.set with a primitive receiver is a definite TypeError, not a false red.
    • BUG-182: a host function's constructibility facet is decided by IsConstructor, not by the presence of a prototype property.
    • BUG-230 / BUG-260: Set / Map cardinality from an abstract iterable is no longer a definite value, and MapTable carries insertion order so key iteration matches the host and new Set(xs).size agrees with Array.from(new Set(xs)).length.
    • BUG-276: class-instance enumerable flags are correct, so getOwnPropertyDescriptor / Object.keys agree with the host.
    • BUG-277: a builtin brand's user-defined keys are enumerated (entries / getOwnPropertyNames / getOwnPropertyDescriptors / JSON.stringify).
    • BUG-278: an Error subclass's inherited name ordering matches the host.
    • BUG-281: getOwnPropertyDescriptors on a brand instance matches keys/values.
    • BUG-282: a nested same-name @nudo:case scope resolves to the nearest binding, and shape contracts fall back to a prototype-chain HasProperty check.

    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 toJSON half (needs exec/runtime/members.ts BUILTIN_BRAND_METHODS.URL — its host half 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 / closed facet(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.ts slot 类型 + 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 promise node tests instanceof Promise in both the library and the inlined copy, so a non-promise value is rejected instead of accepted.
    • BUG-031: litPredValue became litPredValues and recognises or(eq(...arm), ...), so a literal-union contract renders as 1 | 2 | 3 in the signature face, matching the dts face byte for byte.
    • BUG-087: showLits renders the type (3, "a") instead of leaking the contract DSL spelling (lit(3)) into signatures and slot displays.
    • BUG-092: predAsJs / termIsValue emit Number.isInteger(v) for a %1 === 0 predicate and compare field items by value, so nested numeric bounds agree across all four faces.
    • BUG-095: the arr branch uses Array.from(v).every(...) (holes filled with undefined), matching the standard face — [1, , 3] is no longer accepted by the guard.
    • BUG-097: a slot named like an Object.prototype own member is read with bracket access, so the guard compiles under tsc --strict (TS2367 gone).
    • BUG-098: the brand branch drops observed literals deeply, so a brand built from an observed /abc/i or new 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 FunctionDeclaration without an id).
    • BUG-158: an Arguments brand no longer emits an Array.isArray premise while keeping its length/index semantics, so the guard accepts arguments at runtime.
    • BUG-250: the guard declares const data: any when the contract carries an identity clause, so instanceof narrowing no longer blocks index reads (tsc --strict TS7053 gone).

    Also updates core-bug-348-lit-literal-signature.test.ts, which pinned the f(x: lit(1)) spelling that BUG-087 declares wrong, to the corrected f(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 (needs schema-generator.ts), BUG-108 / BUG-169 (need dts-generator.ts + schema-generator.ts), BUG-156 (needs schema-generator.ts), BUG-191 (needs dts-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 的 declaredParams case "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 透传 view facet(否则形参位会退回对象字面量);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 的 joinObjects facet 传递(objects.ts)。

  • 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:replace only 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:import line comment is now reported as misplaced (it previously fell into a silent continue).
    • BUG-283: @nudo:skip (and the @nudo:pure sibling) 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's throws annotation.

    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:mock scope degrades to file level when there is no same-name conflict) need core/src/algebra/generalize.ts (scopeSelectedInject / hasMocks), core/src/algebra/check-may-throw.ts (evalThrowsOutcome) and service/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(CJS module.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 测试随之复绿。
  • 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.ts BUILDERS 缺 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, 发一条 info nudo: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 头不变)。

  • 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 own nudo:internal output 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 铸造的内部 id inv#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)。

  • 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 mergeHarvestUnderEnv instead of object spread — so adding an unrelated @nudo:env line 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-unresolved like 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.

  • 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-mismatch false 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 with errorRecovery, 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 single commander/lib/command.js analysis 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-mismatch no 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 as arr ⊭ 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 report nudo:missing-export, transpileSource no longer emits export for 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), dedupe RUNTIME_IMPORT_RE, and share the new Function compile scaffold.
    • Dedupe the A/B call budgets and the two @nudo:pure memo 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 of runtime/async.ts.
  • 6ebf5a4: Evaluator engine correctness, host transpile cutover, and dedupe.

    • Fix Object.assign second-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 one performObjectAssign core. 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/returnType differences no longer fold to a wrong exact value. $copy snapshots 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 break const b = a alias identity across nested functions or shadowed blocks.

    • Make renameShape/snapshotAbs structure-preserving: tuple holes/rest, fn slots/optionalParams/ctor, obj slot symbolKey/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; strict is 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-only import * as ns now emits valid ESM.

    • Fix $set fail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of using undefined as a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on .shape.

    • Fix $switch implicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading to unknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-local let/const/function/class (including nested blocks, for heads and catch params) 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 false ReferenceError/never and an error-level nudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-block let no longer drops a legitimate sibling write from the fork set.

    • Module top level is now an alias-group scope boundary: const b = a at module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object.

    • Object.assign onto 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 phi stack (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 helpers alphaOf/betaOf, and generalizeAll. $staticInvoke also leaves the public surface (previously exported from . and ./exec): it is now engine-internal, still implemented for the check-may-throw class bridge. Retire dead internal language.ts exports (keep getClassChain/wrapPromise).

      Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from @nudojs/core / @nudojs/core/exec; $staticInvoke is no longer reachable from a host.

    • Rename exec/class-regex.ts to exec/regexp-runtime.ts to 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:

      1. 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024 IsCompatiblePropertyDescriptor 只在 current.[[Configurable]] 为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判;
      2. frozen 被当成 enumerable:false ⇒ Object.freeze 只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);
      3. 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒ defineProperty 把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落 configurable:true ⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen 不再改 enumerable;靶侧三标志 统一复用同文件 currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
    • 项目级 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 build exit 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);不传该集合时行为与旧版一致。
  • 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 段 ⇒ 消费方分不出「见证通过」与「见证 失败」。现在并入与 CLI nudo 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),与 CLI check --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 现在与 CLI nudo 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 等价通道):跨文件 调用点证据参与契约求解,接口面/草稿/落盘与 CLI nudo contract --from 同口径。 证据采集下沉到 service:新增导出 collectCallsiteRecords(+ 类型 CallsiteRecords)。
  • 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 没有 MemberExpression property 分支 ⇒ 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 test can 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 is opaque), the assertion verdict was binary: the case was reported as [FAIL], nudo:case-expected was raised, and the run exited 1. 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 an INFO (nudo:opaque-result, exit 0) on the nudo check face, 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 the nudo:opaque-result remediation path instead of claiming a type mismatch. The unchecked count in the assertions summary and in the --json payload now includes those cases, and a real mismatch is still reported as [FAIL] with exit 1.

  • 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 check OK / 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。修法:改用既有 helper termEquals(=== + 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):JSON display 带 #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 standard now 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 .ts extension, so every helper parameter and local was an implicit any: tsc --noEmit --strict reported a dozen TS7006 / TS7005 / TS7034 errors 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 the NudoSchemaNode / NudoIssue type aliases it needs.
    • Schema nodes were serialized with JSON.stringify, which has no notation for non-finite numbers: Infinity was silently written as null, so the exported validator rejected the value the function always returns and accepted a value it never returns — the opposite of the zod, guard and nudo check faces. Nodes are now written as source text, so Infinity, -Infinity and NaN survive; a bigint literal no longer throws Do not know how to serialize a BigInt, which used to abort the whole nudo export run 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), so act_a.validate({ a: 1, b: 2 }) rejected the correct argument and act_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.
  • 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-emit batch: 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 standard builds 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 default keeps its default form, and export * from / export { x } from re-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.ts entirely.
    • A contract that declares an optional parameter now reaches the product faces: the constraint's isOptional is carried explicitly (the entry Abs does not keep it), so the zod input object renders .optional() and the dts declaration uses x?: T.
    • nudo contract --emit renders 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 --write now exits non-zero when it refuses to overwrite a hand-edited draft. The file is left untouched (as before), but a silent exit 0 told CI that the draft had been regenerated.
    • nudo check --fix states explicitly when the fix did not turn the gate green but changed the diagnostic instead (for example the old constraint-violated became a new entry-may-throw). The previous message ("N residual error(s) remain") read as if the fix had worked.
    • nudo export no longer collapses a function's published type to a single frozen call site. A @nudo:case witness without an assertion observes one point; it is not a domain claim, so it must not own the return face. nudo test --freeze writes exactly such a witness, so freezing a call used to narrow the zod face to z.literal(3) and the guard face to data === 3 — a guard that rejects every legal call — while nudo check still reported number | string for 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 test classifies a case as synthetic by its source instead of by its name. A witness written by --freeze is 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 --emit removes 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.length was observed as the literal 1 of 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 wrote number.
  • 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 as nudo: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.ts loaded won every later same-spelled path. Each directory now resolves its own.
    • A package.json#nudo.env array holding a non-string element crashed the loader with name.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 when data.json sat right next to it, and import "./data" was accepted even when only data.js existed. The CommonJS and the ESM resolution rules are applied separately now: require follows the require condition and resolves extensionless paths, import follows the import condition and requires the extension.
    • A bare package with a conditional exports map always resolved to the CommonJS build, because the conditions were ordered with require first. The condition is now chosen by the kind of import.
    • node_modules was searched in one directory only. The search now walks up the tree the way Node does.
    • A package's own #imports mapping was not supported at all and produced no diagnostic, so the imported value silently collapsed to unknown. It is resolved now, and an unresolvable # specifier is reported.
    • A dependency that exists but cannot be read (EACCES and 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 as nudo:module-unreadable.
    • A .json dependency was loaded as JavaScript, failed, and was dropped without a word. Its value is imported now; invalid JSON is reported as nudo:json-invalid instead 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 在所有面上渲染一致,不再出现「一处保真、一处抹零」。

  • 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 undefined slot to keep the key present and keeps the real getter in a side table. The read path consults the side table, so o.ab reads 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.ts generator now take the read domain of the getter: the getter is evaluated with the object as receiver, a getter that throws projects to unknown, 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 writing o.x = 9 was reported as a definite TypeError. 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 of number().gt(0) while the equivalent if (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, a try block, a catch block or a finally block.
  • 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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • e424592: @nudo:mock-module now 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.ts and 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.
  • 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 to unknown. ctorParamCountOf treated the specifier statement as a declaration and dereferenced declaration.type on a null declaration, raising a TypeError inside the class-method bridge. The bridge swallowed the error in an empty catch {}, so the method signature silently degraded to unknown and picked up a misleading nudo:opaque-result diagnostic. Worst of all, a violated return-type contract on such a method was downgraded from an error to a warning, so nudo check exited 0 and 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 the export { … }; statement.
    • Bug 990 (core): collectAbsExports decided 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, and export { default } from "./m.js" invented a default export — the very existence of a default slot 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. bindImports also resolves import { default as d } from "./m.js" through mod.default, so it now matches import d from "./m.js" instead of binding unknown.
    • Bug 286 (service): call records for namespace member calls (ns.helper(…), both ESM import * as ns and CJS require) only carried the member name, never the receiver. The attribution side splits the callee name on a dot, so the split never happened: targetModule / targetExport stayed empty, the record was dropped by the matching side, and the error-level nudo:interface-domain-exceeds gate 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 CJS require binding is registered as a namespace import. Ordinary calls (local functions, named imports, host globals) keep their existing record names.
  • 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 test case values, nudo export dts, 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 an Abs with 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 into envGlobals before 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 (mocks through its own parameter, envGlobals carrying 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 no default slot. The import folded to unknown, every exported function of that file degraded to unknown, and the check reported a misleading nudo:unknown-inference warning (the binding was never connected; nothing failed to infer) while still exiting 0. Importing the very same module as import * 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:fs is the module object itself, with the named exports on it. The environment module table now carries that default slot (the namespace of the module) and marks the module as an interoperability module, and the default-import binding has a single source of truth: the default slot when present, the namespace for an interoperability module that has no default slot, unknown otherwise.
    • Ordinary user modules are untouched: a module table without a default slot still binds a default import to unknown rather 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 by nudo 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 already string would 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 and nudo check exited 0 — and nudo contract --emit --all replaced the handwritten contract with the observed values. A header now counts only when the comment starts with @generated and names nudo, and a section boundary stops at a const that the export does not reference. The legitimate generated shapes (the alias section, the composite downstream section with its prelude const, 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.
    • get and set members 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.
  • 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 the export default dts export-name fix, and by resolving a callee's @nudo:import sidecar against the callee's own directory). The pins exist so the fixed behaviour cannot silently regress.

    • A parameter whose contract is exactly lit(null) or lit(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. null and undefined are two distinct domains, so lit(null) rejects undefined and lit(undefined) rejects null. The pin also records that a bare literal contract (one eq atom) and a union / nullable contract (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 default shapes — named function, class, anonymous function and arrow — and asserts that the emitted export name is default in 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-load or nudo:contract-syntax diagnostic, and the call site still reports the real precondition violation.
  • 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 名书写顺序不同, 签名不同、门禁结论相反(OK vs FAILED: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 双报)完全保留。
  • 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/suggestCase failure paths now return isError: 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/hover validates its position arguments: a non-integer line / column is a tool error (previously the value was echoed back with every analysis field null, so "no hover here" and "my argument was the wrong type" were indistinguishable), and column now defaults to 0 so the documented { file, line, column, … } payload shape always holds.
    • 961 — nudo/whatIf validates its arguments: a missing target is a tool error (previously a fake success reporting Type of "undefined": unknown), a non-array bindings is a diagnosable tool error (previously a raw bindings.map is not a function), and a binding without name is rejected instead of silently doing nothing. injectBindings in @nudojs/service gained 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:env modules. Their output no longer depends on whether the file happens to be open in the editor (previously the same file and tool could answer never/unknown or 99 depending 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) — normalizeFilePath now rejects a non-string / empty / missing file with a diagnosable file is required … tool error instead of leaking a raw file.startsWith is not a function TypeError (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_FORKS still served the previous run's result. The effective value (environment variable, then package.json, then the default) is now part of the key.
    • An invalid nudo.check.entryThrows value was reported once per checked file. The warning is now printed once per distinct invalid value.
    • @nudo:as did 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-if attached 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.
  • 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 的写盘守卫)逐字同款;真正越出项目根的路径仍被 拒。
  • 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) ⇒ 一处修,两面同时保真。

  • 3432d8c: Two nudo test case-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, and never is the bottom element of the type lattice (never ⊑ anything always holds), so the structural check passed for every declared expectation. @nudo:case "t" (1) => 42 on a function that throws used to be reported as ✓ 1 passed with zero diagnostics. The judgement now carries a precondition: an observed never can never satisfy an expectation, so the case is reported as failed and nudo:case-expected is raised. The expectation text shown to the user is unchanged — a predicate expectation still renders as number (> 0).
    • The case-level nudo:may-throw warning ignored a declared, intentional throw. A throw declared with @nudo:case "t" (1) !! throws TypeError, @nudo:throws TypeError, or a sidecar fn(…, { throws: "TypeError" }) was accepted by nudo check (zero errors) but still reported by nudo 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.
  • 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 1e3 or "a\tb" therefore did not denote the value the user wrote, and the contract gate reported witness ⊭ contract for 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 --freeze wrote 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 check but invisible in the function census of nudo 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.
  • 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.ts guard 面 同款 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 的类名——这是产物形态的固有差异,不是口径分叉。

  • 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 a ReferenceError. The brands that are not globals are downgraded to z.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 new both dispatch to it.
  • 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 to nudo test, nudo export and nudo contract, although nudo check saw 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 under default — the lookup missed, the signature degraded to unknown, and a misleading nudo:opaque-result was 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:case on a class method was never evaluated, so the witness was always unknown and 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-load now.
    • A line-level directive (@nudo:as, @nudo:replace) inside a loop body, a try block, a switch case, 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 as nudo:directive-syntax.
    • A dependency module's own @nudo:as / @nudo:replace directives 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:mock of 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:mock lost the fact that it can or cannot be constructed, so new on it did not throw where it should have.
    • A @nudo:mock in its rejects form was modelled as returning never, which made any return contract vacuously true and wrote f(): never into the generated declaration file. It is modelled as a promise that never fulfills now.
    • A @nudo:pure directive never reached the function it marked, so the directive did nothing.
    • nudo:builtin-unknown reported 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-if binding naming a type Nudo cannot express was silently widened to any, while the report said the binding had been applied as written. It degrades to unknown now, and the report says what was actually injected.
  • b37321b: Project configuration is normalized once, and every product reads the same normalized value.

    • A nudo key 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 nearest package.json that contains a nudo key"), the package is treated as having no Nudo configuration, and a note on stderr says so.
    • A nudo key holding a falsy value (false / null / 0 / "") did not stop the search either, so a sub-package silently inherited the root package's check.ignoreThrows and nudo.env. Presence now stops the search, whatever the value is.
    • nudo.contract.autoBind was passed through verbatim. A non-boolean value made check and contract/export disagree — 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 to true with a note.
    • nudo.check.entryThrows with an invalid value printed "using error" while the gate actually used the value the profile preset selects. The note now names the value in effect.
    • nudo.cache: "" did not override NUDO_CACHE_DIR; an explicit empty string now means "off", like false does.
    • NUDO_MAX_FORKS with an invalid value fell through to nudo.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.maxForks and 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.env entry that is not an array, or an array with a non-string element, is reported instead of crashing the loader.
  • dde4b03: The .d.ts product now projects the module's export surface: export names, classes and re-exports.

    • export default function (…), export default (…) => …, exports.compute = … and const f = …; export { f } were dropped from the .d.ts product 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 as publicName, and export default function addOne is declared as export default function addOne. The local binding name is never mistaken for the export name.
    • A class is projected as a class: export class C { … } becomes export declare class C { … } with the constructor and the static methods inside it. The instance methods are no longer flattened into a module-level C_m export, 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.ts no longer fails to compile with TS2304: Cannot find name 'User'.
    • export * from "…" and export { x } from "…" are re-emitted, so the product's export surface matches the source module's.
  • dde4b03: nudo test --freeze now writes into the source file without disturbing the file's byte shape, and the diff it prints can be applied by git apply.

    • A UTF-8 BOM used to move into the middle of the file. The freeze writes the new @nudo:case block 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-width U+FEFF sitting in front of the export. 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 --check rejected it, because the diff did not say that the last line has no newline. The diff now follows the same line model as diff -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 diff produces), 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".
  • dde4b03: nudo contract no 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)). A lazy() slot is a thunk (a function), and JSON.stringify silently 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 printed any().optional(), and the cached surface was weaker than the nudo check gate for the same file. Constraints are now encoded with a dedicated codec: literals keep their type (bigint, ±Infinity, NaN, -0, undefined), and a lazy() 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.stringify cannot represent a bigint, so a contract with a bigint literal made the whole nudo contract command fail with a bare Do not know how to serialize a BigInt (exit 1, no file, no diagnostic code) while nudo check, nudo health and nudo test stayed 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 zzz printed (zzz: …) for a function whose parameter is x, while nudo check printed scale(x: any) for the same file. The printed parameter list now comes from the declared formal parameter list (the same source as the nudo check signature), 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.
  • dde4b03: Quickfix edits: the @nudo:throws annotation now lands on the declaration it belongs to, TS sidecars carry their builder import, and the nullish quickfix no longer swallows a contract's throws obligation.

    • The @nudo:throws annotation 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 --write emitted the contract DSL (fn({ x: shape({ toFixed: any() }) })) into a *.nudo.ts sidecar without any import: fn / shape were undeclared (TS2304) and any() collided with the TypeScript type keyword (TS2693), so the product failed tsc --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 throws obligation. The nullable(...) wrapper was applied to everything between the first top-level comma and the closing parenthesis of fn(...), which swallowed the third argument ({ throws: "Error" }). The gate then reported a different error (entry-may-throw instead of constraint-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.
  • dde4b03: nudo contract --emit no 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 @generated sections 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).

  • 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 as helper(x + 5, x + 1) anchored the return to the first parameter and wrote fn({ a, b }, a) — a return constraint of number().gt(5) for an implementation that only guarantees number().gt(1). The contract was stronger than the code, and nudo contract displayed 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 + 2 called once or twice now derives the same fn({ 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 const declarations of the same name with different values, which is not valid JavaScript.
  • dde4b03: nudo export --format dts now 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 appended arg1 / arg2 after 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), while nudo 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() or optNoEvidence(1) — both legal in the implementation — hit TS2554. 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.ts and rejected calls the contract allows (TS2345). The contract face now carries the optionality flag and the declaration renders x?: 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 and nudo check, and rejected values those four accept (TS2345 / TS2741). They are now rendered as the optional property k?: T, matching the ? already used for top-level parameters.
  • 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(推断失败)分面——前者渲染 成 TS any、后者才是 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 }(契约义务不再被静默作废)。
  • dde4b03: The Standard Schema face now enforces what its own type says, and its validate never 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 a rest slot.
    • 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 as undefined), 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 as undefined.
    • A brand node was accepted unconditionally, so mkDateOutput.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 with instanceof (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 fn node was accepted unconditionally, so a function-typed output validator passed 42 / null / "str" / {} while the zod face (z.function()) rejected all of them. A fn node 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 follows HasProperty semantics, minus the Object.prototype pollution keys (toString, constructor, …).
    • ~standard.validate threw a TypeError on a bigint or a circular object, because the issue message was built with JSON.stringify on the runtime input. Standard Schema v1 requires validate to 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: Infinity is reported as expected Infinity, got 0 instead of expected null, got null, matching the zod, guard and nudo check faces.
  • dde4b03: Emit products: the zod number schema 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 number primitive covers every JavaScript number, NaN and ±Infinity included, but zod's z.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 returning 0 / 0 was 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 unrefined number to the full domain (z.number().or(z.nan()).or(z.literal(Infinity)).or(z.literal(-Infinity))). A number that 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.ts is a TypeScript file, but the guard signature carried no type annotation (export function isUserOutput(data) { … }), so under tsc --noEmit --strict the parameter was an implicit any (TS7006) and the product could not be used in a strict project. The guards now take value: unknown and return boolean; 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 the dropped ledger. Literals that are certain (exact confidence) and literals coming from a hand-written contract keep their exact form.
  • dde4b03: nudo contract --emit now 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 (only fn(…) 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 @generated sections: the sections are replaced in place, so a refresh produces a content-only diff instead of a pure reordering (which made --exit-on-diff fail 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 --strict reported Cannot 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-denied message 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.
  • dde4b03: nudo contract --draft now 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 default therefore got the synthesized key _default, while the key that actually binds is default — copying the draft into *.nudo.js left the contract in place but inert, and nudo check stayed green on a call that violated it. The key is now the export identity (the same source as nudo contract --emit), and an unsafe binding name is emitted in the alias form const _nudo_N = …; export { _nudo_N as <identity> };.
    • The builder import and the generated export const <name> shared one module scope, so a function whose name is a builder name (number, lit, union, …) produced import { number } from "@nudojs/core" next to export const number = … — a parse-time SyntaxError: 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-dts draft.
    • 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 as not-projectable and 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) returning 1 | null was drafted as fn({ 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 the nudo check signature) and is not written when it does not cover it.
    • --draft --write overwrote a hand-edited *.nudo.draft.js without 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.
  • dde4b03: nudo test --freeze now writes call-site witnesses without disturbing the source file it writes into: the new @nudo:case block 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 function keyword's column instead of the declaration's. For export function greet(u) { … } the function node starts at column 7 (export default function at 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, so file(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 undefined elements. The hole of [1, , 3] carries the same abstract value as an explicit undefined element, 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 from false to true, 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.
  • 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 修好后旗标会翻红,提醒摘掉)。

  • 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

Patch Changes​

  • aae0f96: Fix stale-cache windows in cache keys and session eviction. nodeHarvestCacheKey floored mtimeMs to whole seconds (same-second, same-size rewrites of @types/node reused a stale harvest — now uses the raw float mtime, matching the repo-wide mtimeMs+size strict-equality contract). The path-env cache key/validation only compared mtimeMs (coarse-mtime filesystems could keep serving a stale defineEnv factory and re-register it, self-perpetuating — now mtimeMs+size, and the direct-import URL query carries size so the ESM module cache can't replay old content). The path-env fallback copy filename hashed only path: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, so pnpm install / watcher rounds see upgraded or newly installed @types without a process restart. checkMemoKey now normalizes filePath via stablePathKey (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 single statSync(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 on e.code: sidecar contracts unreadable for reasons other than ENOENT print a warning: cannot read sidecar contract … in check/check --fix (no more silent contract-blind green runs); @nudo:mock seed evaluation failures warn in export before degrading; pnpm-workspace.yaml read failures other than ENOENT abort migrate (a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read report read-failed with 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-dts path-like arguments that don't exist now error as path not found instead of being treated as npm package names ending in a misleading no .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.exclude supports real globs (fix-12 batch).

    • parser: file-level directives (@nudo:env / @nudo:mock-module) written inside JSDoc blocks emit nudo:directive-syntax with the correct /// form instead of being dropped silently.
    • service: nudo.analysis.exclude accepts glob patterns (shared compilePattern, 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.

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:skip no longer kills @nudo:case evaluation (#176) — the declared face and runtime ground truth are no longer a trade-off.

    • A skipped function keeps combinedAbs from its declared return face (dts/sidecar/draft consumers unchanged), while declared @nudo:case directives are evaluated and asserted as usual; nudo test prints the skip note and the case assertions in the same block (previously the cases vanished entirely: "no declared @nudo:case expectations")
    • nudo check behavior is byte-identical (caseMode none — no case evaluation, no synthesized entry@ for skipped functions)

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-truncated misattributing call-cycle truncation to "depth/size budget", and make nudo check --json budget stats see the B-path ($callNamed) truncation (issue #158):

    • enterCall / evalEnterCall now attribute a truncation reason — cycle (same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers or grow-style recursion) vs depth / calls (real budget exhaustion). The check diagnostic message, suggestion, structured action, and a new reason field 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 reports truncated:false alongside a nudo:recursion-truncated info: B-path counters are latched across execution sessions within one host entry and surfaced as evalCalls / maxEvalCalls / evalCallTruncated, plus cycleTruncated and a sorted reasons[] 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-reported nudo:fork-truncated).
    • The @nudo:budget quickfix (nudo check --fix / LSP code action) is no longer offered when the truncation reason is cycle; the reason is plumbed through check --json, the disk cache, LSP diagnostic data, and materializeAction.
    • Raising @nudo:budget on 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 own nudo:loop-truncated info with an honest message and suggestion (the call-budget knobs cannot lift a loop budget — @nudo:budget calls=/depth= does not apply), gets a loopTruncated flag in the check --json / health budget block (single-file and multi-file envelopes), and no longer offers the misleading @nudo:budget quickfix 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 Code nudo.inlayHints.parameters / Zed language-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

    • $nodoPos position 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-truncated opaque unknown into local-variable hovers (obj now shows the computed null | string | undefined).
    • const x = <non-call init> declarations record the bound Abs at the declarator-id position during hover replay (recordPositions only) — ternary/optional-chain/literal-initialized locals are hoverable (prop, q).
    • callTranspiledExportFullInner refines the called fn Abs returnType slot after a successful call (same policy as class method slots, display-only).
    • LSP hover: an arity-only fn Abs (empty returnType slot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature (node: nullable(astNode)) => null | string | undefined instead 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 host TypeError: Reduce of empty array with no initial value escaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades to unknown.
    • 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 like if (x >= 0) return x; console.log(x); return 1; under @nudo:contract return nonNeg.
    • extractImportEdges skips import edges whose target resolution throws ModuleReadError (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).
    • $copy snapshots 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 轮互为跨次陈旧命中。
    • findProjectConfig stat 错误分类:非 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-unresolved warning(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-unresolved warning(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 of any() — an any() 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. BodyReadField gains optional fields?: BodyReadField[]; shapeDslFromFields recurses.
    • core/scan: any actuals against a shape precondition are no longer nudo:constraint-violated errors — no info, don't guess, matching the scalar-pred channel ("any ≤ 任意目标") and the same function's unknown handling. Determined non-object and missing-field actuals still violate (controls pinned).

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-return null | number is provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings to unproven-return warnings instead of errors.

    #69 DX​

    • actionsForIssue kinds 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 empty shape({}).
    • L2 entry-may-throw suggestions 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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 Function on 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.of packs 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.profile in checkConfig (LSP parity)

    The CLI resolves nudo.check.profile (adoption → L2 warning, strict → error) but the service checkConfig — which the LSP uses for nudo-check diagnostics — only read nudo.check.entryThrows. In a project with "nudo": { "check": { "profile": "adoption" } }, nudo check printed nudo:entry-may-throw as a warning while the IDE showed it as an error.

    checkConfig now applies the same preset, with the same precedence as the CLI (entryThrows → profile → default error), and NudoConfig["check"] gains the profile field.

  • 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/service god package: harvest → @nudojs/harvester, IDE surface → @nudojs/lsp, emit products consolidated under @nudojs/service/emit.

    BREAKING for @nudojs/service subpath consumers:

    Removed subpathMigrate 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/service keeps ., ./analysis, ./evaluator, ./emit. The language server moves to @nudojs/lsp/server (bin nudo-lsp unchanged); @nudojs/lsp is now a side-effect-free library entry re-exporting the IDE surface.

    No dependency cycles: lsp → service, harvester stays independent of service. 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-level watch / harvest; flags --callsites, --output, --format zod, --dts, --emit-cases; API absToZodSchema; InferJson/serializeInferJson → CaseJson/serializeCaseJson; LSP agent tools nudo.infer / nudo.interface* and aliases → nudo.test / nudo.contract*; config key package.json#nudo.interface.* → package.json#nudo.contract.*. Root scripts infer/types/interface removed.
    • Primary verbs: check / test / contract / export / health / env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell @nudojs/nudojs follows @nudojs/cli majors.
    • L2: undigested may-throw on entry/export functions is nudo:entry-may-throw (default error). Configure with --ignore-throws / --entry-throws or package.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.
    • check always prints signatures on success; unconstrained entry params display as any (true unknown = inference failure + nudo:unknown-inference).
    • test prints every case including synthetic call@/entry@; only declared @nudo:case expectations affect exit. --freeze[=update] solidifies witnesses.
    • Flags: --from, export --format dts|guard|schema|standard|all (--dialect zod for schema), export --out. --json cannot 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.
  • 0e1432a: feat!: source contract directive is @nudo:contract only

    @nudo:refine and @nudo:interface are 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:interface with @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 精化.

Minor Changes​

  • P1–P3 engineering hardening (review follow-ups) — no product-face breaks

    • @nudojs/parser: export typed Babel AST narrowers (ast-guards.ts); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).
  • 279d73a: fix review gaps on the B-path migration (PR #34 follow-up):

    • inject pipeline: CheckOptions.inject is now threaded into generalize, L2 throws, the record channel, and drift recompute (previously CLI computed mocks/env/replacements but only modules reached core; @nudo:mock/env/replace sources were fail-closed unknown#opaque under checkSource). Memo keys use inject content fingerprint (stable across CLI's per-call object allocation). mode: "analyze" always wins; modules prefers opts.modules then inject.modules.
    • L2 class / CJS methods: explicit throw on class static methods and CJS object methods is no longer hard-coded as throws: never — NudoThrow/ReferenceError map to throws Abs (same as callTranspiledExportFull). $call records throw exits before returning never. L2 evaluation now seeds phi from checkSource.
    • freeIdentifiers: lexical scopes (nested params no longer pollute outer free set); non-computed ObjectMethod/ClassMethod keys are not free refs.
    • callBudgetKey: single defensive implementation for non-Abs args (B-run JS function args). $call compiled-body path now uses enterCall/exitCall (same budget as apply). Budget keys use fn object identity (stableCallId) instead of anon#N (false cycles across same-arity functions). MAX_TOTAL_CALLS unified at 20k.
    • method early-return (correctness): ObjectMethod / ClassMethod / property FunctionExpression bodies now go through transpileFnBodyStmts (early-return lift) + implicit return — previously if (c) return X; return Y silently always returned Y (false precision vs native).
    • collectors: setBCallCollector / setBAssignCollector / setMemberDiagCollector / setAbsTruncationCollector return the previous collector; nested call sites save/restore instead of nulling.

    User-visible notes:

    • Sources with @nudo:mock / @nudo:env / @nudo:replace get real B evaluation under nudo 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-derivation class-method roots stay fail-closed (no call-chain derivation) — intentional after ast-eval removal.
  • 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 and dropped notes.
    • Projection prefers core absToConstraint (parity for eq(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, vendor nudo).

    CLI:

    • nudo export --format schema [--dialect zod] → *.nudo.schema.<dialect>.ts
    • nudo export --format standard → <fn>.nudo.standard.ts (contract-first domains; joinAbs when no contract)
    • test --json stdout is one JSON document (cases only); check --json stays a separate command
    • --ignore-throws now merges with package.json#nudo.check.ignoreThrows (additive)

    LSP:

    • Gate codes (nudo:entry-may-throw etc.) keep Error and Warning under analysis.diagnostics=off|errors so IDE matches CLI when entryThrows=warning

    Docs/product copy:

    • Day1 sidecar example uses fn({ params }, returns?) (not bare number().gt(0) on a function export)
    • Help / generated markers use schema/standard and nudo 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:case is debug / nudo test only, and the T.* directive grammar is removed.

    • Directive type expressions accept constraint builders (number(), lit(), shape(), union(), array(), any(), …) and concrete literals only. Bare T.* parses as unknown; parseTypeValueExpr is no longer exported — use parseCaseArgExpr.
    • serializeCaseArg / --emit-cases emit builders (number(), union(…)) instead of T.*.
    • LSP typeExprToDirective emits builders (number(), union(…), any()).
    • CLI infer reports call-site facts (call@L…) and debug "name" witnesses with Observed: joins — not Case "…" / Combined: as the type product. Contracts stay on *.nudo.js / @nudo:refine.
    • Constraint builders accept concrete nested literals so directive grammar round-trips.

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/env now 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/env slot if you needed harvest's version; otherwise no code change. Conflicts emit a nudo:env-harvest-conflict warning 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-call onConflict), 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=off stays explicit and uncached. clearNodeHarvestCache() also drops not-found misses so a later @types/node install is visible in-process. nudo:env-harvest-conflict warnings point at the conflicting import specifier when found (file-level line 0 otherwise).
    • @nudojs/env (minor): events / stream / querystring; high-frequency util slots; Promise APIs only under fs.promises / node:fs/promises (callback-style fs.readFile etc. no longer pretend to return Promise). Optional Node params (path.basename ext, url.URL base) keep typed labels (ext?: string) but are not required slots — requiredFnArity skips ? / ....
    • @nudojs/core (patch): formatShape renders fn rest labels (...paths) and optional labels (options?) as ...name: T / name?: T. leqAbs fn arity uses required slots only (requiredFnArity skips ...rest / name?): src is assignable to tgt iff src.required ≤ tgt.required (TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). Pairwise paramTypes contravariance is unchanged.
    • @nudojs/lsp (patch): freeze inventory in public-api.ts (also exported as @nudojs/lsp/public-api); agent slash requests register from NUDO_AGENT_TOOL_NAMES; selectCase / getActiveCases are 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.0 after the next release, and prefer leaf-clean coverage counts (empty { } shapes are not leaf-clean) over raw resolved ratios.

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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

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: handleInterfaceEmit now passes agentToolDeps so workspaceRoots reach assertEmitTargetAllowed (was dead in production).
    • Emit fail-closed: empty workspaceRoots rejects; no ancestor-package.json authorization fallback; realpath blocks symlink escape; refuse writes under node_modules.
    • autoBind kill-switch complete: threaded through scan generalizeFromAst / same-file eiOpts; empty fromFile no 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 effectiveInterface memo in check; take*Since on memo hit/miss (no LSP diag theft); shift rejects non-finite offsets; @generated marker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
  • de47d84: Review fixes on feat/interface Phase 1:

    • autoBind kill-switch: analyzer's cross-file nudo:interface-domain-exceeds path now reads package.json#nudo.interface.autoBind (was silently ambient-loading sidecars when autoBind: false).
    • nudo check --callsites: inject usage-site call records so CI gate can surface nudo:interface-domain-exceeds (previously only reachable via analyze/interface paths).
    • Sidecar auto-bind coverage: localNamedExports accepts local export { x } / export { local as exported } list form (was declaration-only; silent miss for common style).
    • Directory targets: isNudoTargetPath excludes *.nudo.js / *.nudo.ts so check/infer/doctor no longer treat contract modules as source.
    • VS Code client: documentSelector includes TypeScript; file watcher covers **/*.{js,mjs,ts} (includes .nudo.ts sidecars).
    • LSP emit: failed interfaceEmit no longer claims "sidecar written" and skips the invalidation path.
    • UX: first --emit with empty default targets prints a --fn/--all tip; --fn/--all without --emit warn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
  • 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • Relational compare folds mixed concrete lits ("a" > 3 → false), so if (x > 3) does not join both branches for NaN inputs.
    • joinValues uses Object.is so join(NaN, NaN) stays NaN (NaN === NaN is false).
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]).
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead of call-site B-path nodes.
    • Param inlay no longer invents where x > 3 from if (x > 3) return x — only explicit @nudo:refine contracts show as preconditions.
    • Return inlay is a path summary with source param names: x + 1, x | x * 2 (not the refined number where x>3 | string | … dump).
    • Number range narrowing uses exclusive bounds (> 3, not integer-style >= 4).
    • Concrete if tests no longer narrow the tested value into a range (44 > 3 keeps x as 44).
    • True branch of x > k on unknown refines to number>… | string (JS ToNumber space).
    • flattenSum keys prim members by term/pred so number=A1>3 and number=A1*2 stay 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]), not only the agent object form.
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead 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:env actually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path $invoke implements string methods and filters union members, and collectAbsCallRecords merges 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 --version reads the real package version, and nudo check accepts 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:path etc.).
    • 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, evaluateProgram is skipped so TypeValue no longer double-reports.
    • CLI check / types / test accept directories; check uses an Abs-only gate.
    • LSP hover / getTypeAtPosition on capable files read the Abs node table; *.nudo.js edits evict L0 and recheck open parents.
    • Public core surface now re-exports the algebra API (Abs, check, generalize, exec, bridge, parseSource, stripTypes).
  • 5786fa5: Speed up repeated analysis with layered memos and tighter cache contracts.

    • Shared parse/AST LRU, generalizeFromAst L0–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.

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 .ts constructor annotation (including parameter properties) is now the instance field's domain, so constructor(private size: number) + area() { return this.size * this.size } reports number instead of an any-arithmetic nudo:entry-may-throw error while the dts face already said number;
    • definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero, in on 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-level const (false red) and destructured declarations reach the obligation check (false green);
    • a classic for (const i = 0; …; i++) head is a const again, so the always-throwing step is reported instead of staying green;
    • nudo:capability-denied joins the check-face diagnostic whitelist, so nudo check can report the cause of unknown like nudo test — gated on the report actually showing an inference failure (nudo:unknown-inference), so a plain module.exports = … file does not grow a warning about the module global while the same exports written as exports.x report nothing.
    • cross-file evidence from --from now resolves the default export name on both sides, so a renamed default import, import { default as g } and ns.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 from effectiveContract'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 for export 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>Input keys a destructured parameter by its field names rather than the internal _p0 placeholder, 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) alongside module.exports = value keeps the named-export projection (TS forbids export = next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than one return projects unknown instead 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 check entry 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.

  • 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:assume and @nudo:invariant accept 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. EffectiveContract carries a cross-slot binder table so fn({...}, array(ref("b"))) can reference a binder declared in a callback slot. Unbound refs fail closed (nudo:contract-load) and never degrade to any().
    • 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 / rel builders plus BinderTable and resolver helpers (public API snapshot updated).
  • ca8005b: ABS-02: explain where unknown / any came 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 or leqAbs change; 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:budget cannot help.
    • nudo check --explain-unknown prints the list after the human report; default output is byte-identical and --json / --gitlab machine contracts are unaffected.
  • 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 as export 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.ts JSDoc gains readable Contract: rows (sidecar expression text / constraint rendering). They are notes only — the type face still comes from Abs, and Case: 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/le bounds; new tests pin bounded output and the honest omission of non-expressible relations (x > y).
  • 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 of callSiteBudget by internal records.
    • When a function has both @nudo:case and call-site records, the default run keeps the mutual-exclusion report and prints a both-paths hint naming those functions, pointing at --both-paths (sources stay labeled: directive vs callsite). --json is unaffected; truncation reasons and their next actions keep flowing through the existing nudo:*-truncated diagnostics. Under --freeze the hint is suppressed: --both-paths combined with --freeze is a usage error, so the suggestion is not actionable in that run.
  • 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-inferred info 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:invariant declaration enters the proof (audited via nudo: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).
  • 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:case directives now can also synthesize call@/entry@ witnesses in the same round (teaching comparison face; default exclusivity unchanged). --json separates the paths via source: "directive" | "callsite"; exit semantics unchanged (synthetic cases never fail the run). --only without --both-paths, and --both-paths --freeze, are usage errors.
    • Signed disk cache: package.json#nudo.cache.sign: true + NUDO_CACHE_KEY signs 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.cache also accepts an object form { dir?, sign? }; typo'd keys surface as config-shape report entries.
    • truncation suggestions: fork/recursion-budget fix values in the analyzer now consume the single-sourced suggested{Fork,Depth,Calls}Ceiling helpers 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 in s1-perf-baseline-real.{md,json} with an honest corpus header).
  • 4fc7e19: Rename the remaining Nudo interface terminology to contract end to end.

    • Core: effectiveInterface → effectiveContract, InterfaceSource → ContractSource, InterfaceTierInfo → ContractTierInfo, interfaceTierOf → contractTierOf, takeInterfaceDiags* → takeContractDiags*, and the algebra/interface/ directory → algebra/contract/.
    • Service: emitInterface / draftInterface / interfaceSurface → emitContract / draftContract / contractSurface; interface-*.ts files → contract-*.ts; ifaceCacheKey → contractCacheKey and the disk-cache namespace iface → contract.
    • Diagnostics: nudo:interface-* → nudo:contract-* (no alias layer).
    • CLI/LSP: CodeLens titles ⚡ persist contract / ↻ update contract / ⚡ draft contract; agent messages no contract found / no contract changes; CheckIssue actions and hover/inlay fields use contractSource / contractDisplay / contractActive.
    • Docs, examples (contract-derivation/, contract-draft/), API snapshots, and website references updated.

    TypeScript's interface keyword, Babel AST TSInterface*, and historical release notes are intentionally unchanged.

  • 09d88d6: Feat: nudo init coexistence 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 command nudo.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.json block now ships semantic_tokens: "combined" inline (previously prose-only); Neovim lspconfig and Helix languages.toml blocks 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.md G4 status records it.
  • a9638c2: Feat: precision-cliff UX — nudo test call@symbolic hint + nudo health precision counts.

    • nudo test: when a report contains call@symbolic (the symbolic aggregate witness folded from call sites beyond callSiteBudget), the report tail now appends one actionable note (SYMBOLIC_BUDGET_NOTE, same "fact — action A or action B" shape as the nudo:recursion-truncated advice): raise package.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 without call@symbolic stay byte-identical.
    • nudo health: the Summary line and the --json summary (same source) now carry precision counts — unknownSignatures (functions whose return the engine could not infer; renders unknown, counted via the shared inferenceFailed predicate; @nudo:skip functions are declared faces and not counted) and widenedWitnesses (occurrences of #widened, i.e. witnesses with conf === "widened" — budget-folded symbolic aggregates / loop widening). Informational only, like uncovered: never gates the exit code. Text Summary reads … · N unknown signature(s) · M #widened witness(es); --json summary gains additive keys unknownSignatures / widenedWitnesses.
    • @nudojs/service exports SYMBOLIC_BUDGET_NOTE (single source for the note text; CLI and tests consume the same constant). Regressions pinned in packages/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 the writeSrcTsconfig convention, so they no longer silently test a stale dist/).

Patch Changes​

  • 67ece35: Add --capabilities strict|trusted to check, test and health (ABS-12 R12-D). strict (default, same as NUDO_CAPABILITIES=strict) hides side-effectful host globals and node: modules: values stay unknown, denied names report nudo:capability-denied, and the canary suite proves no socket/file/process side effects. trusted restores the legacy builtin-unknown surface 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 --watch incremental rounds by reusing the evaluator injection object per file across rounds and by memoizing dependency fingerprints within a round. checkMemoKey keys on moduleMapId(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, analyzeFile and 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 (total 929ms, 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 stableAnalyzeKeySource projection the entry file already used: trailing comments/whitespace that carry no @nudo directive no longer flip the dependency fingerprint (check disk keys, evaluator memo, generalize L0, per-fn memo), while real code, line shifts and @nudo directives still do. check --watch now 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 edit analyze 3313ms → 2597ms, leaf 1009ms → 875ms. A single dependent's analyzeFileAsync drops from ~663–734ms to 9.9ms after an inert dependency edit, while a semantic edit still misses (172ms). The residual watch cost is the check verb's own checkSource (~500ms/file, memo keyed by module-map identity), tracked as the next ABS-18 item. Pinned by load-deps-fp-stable.test.ts and abs18-watch-inert-eviction.test.ts.

  • 38eedd0: Fix the macOS /var → /private/var path-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 gives process.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 / derivedSidecarAllowed realpathed 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 shared normalizeRealPath from @nudojs/service, which falls back to realpath(dirname) + basename for 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 JSON file field and human-facing text (Bug 661 / 663 / 664 / 63b). New relFromCwd() 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. displayPathOf is 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 filterUnchangedWatchPaths saw it as unchanged and the edit was silently skipped until the next save. startWatch now filters FSEvents noise: macOS directory watchers report untouched files from the same batch, so changing a.js could also re-run sub/b.js and 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 testable watchPathVersion / filterUnchangedWatchPaths, covered by cli-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.

  • 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 regenerate benchmark/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 in benchmark/oss/packages.mts: debug and @changesets/cli crash on the analyze path (evaluating them clobbers host process.env / globalThis.Error — engine debt, not gate-threshold material), lodash blows the wall-clock budget, @babel/types crashes checkSource, and @babel/parser / @babel/traverse single-file bundles dominate a bench round. Benchmark-only change — no engine code touched.

  • 05b7b82: Chore: re-admit debug and @changesets/cli to 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 host process / 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/types stays excluded for wall-clock only (single ~3 MB bundle, one checkSource pass ≈ 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

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 → new core/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). scanWithStrings was dead after the move and is gone.
    • bigint operand predicates (isNullishLitOperand / isKnownNonBigintNumeric / isMaybeBigintOperand): surface.ts carried a forked copy of arithmetic/coerce.ts — its isMaybeBigintOperand lacked the Bug 946 arr/tuple arms and only stayed sound by accident of the catch-all throw. Single source in coerce; foldNumericBinOp now mirrors foldBigintBinOp's explicit arr/tuple hard-throw so 1n & [] still throws deterministically.
    • Bug 946 member-level fix (behavior): isMaybeCoercionThrowOperand now recurses into sum members and skips arr/tuple members — x & 1 / 1 - x with x: 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 + x on the same union still records may-throw: the number member genuinely throws).
    • collectNestedBodyRanges wiring completed: core exported it via @nudojs/core/internal and its comment claimed parser reuse, but parser still ran a full local copy. file-directives.ts now 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.
    • absShapeForTsTypeText via @nudojs/core/internal: service's tsAnnotationShape was 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.ts and interface-emitter.ts duplicated the export-statement → {names, bindings} extraction (31 lines) and stripSections (14 lines); both now share service/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.
  • 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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • 5769211: Dedup batch 5 (jscpd --min-tokens 70 audit 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.ts yield try-context bits (raw 1|4|8 / & 2 / ~(16|32|64) literals pinned by a "钉死同步" comment to runtime control.ts YIELD_* constants) → new zero-dependency leaf exec/yield-bits.ts; runtime (control.ts re-export removed, async.ts) and transpile (statement.ts) both import the named constants.
    • parser case-arg.ts TYPE_EXPR_CHAIN_METHODS hand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exports CONSTRAINT_CHAIN_METHOD_NAMES (public barrel, next to CONSTRAINT_BUILDER_NAMES); parity pinned by constraint-chain-methods.test.ts (method-face drift ⇒ CI red).
    • service builtin-prototype.ts BUILTIN_ERROR_CLASSES verbatim 8-name copy of core ERROR_CTOR_NAMES → imported via @nudojs/core/internal (the dead module-level re-export is removed; no public face change).
    • core promise.ts aggregateErrorAbs local error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated in eval-bug-293-promise-combinator-settle.test.ts (slot-key set / non-enumerable flags / inherited name vs errorBrandAbs).

    Whole-function twins single-sourced:

    • core builtins/error/binary.ts makeArrayBufferAbs / makeSharedArrayBufferAbs → parameterized makeBufferAbs (brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved).
    • core transpile/member-path.ts memberWriteIfe / memberWriteRootIfe → shared memberWriteIfeImpl (only real difference: return written value vs new root).
    • nudojs version.ts three walk-up-to-package.json loops → findPkgDirUpwards + readVersionAt.
    • nudojs migrate.ts planWorkflowRewrites → delegates to planWorkflowRewritesIn(findWorkflowDir(from)); readPackageJsonDetailed / readMarkerFile → shared readJsonObjectDetailed(path, label) (missing / invalid / unreadable / ok grading unchanged).
    • service emit/quickfix-edits.ts sidecarClearsEntryThrow / sidecarClearsConstraintViolation → shared sidecarClearsDiags(input, codes) (Bug 556 dual-code gate preserved).
    • core generalize.ts ctorParamCountOf / ctorFormalsOf twin class-ctor walkers → single ctorParamNodesOf walker (Bug 1031 null-declaration skip lives once; count still raw param length, formals still formalParamsFromNodes — the this-param skip semantics unchanged).
    • lsp server-commands.ts handleSelectCase / handleSelectContract ~20-line resolve→read→caseTargets→knownFunctionNames preamble → resolveCaseTarget (error strings byte-identical).
  • 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(CJS module.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 测试随之复绿。
  • 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.ts BUILDERS 缺 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, 发一条 info nudo: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 头不变)。

  • 250f0ba: Fix bug-report category 09 (nudo check gate) — 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.js no longer exits 0 with broken.js unchecked.
    • BUG-047: check --fix advances its plan text outside the --write branch, 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: --only values are validated against the diagnostic registry (unknown codes are a usage error; valid-but-unmatched codes are reported) instead of silently producing 0 edits.
    • BUG-049: a sidecar write failure is reported (check --fix cannot write <path>) instead of aborting the whole run with a bare EACCES.
    • BUG-066: --quiet is evaluated before --abs, so --abs --quiet prints one line instead of the full signature block.
    • BUG-067: --fix refuses to write a sidecar that would conflict with a sibling file (.js / .mjs, .ts / .mts) and names the sibling.
    • BUG-115: the --json envelope gains an unambiguous summary.pathErrors, so path failures are readable from the summary (the green shape is unchanged).
    • BUG-264: sidecarPathOf strips .d after .nudo, so a .d.ts source yields api.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 --gitlab always emits exactly one parseable array and --gha emits ::error.
    • BUG-285: GHA annotations move to stderr when GitLab owns stdout, so --gha --gitlab emits its ::error lines 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 (need migrate.ts, handed to the migrate category), BUG-262 (needs packages/lsp/src/validation.ts), BUG-056 (needs per-round module isolation; check still prints bump() => 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/* 经 package exports 解析到 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 表。已排除的无效方案(逐条实测):service evictAbsModuleCacheFiles / evictEvalCacheForFiles、core evictGeneralizeMemoForPaths、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 不一致(未动)。

  • 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 with Usage 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 > 0 is required before comparing).
    • BUG-038: a missing path now lands in pathErrors / targetErrors with summary.errors = 1 instead of being silently skipped.
    • BUG-039: contract drift counts @generated slots (Σ interfaceDrift) instead of files, so detail, summary and --json agree.
    • BUG-054: health honours --from (same externalAbsCallRecords source as check), so drift is no longer invisible when --from is used.
    • BUG-113: health --json emits 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)), so health and contract --emit --exit-on-diff agree on the same sidecar.
    • BUG-228: file-level @nudo:env is resolved with the two-baseDir layering that check uses, so check's nudo:interface-drift and health's "0 contract drift" no longer contradict each other.
    • BUG-229: nudo init rewrites 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 test witness line and the LSP agent-tools.ts observationTitle disagree on indentation/spacing) needs packages/lsp/src/agent-tools.ts, which is outside this category's file set; aligning run-test.ts#formatCaseLine alone would break test-entry-contract-note.test.ts.

  • d5b189d: Fix bug-report category 11 (nudo contract command 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 --emit and exits 1 with a usage error listing the available exports.
    • BUG-100: contract --from-dts no 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-run diffs match what is actually written and --exit-on-diff no 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 写出的 根侧车逐字节相同。

  • 8a22296: Fix bug-report category 12 (nudo export) — 11 defects.

    • BUG-016: the module identity used by --out is 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 all stdout 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 export publishes with caseMode: "none", i.e. the same domain as the check / health / migrate gate, instead of leaking @nudo:case debug 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 fields branch handles sum shapes symmetrically with prim.
    • 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 --out honours isSameModule, so re-exporting the same module overwrites in place rather than writing a .2 copy 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.ts with the default caseMode: "all", so nudo contract's printed interface can still include @nudo:case witnesses. 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:局部名不得成为具名导出)保留。
  • d4ab7fb: Fix bug-report category 13 (nudo migrate status / strip / verify / retire) — 20 of 21 bugs, plus two defects that were filed under other categories but live in migrate.ts.

    • BUG-234: migrate strip rewrites an enum's computed member references to E["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. A enumComputedMemberRewritten report flag records the rewrite.
    • BUG-050: strip refuses to write when a TS-only construct survives the stripper (namespace, import x = require(...)) instead of writing a .js that fails node --check/nudo check with exit 0.
    • BUG-226: migrate verify's env merge uses mergeHarvestUnderEnv (the check path), so harvest-only exports are no longer dropped ⇒ verify no longer reports unknown where check reports a precise type.
    • BUG-064: migrate verify resolves project-level env against the project root and file-level env against the file's directory, and surfaces env load errors as nudo:env-unresolved.
    • BUG-061: migrate verify installs the eval-fallback collector, so an internal analysis failure is an error-level nudo:internal (same code/severity as check).
    • BUG-114: migrate verify runs the strict, extension-aware parse first, so TS-only syntax inside a .js file is a per-file syntax-error instead of verify saying nudoOk: true.
    • BUG-015: migrate's ignoreThrows uses the same lenient parser as check.
    • 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 --all shares retireScope with the single-target path; a leftover migrate-retiring.json is recovered; a repeat run reports already retired with 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; status and retire share the same workflow scope; the product specifier is tried verbatim before candidate rewriting.
    • BUG-178: migrate status uses retire's gate/compiler split for blockers and reports a preserved field; 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}-* and core-bug-234-*.

    Known follow-up NOT covered here: BUG-017 (--json top-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 of cli-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)不变。

  • 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 report nudo:missing-export, transpileSource no longer emits export for 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), dedupe RUNTIME_IMPORT_RE, and share the new Function compile scaffold.
    • Dedupe the A/B call budgets and the two @nudo:pure memo 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 of runtime/async.ts.
  • 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 export now 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>Input without that parameter, while the .d.ts of 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.
  • 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 export now refuses to publish a projection that contradicts the contract, keeps the four product faces on one public-surface rule, and stops dropping @nudo:skip functions.

    • 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" (zod z.unknown()) — no message on stderr, exit 0. nudo export now reports the real nudo:interface-load diagnostic 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>Input whose key the function signature does not have. nudo export now reports nudo:interface-param-mismatch and exits 1 without publishing anything.
    • A contract whose conjunction is unsatisfiable (the source @nudo:contract contradicts the same-name sidecar) was projected with only half of the contract, producing a validator that can never pass. nudo export now reports nudo:interface-conflict and 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.ts was 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:skip functions 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.
  • 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 --out no 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.js and b/lib.js collided). 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 m methods 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.ts in the output directory was overwritten without a word, replacing precise types with unknown. nudo export now refuses to overwrite a file it did not generate (exit 1, nudo:path-io diagnostic) and leaves the file untouched.
    • When a write failed, the artifacts that had already been written were dropped from the output: stdout showed no wrote line 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 --out pointed at nudo check --out, an option that does not exist (error: unknown option '--out'). It now points at nudo export --out and says what to do.

    Artifacts written with --out carry 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 all stdout 撞名报错的脚本(现在能出文件了)。

    怎么迁移:重新生成产物并按新名 import(zod 面保持 <fn>Output / <fn>Input, standard 面在 --format all 合并流里是 <fn>OutputStandard);或分开导出 (--format zod 与 --format standard 各自成文件 ⇒ 名字不冲突)。

    nudo export to 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 standard to stdout repeated the whole __nudoCheck helper 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 with TS2393 / TS2300.
    • --format all to 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 with TS2451. 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 preds ledger 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 all shows one zod ledger and one Standard Schema ledger instead of the same title twice.

    Artifacts written with --out are unchanged: each dialect keeps its own file and its own product names.

  • 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 侧的本地副本, 改为 import io.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 红)。
  • e5b3f38: nudo migrate status --json 的机器面新增了可选字段 packageJsonError (畸形 package.json 的解析失败原因)⇒ 新增可选字段属增量变更(additive) ⇒ minor。

    nudo migrate status now reports the truth about a package: the nudo gate is detected from the command text, the dependency scope covers peerDependencies, .ts counts stop at workspace package boundaries, a tsc script blocks even when no .ts file is left, a broken package.json is reported instead of being read as "empty", and the blockers list 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 running nudo check . under a name like lint or typecheck2 was reported as having no gate — and the blocker never went away after migrate retire, which rewrites the script to npx 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 dependencies and devDependencies, so a package carrying typescript in peerDependencies was reported as typescript dep: no with no "typescript still in dependencies" blocker, while migrate retire on that same package did remove the dependency. All four dependency fields are now merged by one shared helper.
    • tsFiles / tsxFiles were 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 a tsc script and no TypeScript source left — exactly the case worth retiring — reported no blocker at all.
    • A package.json with a JSON syntax error was silently read as "no dependencies, no scripts", which nudo check contradicts. migrate status now reports the parse failure (in blockers and in the new packageJsonError field of the JSON face).
    • The — placeholder for "no blocker" leaked into the blockers string (1 tsc line(s) in .github/workflows; —) and into the JSON blockers array, 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 scripts entry whose value is null is valid JSON (npm reads it as "no command") but crashed migrate status with a bare Cannot read properties of null (reading 'split'). Non-string script values are now treated as "no command".
  • 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 在产物里 仍然生效 ⇒ 产物侧的契约面与源侧同强度。

    行为变更(请注意):

    1. 同 stem 的 .js 若不是 strip 产物(例如手写的旧模块、或被提交进仓库的 编译输出),现在被分析的是 .js 而不是 .ts ⇒ 源不再被门禁覆盖。要区分 「产物」与「同名的另一个模块」需要 strip 落一份产物清单(marker),本次未做。
    2. .mts / .cts 源(它们本身不是分析目标)的产物 .mjs / .js 现在 会被分析;改前这类产物被「同名源存在 ⇒ 跳过」规则连坐 ⇒ 该模块被分析 0 次(零覆盖)⇒ 现在补上。
  • e5b3f38: BREAKING: nudo migrate retire --all --json 的顶层 JSON 形状现在恒为 数组(此前随结果条数变化:1 个包 = 对象,≥2 个包 = 数组)。

    谁会坏:解析 nudo migrate retire --all --json stdout 的机器消费方 —— 单包时顶层从 { … } 变成 [ { … } ] ⇒ 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 check now 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-export as errors; nudo:module-cycle, nudo:module-depth, nudo:json-invalid, nudo:exports-unresolved as 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:env that wins over the harvested environment was invisible on the check face although the documentation lists it as a check warning. It is now reported as nudo:env-harvest-conflict (warning, so it does not block the gate).
    • --from now 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.
  • 02aa122: BREAKING: nudo contract --json 的顶层载荷形状从「一个对象」变成 「单元素数组」(目录形态此前是 N 份 JSON 首尾相接 ⇒ JSON.parse 直接抛)。

    谁会坏:解析 nudo contract --json stdout 的机器消费方 —— 单文件形态的顶层 从 { 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-root catch 只产 人类文本:单文件形态 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 永不为空)。
  • 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 --fn names no longer widen the write scope, the dry-run preview names the sidecar it would change, --json --emit now emits a machine payload, and --from-dts --write lands its draft next to the source .d.ts instead 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 @generated segment (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 existing skipped <fn> (not-an-export) channel — the same wording the LSP / agent face already uses.

    • Bug 662 — the --emit --dry-run preview named the source file. The preview said would update lib.js while the diff it printed was against lib.nudo.js. The label now names the sidecar, matching the diff header and the other two branches of the same command.

    • Bug 667 — --json --emit ignored --json. stdout was human text and the exit code was 0, so a machine consumer got unparseable output with no failure signal. --json --emit now prints one valid JSON document: the per-file machine record (file, sidecar, changed, written, skipped, issues, diff), shaped like the --json / --draft --json records and collected into the same aggregated array.

    • Bug 944 — --from-dts --write wrote 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 (same sidecarDraftPath convention as --draft --write), an existing draft with different content is not overwritten (the write is refused with an explanation and exit 1; override with NUDO_DRAFT_FORCE=1), the write goes through the same guarded writer as --draft --write (never the formal sidecar, never node_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 --write moves from the current working directory to the directory of the source .d.ts (for example types/index.d.ts now yields types/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 from node_modules are no longer written at all — copy the .d.ts into 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 test can 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 is opaque), the assertion verdict was binary: the case was reported as [FAIL], nudo:case-expected was raised, and the run exited 1. 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 an INFO (nudo:opaque-result, exit 0) on the nudo check face, 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 the nudo:opaque-result remediation path instead of claiming a type mismatch. The unchecked count in the assertions summary and in the --json payload now includes those cases, and a real mismatch is still reported as [FAIL] with exit 1.

  • 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 check OK / 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。修法:改用既有 helper termEquals(=== + 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):JSON display 带 #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-emit batch: 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 standard builds 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 default keeps its default form, and export * from / export { x } from re-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.ts entirely.
    • A contract that declares an optional parameter now reaches the product faces: the constraint's isOptional is carried explicitly (the entry Abs does not keep it), so the zod input object renders .optional() and the dts declaration uses x?: T.
    • nudo contract --emit renders 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 --write now exits non-zero when it refuses to overwrite a hand-edited draft. The file is left untouched (as before), but a silent exit 0 told CI that the draft had been regenerated.
    • nudo check --fix states explicitly when the fix did not turn the gate green but changed the diagnostic instead (for example the old constraint-violated became a new entry-may-throw). The previous message ("N residual error(s) remain") read as if the fix had worked.
    • nudo export no longer collapses a function's published type to a single frozen call site. A @nudo:case witness without an assertion observes one point; it is not a domain claim, so it must not own the return face. nudo test --freeze writes exactly such a witness, so freezing a call used to narrow the zod face to z.literal(3) and the guard face to data === 3 — a guard that rejects every legal call — while nudo check still reported number | string for 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 test classifies a case as synthetic by its source instead of by its name. A witness written by --freeze is 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 --emit removes 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.length was observed as the literal 1 of 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 wrote number.

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(不判红)。
  • 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) 必炸)。
  • 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。
  • 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-if now accepts name=type as well as name: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.ignoreThrows is parsed by the same parser as --ignore-throws (comma-separated, trimmed, bare string or array). The config side used a strict string[] 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 CheckJsonMulti envelope no longer counts --from path errors as analysis errors: summary.errors equals the sum of reports[].summary .errors equals the human-face count (the contract core asserts). Path errors stay in pathErrors[]; a non-empty pathErrors still means ok: false and exit 1.
    • nudo check --watch --from re-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.env with a non-array value is reported as a config-shape warning (file name + diagnostic code) in both the human and the --json face, 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 侧兜底。
  • 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 保持纯机器面)。
  • 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 check now explains mock-load failures with the suggestion that fits the failure, instead of one generic sentence.

    • A duplicate @nudo:mock-module declaration (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 check and nudo migrate verify now use the same helpers as the editor and agent surfaces, so all of them report the same suggestion for the same file.
  • 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 check and nudo health disagreed 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 as nudo:interface-entry-only.
    • nudo:mock-invalid was 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 --from pointed 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.json whose nudo key 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.js that 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 写出的 .js Node 解析不了: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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • 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:

      1. 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024 IsCompatiblePropertyDescriptor 只在 current.[[Configurable]] 为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判;
      2. frozen 被当成 enumerable:false ⇒ Object.freeze 只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);
      3. 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒ defineProperty 把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落 configurable:true ⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen 不再改 enumerable;靶侧三标志 统一复用同文件 currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
    • 项目级 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 build exit 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 check now sees assignments inside function bodies, judges generated segments against cross-file call sites, and points diagnostics at the offending directive.

    • nudo:assign-mismatch only 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 $assignRecord from 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-drift never 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 --from could not be judged stale. CheckOptions.from now 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-syntax and nudo:interface-conflict carried no position: the LSP drew the red squiggle at line 1 column 1 and nudo check --json reported issues[].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 --target prints a real return domain instead of ?.

    • A function type inside an array or a union is now grouped with parentheses. formatShape rendered an array of functions as (number) => number[], which TypeScript reads as "a function returning number[]" 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.ts renderer 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.
  • 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 by nudo 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 already string would 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 --json no 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 / pred unconditionally. 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 gave len#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[].display is now rendered with the same formatShape projection the terminal uses, so the machine face and the human face of one command agree: nudo check prints f() => number while --json used to report number = len#0 where len#0 ≥ 0 #path for the very same function. The confidence marker and the branch-join note are still available — through the conf field and the detail / abs fields.
  • 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 进入接口成员表并带 ctor facet(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 改写的前后内容。
  • e5b3f38: 族 16 修复 M6:Bug 566 568 569 582 589 593 —— migrate verify 与 nudo check 判定同源(文件筛选排除侧车/.d.ts、分析注入带模块图与 mock)、--json stdout 只放 JSON(人工报告走 stderr)、批量目标 per-file 隔离(语法错不再整批中止)、--with-tsc 基线真的加载 tsconfig 并按文件切分诊断、空目录判红(不再静默 exit 0)。

  • 169ed52: nudo check no 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.

    • --fix combined with --json / --abs / --gha / --gitlab / --watch / --verbose / --from / --what-if used 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: false plus a pathErrors entry carrying the machine code nudo:usage-error), and the process exit code is decided only by ok.
    • --dry-run combined with --write used 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.
    • --watch together with --json used to fall back to the human face and print a second, different report. The JSON face is now honoured in watch mode as well (jsonFace is an optional field, so the existing callers are unaffected).
  • 169ed52: nudo check --gitlab and the disk cache no longer lose or duplicate results.

    • --gitlab annotations 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 check and nudo check --fix now analyse the same program, and the gate no longer accepts TypeScript-only syntax in a .js file.

    • nudo check --fix fed the analyzer a different input set than nudo 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.
    • --fix also 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 .js file 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 check no 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 EACCES message. With --json the 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 a fix: hint.
    • The warning about an unknown package.json#nudo.check.profile always said using default strict, even when an explicit check.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 --fix printed 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 produced a//…). The diff now has a single header with a relative path, exactly like the sibling nudo test --freeze --dry-run output, and can be consumed by git 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 check reported 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 reports nudo:interface-load and turns red.
  • 169ed52: Two reported nudo check defects were already fixed by earlier releases; this change only adds regression pins that keep them fixed.

    • A string in package.json#nudo.env is 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.
  • 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 --from usage-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 one nudo:interface-domain-exceeds for 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 的写盘守卫)逐字同款;真正越出项目根的路径仍被 拒。
  • 02aa122: refactor(nudojs): nudo contract 的三个分支函数拆到同包内部模块(行为零变化)

    族 20 · S0(串行前置重构)。packages/nudojs/src/commands/contract.ts 里 按分支天然分块的三个函数,搬到同包内部模块:

    • runContractDraft → packages/nudojs/src/commands/contract-draft.ts
    • runContractEmit → packages/nudojs/src/commands/contract-emit.ts
    • runContractFromDts → 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 --json printed nothing at all. The Babel parse error escaped runTest up to the top-level catch, which printed only err.message (no path, no line:column, no source excerpt), and the --json serialization point sat after the throw ⇒ stdout was 0 bytes and JSON.parse(stdout) threw. nudo test now reuses the syntax-error branch of nudo check: the human face gets a tsc-style block (path + line:column + source excerpt + ^ caret) and the --json face gets the same CaseJson envelope as every other failure, with pathErrors[{code:"syntax-error"}].
    • Bug 652 — nudo test --abs exited 1 on a file that declares no function, while the same command without --abs exited 0. The --abs face borrowed runAbsView, which treats "this file has no functions" as a usage error (Function not found + exit 1) — that is the intended behaviour of nudo check --abs (Bug 669) and is left untouched. Inside nudo test the 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-diff was silently ignored without --freeze. The precondition check lived inside the if (opts.freeze !== undefined) branch ⇒ without --freeze the 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-diff without --freeze is a usage error (exit 1) — the same stance nudo contract --exit-on-diff takes.
    • Bug 654 / Bug 656 — --help promised --freeze modes update | add, but --freeze=add was 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 --abs swallowed the whole diagnostics section. The predicate that decides whether diagnostics are printed excluded the --abs face ⇒ a wrong expectation (=> 42x) produced zero hints on screen while the assertion failed. --abs no longer excludes diagnostics, so the default, --json and --abs faces report the same number of diagnostics for the same file. nudo check --abs keeps its existing shape.
    • Bug 957 — --json usage errors produced an empty stdout plus a non-zero exit. Every usage-error branch of nudo test (missing path, --json + --abs, --json with several files, --freeze + --json, the variadic --from swallow) 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---json face is unchanged.
  • 3432d8c: nudo test --watch no longer swallows a failed file, and nudo test --from no longer lets an unresolvable import pass silently.

    • Bug 926 — nudo test --watch kept the gate green when a file failed to analyze. The shared watch loop (startWatch, used by the check / test / health watch 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 --watch and the non-watch nudo test all 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 no call@ record, fell back to entry@, 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 as nudo: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.
  • 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-expected error ⇒ 报告自相矛盾)。
    • 同一形状的 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

Patch Changes​

  • 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every existsSync(p) && statSync(p) double call (TOCTOU race + errno swallowing) with a single statSync(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 on e.code: sidecar contracts unreadable for reasons other than ENOENT print a warning: cannot read sidecar contract … in check/check --fix (no more silent contract-blind green runs); @nudo:mock seed evaluation failures warn in export before degrading; pnpm-workspace.yaml read failures other than ENOENT abort migrate (a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read report read-failed with 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-dts path-like arguments that don't exist now error as path not found instead of being treated as npm package names ending in a misleading no .d.ts files found.
  • 9a3d6e7: Stop silently swallowing business-Promise failures. nudo check/test --watch incremental 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) and handleNudoDepFileChanged (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 init and onboarding (fix-12, 20-point TS-parity batch).

    • export --format dts consumes contract faces through the same effectiveInterface source as check — non-exported top-level functions no longer leak into .d.ts; evidence-less params stay unknown with a stderr note.
    • health budget line no longer contradicts check: 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 --fix no longer writes non-fixing contracts: array-method receivers synthesize array(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 / --profile adoption); gate exit code unchanged.
    • nudo.test.profile typos warn on stderr; syntax-error files print tsc-style blocks (path:line:col + excerpt + caret), --json folds them into pathErrors.
    • nudo test annotates entry@ fallback cases on contracted functions.
    • TTY colors for severity markers / section headers (NO_COLOR master switch, FORCE_COLOR override, piped output stays plain); check --quiet suppresses signatures; check --help flags grouped (Common/Observation/Fix/CI/What-if); contract --draft emits 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:skip no longer kills @nudo:case evaluation (#176) — the declared face and runtime ground truth are no longer a trade-off.

    • A skipped function keeps combinedAbs from its declared return face (dts/sidecar/draft consumers unchanged), while declared @nudo:case directives are evaluated and asserted as usual; nudo test prints the skip note and the case assertions in the same block (previously the cases vanished entirely: "no declared @nudo:case expectations")
    • nudo check behavior is byte-identical (caseMode none — no case evaluation, no synthesized entry@ for skipped functions)

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-truncated misattributing call-cycle truncation to "depth/size budget", and make nudo check --json budget stats see the B-path ($callNamed) truncation (issue #158):

    • enterCall / evalEnterCall now attribute a truncation reason — cycle (same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers or grow-style recursion) vs depth / calls (real budget exhaustion). The check diagnostic message, suggestion, structured action, and a new reason field 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 reports truncated:false alongside a nudo:recursion-truncated info: B-path counters are latched across execution sessions within one host entry and surfaced as evalCalls / maxEvalCalls / evalCallTruncated, plus cycleTruncated and a sorted reasons[] 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-reported nudo:fork-truncated).
    • The @nudo:budget quickfix (nudo check --fix / LSP code action) is no longer offered when the truncation reason is cycle; the reason is plumbed through check --json, the disk cache, LSP diagnostic data, and materializeAction.
    • Raising @nudo:budget on 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 own nudo:loop-truncated info with an honest message and suggestion (the call-budget knobs cannot lift a loop budget — @nudo:budget calls=/depth= does not apply), gets a loopTruncated flag in the check --json / health budget block (single-file and multi-file envelopes), and no longer offers the misleading @nudo:budget quickfix 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

    • $nodoPos position 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-truncated opaque unknown into local-variable hovers (obj now shows the computed null | string | undefined).
    • const x = <non-call init> declarations record the bound Abs at the declarator-id position during hover replay (recordPositions only) — ternary/optional-chain/literal-initialized locals are hoverable (prop, q).
    • callTranspiledExportFullInner refines the called fn Abs returnType slot after a successful call (same policy as class method slots, display-only).
    • LSP hover: an arity-only fn Abs (empty returnType slot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature (node: nullable(astNode)) => null | string | undefined instead 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)),函数表达式/对象方法在 $fnVal apply 钩子按 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 路径不变。
  • 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-unresolved warning(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-unresolved warning(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-return null | number is provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings to unproven-return warnings instead of errors.

    #69 DX​

    • actionsForIssue kinds 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 empty shape({}).
    • L2 entry-may-throw suggestions 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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 Function on 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/service god package: harvest → @nudojs/harvester, IDE surface → @nudojs/lsp, emit products consolidated under @nudojs/service/emit.

    BREAKING for @nudojs/service subpath consumers:

    Removed subpathMigrate 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/service keeps ., ./analysis, ./evaluator, ./emit. The language server moves to @nudojs/lsp/server (bin nudo-lsp unchanged); @nudojs/lsp is now a side-effect-free library entry re-exporting the IDE surface.

    No dependency cycles: lsp → service, harvester stays independent of service. 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/cli into nudojs — one install unit for the nudo command.

    • nudojs is now the full CLI (check / test / contract / export / health / migrate), with bin: nudo and the previous @nudojs/cli dependencies. nudo --version prints nudojs <ver> (+ @nudojs/core <ver> when resolvable).
    • @nudojs/cli is a deprecated migration stub that forwards nudo and the module entry to nudojs and prints a deprecation line on stderr. Prefer npm 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/cli
    npm i -g nudojs # same `nudo` bin

    import "@nudojs/cli" / npx @nudojs/cli keep working via the stub for one beta cycle.

1.0.0-beta.0​

Major Changes​

  • 0e1432a: feat!: source contract directive is @nudo:contract only

    @nudo:refine and @nudo:interface are 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:interface with @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 精化.
  • 8db7320: feat!: remove env harvest from the product CLI face

    Harvest is not a user task. Product verbs are check / test / contract / export / health.

    • BREAKING: nudo env harvest (and the env command group) is removed. Third-party @types still auto-fill during analysis via module-graph harvest; env-package generation stays available as the @nudojs/harvester library.
    • Handwritten @nudojs/env remains the fixed product env (es / web / node) and still wins over harvest on overlapping modules/exports.
    • Scripts that called nudo env harvest should either rely on analysis auto-fill or call harvestDts / emitEnvModule from @nudojs/harvester directly.

Patch Changes​

  • P1–P3 engineering hardening (review follow-ups) — no product-face breaks

    • @nudojs/parser: export typed Babel AST narrowers (ast-guards.ts); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).
  • 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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

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 nudo to nudojs. The installed command remains nudo (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.

    parseSource already 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. Threading filename from analyzeFile, transpileModule/runTranspiled, the abs module graph, load-deps fingerprints, directive extractors and localNamedExports drops 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% (checkSource path 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 → new core/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). scanWithStrings was dead after the move and is gone.
    • bigint operand predicates (isNullishLitOperand / isKnownNonBigintNumeric / isMaybeBigintOperand): surface.ts carried a forked copy of arithmetic/coerce.ts — its isMaybeBigintOperand lacked the Bug 946 arr/tuple arms and only stayed sound by accident of the catch-all throw. Single source in coerce; foldNumericBinOp now mirrors foldBigintBinOp's explicit arr/tuple hard-throw so 1n & [] still throws deterministically.
    • Bug 946 member-level fix (behavior): isMaybeCoercionThrowOperand now recurses into sum members and skips arr/tuple members — x & 1 / 1 - x with x: 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 + x on the same union still records may-throw: the number member genuinely throws).
    • collectNestedBodyRanges wiring completed: core exported it via @nudojs/core/internal and its comment claimed parser reuse, but parser still ran a full local copy. file-directives.ts now 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.
    • absShapeForTsTypeText via @nudojs/core/internal: service's tsAnnotationShape was 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.ts and interface-emitter.ts duplicated the export-statement → {names, bindings} extraction (31 lines) and stripSections (14 lines); both now share service/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.
  • 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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • 7d7abe4: Dedup batch 4 (jscpd --min-tokens 70 audit 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 → core formatEntryParamShape via @nudojs/core/internal (the old comment claimed "core adds no export"; the internal face is the sanctioned route).
    • lsp server-code-actions norm/resolveRel copy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) → @nudojs/service/emit exports normPosixPath / resolveRelativeSpec; the lsp-only extensions stay at the call site.
    • standard-schema brand ctor list: GLOBAL_BRAND_CTOR_NAMES local array + Set → schema-generator RUNTIME_GLOBAL_CTOR_NAME_LIST (single array source; Set + isRuntimeGlobalCtorName predicate derive from it; the embedded validator serializes the same array, byte-identical).

    In-file twins single-sourced:

    • core hof.ts: predUsesMappedVars / mapHasShapeOnlyVar → parameterized predAnyVar walker.
    • core scan/literal-shapes.ts: 21 structurally identical constraintViolated issue 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.all dual reject faces → allRejectFace.
    • core check.ts: handwritten return-contract recording block (skip branch + main branch) → recordReturnContract.
    • core leq.ts/postcondition.ts: duplicate primOf single-sourced in leq.
    • core builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) → taOwnKeysTuple; gOPD class/Error/.prototype slot→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/$forOf applyExitJoin closures → new pure loop-exit-join.ts applyLoopExitJoin (the discovered exhausted && widen gate difference is an explicit parameter; $forOf passes exhausted: true, provably equivalent).
    • core directive-scan.ts ↔ parser fn-directives.ts: CASE_TAG_REGEX scan loop → core iterCaseTags(text, caseArgSpans) via @nudojs/core/internal (Bug 978 diagnostic actions and downstream regexes stay consumer-side).
    • service dts-generator.ts: DtsClassMemberSurface base interface — scanClassSurface return type no longer re-declares the member fields (BUG-168/151 docs live once).
    • lsp: replay.ts async env-preload twins share preloadEnvsThen, function scope walkers share walkFnScope; server-navigation.ts references/rename share the gate+parse prologue; hover.ts generalize blocks share tryGeneralizeEnclosing.

    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).

  • 5769211: Dedup batch 5 (jscpd --min-tokens 70 audit 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.ts yield try-context bits (raw 1|4|8 / & 2 / ~(16|32|64) literals pinned by a "钉死同步" comment to runtime control.ts YIELD_* constants) → new zero-dependency leaf exec/yield-bits.ts; runtime (control.ts re-export removed, async.ts) and transpile (statement.ts) both import the named constants.
    • parser case-arg.ts TYPE_EXPR_CHAIN_METHODS hand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exports CONSTRAINT_CHAIN_METHOD_NAMES (public barrel, next to CONSTRAINT_BUILDER_NAMES); parity pinned by constraint-chain-methods.test.ts (method-face drift ⇒ CI red).
    • service builtin-prototype.ts BUILTIN_ERROR_CLASSES verbatim 8-name copy of core ERROR_CTOR_NAMES → imported via @nudojs/core/internal (the dead module-level re-export is removed; no public face change).
    • core promise.ts aggregateErrorAbs local error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated in eval-bug-293-promise-combinator-settle.test.ts (slot-key set / non-enumerable flags / inherited name vs errorBrandAbs).

    Whole-function twins single-sourced:

    • core builtins/error/binary.ts makeArrayBufferAbs / makeSharedArrayBufferAbs → parameterized makeBufferAbs (brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved).
    • core transpile/member-path.ts memberWriteIfe / memberWriteRootIfe → shared memberWriteIfeImpl (only real difference: return written value vs new root).
    • nudojs version.ts three walk-up-to-package.json loops → findPkgDirUpwards + readVersionAt.
    • nudojs migrate.ts planWorkflowRewrites → delegates to planWorkflowRewritesIn(findWorkflowDir(from)); readPackageJsonDetailed / readMarkerFile → shared readJsonObjectDetailed(path, label) (missing / invalid / unreadable / ok grading unchanged).
    • service emit/quickfix-edits.ts sidecarClearsEntryThrow / sidecarClearsConstraintViolation → shared sidecarClearsDiags(input, codes) (Bug 556 dual-code gate preserved).
    • core generalize.ts ctorParamCountOf / ctorFormalsOf twin class-ctor walkers → single ctorParamNodesOf walker (Bug 1031 null-declaration skip lives once; count still raw param length, formals still formalParamsFromNodes — the this-param skip semantics unchanged).
    • lsp server-commands.ts handleSelectCase / handleSelectContract ~20-line resolve→read→caseTargets→knownFunctionNames preamble → resolveCaseTarget (error strings byte-identical).
  • 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:replace only 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:import line comment is now reported as misplaced (it previously fell into a silent continue).
    • BUG-283: @nudo:skip (and the @nudo:pure sibling) 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's throws annotation.

    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:mock scope degrades to file level when there is no same-name conflict) need core/src/algebra/generalize.ts (scopeSelectedInject / hasMocks), core/src/algebra/check-may-throw.ts (evalThrowsOutcome) and service/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.assign second-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 one performObjectAssign core. 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/returnType differences no longer fold to a wrong exact value. $copy snapshots 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 break const b = a alias identity across nested functions or shadowed blocks.

    • Make renameShape/snapshotAbs structure-preserving: tuple holes/rest, fn slots/optionalParams/ctor, obj slot symbolKey/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; strict is 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-only import * as ns now emits valid ESM.

    • Fix $set fail-closed on nullish/non-Abs receivers: the host-write handler now reports hits explicitly instead of using undefined as a sentinel, so a write to a non-Abs receiver returns that receiver instead of crashing on .shape.

    • Fix $switch implicit no-match arm: it no longer contributes an empty yield collector, so single-arm switches keep precise generator element types instead of degrading to unknown. The switch-level snapshot/join set is pinned to outer bindings only: arm-local let/const/function/class (including nested blocks, for heads and catch params) 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 false ReferenceError/never and an error-level nudo:entry-may-throw). Block-scoped declaration shadowing is now per statement list rather than a recursive union, so a nested-block let no longer drops a legitimate sibling write from the fork set.

    • Module top level is now an alias-group scope boundary: const b = a at module scope keeps its alias identity across a top-level fork instead of leaving one name on the pre-fork object.

    • Object.assign onto 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 phi stack (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 helpers alphaOf/betaOf, and generalizeAll. $staticInvoke also leaves the public surface (previously exported from . and ./exec): it is now engine-internal, still implemented for the check-may-throw class bridge. Retire dead internal language.ts exports (keep getClassChain/wrapPromise).

      Migration: every removed name was a dead engine internal with no product-surface consumer — drop the imports from @nudojs/core / @nudojs/core/exec; $staticInvoke is no longer reachable from a host.

    • Rename exec/class-regex.ts to exec/regexp-runtime.ts to 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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • 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:

      1. 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024 IsCompatiblePropertyDescriptor 只在 current.[[Configurable]] 为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判;
      2. frozen 被当成 enumerable:false ⇒ Object.freeze 只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);
      3. 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒ defineProperty 把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落 configurable:true ⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen 不再改 enumerable;靶侧三标志 统一复用同文件 currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
    • 项目级 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 build exit 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:import is ignored instead of taking effect, and an empty @nudo:import payload 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 returned undefined. 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 raises nudo:directive-syntax instead of vanishing.
    • @nudo:env node web was 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:env tag did not even match the tag regex. Both forms were discarded with no diagnostic, so no environment was loaded and everything stayed unknown. Commas and whitespace are now both accepted (trailing comments are stripped), and a bare tag raises nudo:directive-syntax.
    • @nudo:import inside 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:import with 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 raises nudo:contract-syntax.
  • e424592: @nudo:case witnesses no longer evaporate in silence: an escaped quote in an argument no longer swallows the whole case, the => expected part is read on CRLF sources, on the next line and behind a !! throws suffix, redundant brackets around the expectation are stripped, and a glued @nudo:case"name" tag is diagnosed instead of vanishing.

    • @nudo:case "k" ("a\"b") => 3 was 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 by nudo test stays the same.
    • => expected was lost in a CRLF source file. The line was split on \n and the trailing \r stayed in the expectation text, so the expectation failed to parse and was dropped: the case became [unchecked], the assertion never ran, nudo test exited 0 and 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 text 1 !! throws was parsed and rejected. The suffix is now stripped from the expectation expression only — the case line itself is never rewritten, so the function-level !! throws declaration 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 as nudo:directive-syntax instead 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 and nudo test ran no case at all. Both sides now share one grammar, and the glued form is reported as nudo:directive-syntax, the same way a glued @nudo:mock name is.
  • e424592: Malformed @nudo: directives are diagnosed instead of evaporating in silence: an empty or glued @nudo:assume / @nudo:invariant / @nudo:contract / @nudo:throws now raises a syntax diagnostic, and a !! throws suffix is only read where it is actually a directive.

    • @nudo:assume with 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 a nudo:unproven-return whose text blamed inference precision instead of the rejected lemma. An empty or glued @nudo:assume / @nudo:invariant now produces a bad segment and raises nudo:assume-invalid / nudo:invariant-invalid; a glued or empty @nudo:contract / @nudo:throws raises nudo:contract-syntax / nudo:directive-syntax. The strict grammar is unchanged — a tag still needs a separating space — the loose forms are only reported.
    • !! throws was 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, filterGateThrows let them all through, and the nudo:entry-may-throw gate was silently switched off while the signature still printed throws TypeError. The suffix is now only read where it is a directive: after the argument list of a @nudo:case line, 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 raises nudo:directive-syntax. The @nudo:as side keeps the behaviour already merged for Bug 842: a tag whose name is extended (@nudo:asXYZ) is not an @nudo:as directive and stays silent.
  • 27cc16a: @nudo:case witnesses 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. Since unknown is 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, so 1e3 is 1000, 0x10 is 16, 0b101 is 5, 0o17 is 15, 1_000 is 1000, .5 is 0.5 and 5. is 5.
    • A legacy octal literal was read as decimal (Number("017") is 17), while sloppy-mode JavaScript reads it as octal (017 is 15). 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 with 8 / 9 keeps 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 into unknown and are now recognized.
    • An expected value that cannot be parsed was folded into the same unknown Abs as an explicit unknown, so leqAbs(actual, unknown) always held and the assertion was vacuously true: the report said "1 passed" and the command exited with 0. A parse failure is now distinct from an explicit unknown: it is reported through the existing nudo:directive-syntax channel and the assertion fails instead of passing. An explicit unknown / any keeps its meaning of "not constrained".
  • 27cc16a: String literals in @nudo:case / @nudo:skip / @nudo:mock now 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 string a\tb (with a literal backslash) instead of a<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 reported witness ⊭ contract for 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 string a" + "b — a value nobody wrote. The expectation of a case, a case witness, the declared return type of @nudo:skip and the payload of @nudo:mock all 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:skip and @nudo:mock share it.
  • 27cc16a: @nudo:case / @nudo:mock payloads 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 existing nudo:directive-syntax channel.
    • An object literal property without a top-level colon (a getter, a method shorthand or a shorthand property) was silently dropped, so a @nudo:mock payload 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 a nudo:directive-syntax diagnostic.
    • The optional flag of a shape({ … .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 reported expected text did not show ?. The flag is now projected into the slot, matching the contract (sidecar) face of the same grammar.
  • 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:mock tag pattern, so a correct file produced a fabricated nudo:directive-syntax warning ("Malformed @nudo:mock …"). The mock tag now requires a name boundary that excludes the - suffix of the file-level family.
    • @nudo:mock with 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 through nudo: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 from f() => number to f() => any — an any leak 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:case expectation with a trailing comment (=> string() // the result is a number) failed to parse and fell back to an explicit unknown, which satisfies every expectation — the assertion was silently voided and the command reported "1 passed" with exit code 0. The trailing comment is now stripped before the expectation is parsed.
    • A malformed @nudo:case did not register an argument-region mask, so @nudo:mock / @nudo:skip written 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-module written 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 through nudo:directive-syntax, while top-level positions (file header, export line, 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.
  • 27cc16a: Inline directives and mock payloads keep their meaning: an @nudo:as payload is no longer dropped when it is written without a separating space, a trailing comment no longer turns a valid type into unknown, an inline mock keeps its async flag 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:as on 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:as directive, 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 to unknown — 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 + 1 lost its async flag during parsing, so the mock was modelled as a synchronous function and the call site f(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 the async flag.
    • 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 said never. 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

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.exclude supports real globs (fix-12 batch).

    • parser: file-level directives (@nudo:env / @nudo:mock-module) written inside JSDoc blocks emit nudo:directive-syntax with the correct /// form instead of being dropped silently.
    • service: nudo.analysis.exclude accepts glob patterns (shared compilePattern, 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.
  • 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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; split keeps 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 exact true when the value may be NaN
    • JSON.stringify of top-level function/symbol returns the JS undefined value
    • NaN literal identity uses SameValue (assignment/leq), not ===
    • drop unsound x*0=0 / x+0=x algebra identities (NaN/-0/string domain)
    • n % 0 folds to NaN; x % k bounds only for finite dividends
    • 0n is falsy; Number.is* fold non-number lits to false; global isNaN coerces
    • string index methods (charAt/slice/…) honor ToNumber and default args
    • unary minus and parseInt/parseFloat honor 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, not undefined lit

    fix(parser): directive scanners (splitTopLevelArgs / colon / arrow / balanced parens) respect string literals.

    Review follow-ups folded in: split(undefined) special case, indexOf returns number shape on abstract receivers, Math method allowlist.

  • 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); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).

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:case is debug / nudo test only, and the T.* directive grammar is removed.

    • Directive type expressions accept constraint builders (number(), lit(), shape(), union(), array(), any(), …) and concrete literals only. Bare T.* parses as unknown; parseTypeValueExpr is no longer exported — use parseCaseArgExpr.
    • serializeCaseArg / --emit-cases emit builders (number(), union(…)) instead of T.*.
    • LSP typeExprToDirective emits builders (number(), union(…), any()).
    • CLI infer reports call-site facts (call@L…) and debug "name" witnesses with Observed: joins — not Case "…" / Combined: as the type product. Contracts stay on *.nudo.js / @nudo:refine.
    • Constraint builders accept concrete nested literals so directive grammar round-trips.

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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

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 --version reads the real package version, and nudo check accepts 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:mock parsing for sinon-style stubs and share parse/strip with core.

    • Support stub().onFirstCall(), stub().callsFake(fn), and sinon.-prefixed chains as the same MockHelper shape TypeValue/Abs already consume.
    • Drop the unused ReturnsDirective / @nudo:returns directive type (contracts use @nudo:refine).
    • parse() now strips types unconditionally via core parseSource (shared AST cache).

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 .ts constructor annotation (including parameter properties) is now the instance field's domain, so constructor(private size: number) + area() { return this.size * this.size } reports number instead of an any-arithmetic nudo:entry-may-throw error while the dts face already said number;
    • definite throws during module initialization are detected: BigInt/Number mixing, division by a BigInt zero, in on 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-level const (false red) and destructured declarations reach the obligation check (false green);
    • a classic for (const i = 0; …; i++) head is a const again, so the always-throwing step is reported instead of staying green;
    • nudo:capability-denied joins the check-face diagnostic whitelist, so nudo check can report the cause of unknown like nudo test — gated on the report actually showing an inference failure (nudo:unknown-inference), so a plain module.exports = … file does not grow a warning about the module global while the same exports written as exports.x report nothing.
    • cross-file evidence from --from now resolves the default export name on both sides, so a renamed default import, import { default as g } and ns.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 from effectiveContract'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 for export 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>Input keys a destructured parameter by its field names rather than the internal _p0 placeholder, 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) alongside module.exports = value keeps the named-export projection (TS forbids export = next to any other exported element, which would make the artifact uncompilable), and an unannotated class getter whose body has more than one return projects unknown instead 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 check entry 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.

  • 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 interface terminology to contract end to end.

    • Core: effectiveInterface → effectiveContract, InterfaceSource → ContractSource, InterfaceTierInfo → ContractTierInfo, interfaceTierOf → contractTierOf, takeInterfaceDiags* → takeContractDiags*, and the algebra/interface/ directory → algebra/contract/.
    • Service: emitInterface / draftInterface / interfaceSurface → emitContract / draftContract / contractSurface; interface-*.ts files → contract-*.ts; ifaceCacheKey → contractCacheKey and the disk-cache namespace iface → contract.
    • Diagnostics: nudo:interface-* → nudo:contract-* (no alias layer).
    • CLI/LSP: CodeLens titles ⚡ persist contract / ↻ update contract / ⚡ draft contract; agent messages no contract found / no contract changes; CheckIssue actions and hover/inlay fields use contractSource / contractDisplay / contractActive.
    • Docs, examples (contract-derivation/, contract-draft/), API snapshots, and website references updated.

    TypeScript's interface keyword, Babel AST TSInterface*, and historical release notes are intentionally unchanged.

  • 7152d84: Feat: LSP rename scope-conflict detection + inlay any/unknown responsibility split.

    • rename: the new name now goes through a scope-conflict check (renameNameConflicts in symbols.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 (renaming x to 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 #private name, 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 its where any() tooltip gains a responsibility note while preserving the existing predicate expansion. The display contract is unchanged: unconstrained params still render any, never unknown.

Patch Changes​

  • 38eedd0: Fix the macOS /var → /private/var path-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 gives process.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 / derivedSidecarAllowed realpathed 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 shared normalizeRealPath from @nudojs/service, which falls back to realpath(dirname) + basename for 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 JSON file field and human-facing text (Bug 661 / 663 / 664 / 63b). New relFromCwd() 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. displayPathOf is 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 filterUnchangedWatchPaths saw it as unchanged and the edit was silently skipped until the next save. startWatch now filters FSEvents noise: macOS directory watchers report untouched files from the same batch, so changing a.js could also re-run sub/b.js and 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 testable watchPathVersion / filterUnchangedWatchPaths, covered by cli-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.

  • 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

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 → new core/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). scanWithStrings was dead after the move and is gone.
    • bigint operand predicates (isNullishLitOperand / isKnownNonBigintNumeric / isMaybeBigintOperand): surface.ts carried a forked copy of arithmetic/coerce.ts — its isMaybeBigintOperand lacked the Bug 946 arr/tuple arms and only stayed sound by accident of the catch-all throw. Single source in coerce; foldNumericBinOp now mirrors foldBigintBinOp's explicit arr/tuple hard-throw so 1n & [] still throws deterministically.
    • Bug 946 member-level fix (behavior): isMaybeCoercionThrowOperand now recurses into sum members and skips arr/tuple members — x & 1 / 1 - x with x: 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 + x on the same union still records may-throw: the number member genuinely throws).
    • collectNestedBodyRanges wiring completed: core exported it via @nudojs/core/internal and its comment claimed parser reuse, but parser still ran a full local copy. file-directives.ts now 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.
    • absShapeForTsTypeText via @nudojs/core/internal: service's tsAnnotationShape was 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.ts and interface-emitter.ts duplicated the export-statement → {names, bindings} extraction (31 lines) and stripSections (14 lines); both now share service/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.
  • 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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • 7d7abe4: Dedup batch 4 (jscpd --min-tokens 70 audit 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 → core formatEntryParamShape via @nudojs/core/internal (the old comment claimed "core adds no export"; the internal face is the sanctioned route).
    • lsp server-code-actions norm/resolveRel copy of the synthesized-sidecar base (already drifted: lsp had an extra direct-equality check + loader fallback) → @nudojs/service/emit exports normPosixPath / resolveRelativeSpec; the lsp-only extensions stay at the call site.
    • standard-schema brand ctor list: GLOBAL_BRAND_CTOR_NAMES local array + Set → schema-generator RUNTIME_GLOBAL_CTOR_NAME_LIST (single array source; Set + isRuntimeGlobalCtorName predicate derive from it; the embedded validator serializes the same array, byte-identical).

    In-file twins single-sourced:

    • core hof.ts: predUsesMappedVars / mapHasShapeOnlyVar → parameterized predAnyVar walker.
    • core scan/literal-shapes.ts: 21 structurally identical constraintViolated issue 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.all dual reject faces → allRejectFace.
    • core check.ts: handwritten return-contract recording block (skip branch + main branch) → recordReturnContract.
    • core leq.ts/postcondition.ts: duplicate primOf single-sourced in leq.
    • core builtins/object/methods.ts: TA own-keys tuple (keys/gOPN faces) → taOwnKeysTuple; gOPD class/Error/.prototype slot→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/$forOf applyExitJoin closures → new pure loop-exit-join.ts applyLoopExitJoin (the discovered exhausted && widen gate difference is an explicit parameter; $forOf passes exhausted: true, provably equivalent).
    • core directive-scan.ts ↔ parser fn-directives.ts: CASE_TAG_REGEX scan loop → core iterCaseTags(text, caseArgSpans) via @nudojs/core/internal (Bug 978 diagnostic actions and downstream regexes stay consumer-side).
    • service dts-generator.ts: DtsClassMemberSurface base interface — scanClassSurface return type no longer re-declares the member fields (BUG-168/151 docs live once).
    • lsp: replay.ts async env-preload twins share preloadEnvsThen, function scope walkers share walkFnScope; server-navigation.ts references/rename share the gate+parse prologue; hover.ts generalize blocks share tryGeneralizeEnclosing.

    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).

  • 5769211: Dedup batch 5 (jscpd --min-tokens 70 audit 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.ts yield try-context bits (raw 1|4|8 / & 2 / ~(16|32|64) literals pinned by a "钉死同步" comment to runtime control.ts YIELD_* constants) → new zero-dependency leaf exec/yield-bits.ts; runtime (control.ts re-export removed, async.ts) and transpile (statement.ts) both import the named constants.
    • parser case-arg.ts TYPE_EXPR_CHAIN_METHODS hand-maintained chain-method whitelist ("须与 core makeBuilder 同步") → core exports CONSTRAINT_CHAIN_METHOD_NAMES (public barrel, next to CONSTRAINT_BUILDER_NAMES); parity pinned by constraint-chain-methods.test.ts (method-face drift ⇒ CI red).
    • service builtin-prototype.ts BUILTIN_ERROR_CLASSES verbatim 8-name copy of core ERROR_CTOR_NAMES → imported via @nudojs/core/internal (the dead module-level re-export is removed; no public face change).
    • core promise.ts aggregateErrorAbs local error-brand construction (cycle: error-family.ts imports promise.ts, so no direct import) stays local but is now drift-gated in eval-bug-293-promise-combinator-settle.test.ts (slot-key set / non-enumerable flags / inherited name vs errorBrandAbs).

    Whole-function twins single-sourced:

    • core builtins/error/binary.ts makeArrayBufferAbs / makeSharedArrayBufferAbs → parameterized makeBufferAbs (brand name, resizable/growable slot key, diagnostic labels; slot insertion order preserved).
    • core transpile/member-path.ts memberWriteIfe / memberWriteRootIfe → shared memberWriteIfeImpl (only real difference: return written value vs new root).
    • nudojs version.ts three walk-up-to-package.json loops → findPkgDirUpwards + readVersionAt.
    • nudojs migrate.ts planWorkflowRewrites → delegates to planWorkflowRewritesIn(findWorkflowDir(from)); readPackageJsonDetailed / readMarkerFile → shared readJsonObjectDetailed(path, label) (missing / invalid / unreadable / ok grading unchanged).
    • service emit/quickfix-edits.ts sidecarClearsEntryThrow / sidecarClearsConstraintViolation → shared sidecarClearsDiags(input, codes) (Bug 556 dual-code gate preserved).
    • core generalize.ts ctorParamCountOf / ctorFormalsOf twin class-ctor walkers → single ctorParamNodesOf walker (Bug 1031 null-declaration skip lives once; count still raw param length, formals still formalParamsFromNodes — the this-param skip semantics unchanged).
    • lsp server-commands.ts handleSelectCase / handleSelectContract ~20-line resolve→read→caseTargets→knownFunctionNames preamble → resolveCaseTarget (error strings byte-identical).
  • 01a550b: Dedup batch 6 (same-file fragment twins from the jscpd --min-tokens 70 audit; 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 / invokeKey hop 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) — extracted emitInvokeTail; the two arms now only define callOf ($invoke vs $invokeKey) and the method-value read ($get vs $idx). Emitted code text unchanged.
    • algebra/term.ts: surviveMulOne / surviveSubZero verbatim-twin closures → shared toNumberDomainTerm (Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).
    • algebra/check.ts: assume / invariant segment processing shares anchorSurfaceOf (#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) share pushEntryMayThrowIssue — only the actual line 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 share mapElements (index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).
    • builtins/object/methods.ts: Object.keys / Object.entries string- literal receiver arms share stringIndexTupleAbs (code-unit indexing, exact conf; element construction injected).
    • algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk share walkChildren.
    • arithmetic/muldiv.ts: div / mod share 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 as messagePortSlots (same cross-brand sharing pattern as the existing streamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.
    • lsp/src/symbols.ts: FunctionDeclaration / FunctionExpression visitor bodies merged into a single "FunctionDeclaration|FunctionExpression" visitor key (babel traverse alias syntax), bodies were verbatim twins.
  • fd0fb09: Dedup batch 7 (jscpd --min-tokens 70 re-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) → single storageObj const (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → shared execSyncOptions; 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 → emitterCoreSlots shared by the EventEmitter brand and the process global object.
    • env node.ts path family — the drifted manual-sync pair: the top-level pathModule inlined the whole member table next to the platformPathMethods(posix/win32) factory and had already drifted (join.required only on the top-level copy). pathModule now 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 .searchParams slot table and the global URLSearchParams constructor share searchParamsCoreSlots (toString / iterator face / size stay per-site; insertion order preserved).
    • core builtins/error/binary.ts: DataView ctor and makeTypedArrayFromBuffer share bufferByteLengthLiteral (brand→inner obj→byteLength slot fold); TypedArray.of's inlined copy of the number-domain item enforcement now calls enforceTaItem (the .of cause variant is unified into the shared text — no pins).
    • core builtins/object/methods.ts: getOwnPropertySymbols obj arm and brand-inner arm share the ownSymbolsTuple tail (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) share unwrapExportDecl.
    • harvester harvest-dts.ts: resolveIfaceDecls inner-first relative namespace resolution loop (qualified arm + short-name arm) → addRelativeNsHit; absExtends' two es.k === "sum" member folds → foldSumFlags (the cs.k === "sum" fold is intentionally different and untouched).
    • service analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) share actualSlotTable (obj direct / brand inner-obj unwrap).
    • lsp server-navigation.ts: onDefinition now uses the shared navigationIdentAt preamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept.
    • lsp agent-tools.ts: suggestCase / trace share the analyzeToolFile preamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
  • 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 own nudo:internal output 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 铸造的内部 id inv#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)。

  • 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 mergeHarvestUnderEnv instead of object spread — so adding an unrelated @nudo:env line 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-unresolved like 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.

  • 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 report nudo:missing-export, transpileSource no longer emits export for 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), dedupe RUNTIME_IMPORT_RE, and share the new Function compile scaffold.
    • Dedupe the A/B call budgets and the two @nudo:pure memo 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 of runtime/async.ts.
  • 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 段 ⇒ 消费方分不出「见证通过」与「见证 失败」。现在并入与 CLI nudo 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),与 CLI check --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 现在与 CLI nudo 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 等价通道):跨文件 调用点证据参与契约求解,接口面/草稿/落盘与 CLI nudo contract --from 同口径。 证据采集下沉到 service:新增导出 collectCallsiteRecords(+ 类型 CallsiteRecords)。
  • 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/suggestCase failure paths now return isError: 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/hover validates its position arguments: a non-integer line / column is a tool error (previously the value was echoed back with every analysis field null, so "no hover here" and "my argument was the wrong type" were indistinguishable), and column now defaults to 0 so the documented { file, line, column, … } payload shape always holds.
    • 961 — nudo/whatIf validates its arguments: a missing target is a tool error (previously a fake success reporting Type of "undefined": unknown), a non-array bindings is a diagnosable tool error (previously a raw bindings.map is not a function), and a binding without name is rejected instead of silently doing nothing. injectBindings in @nudojs/service gained 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:env modules. Their output no longer depends on whether the file happens to be open in the editor (previously the same file and tool could answer never/unknown or 99 depending 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) — normalizeFilePath now rejects a non-string / empty / missing file with a diagnosable file is required … tool error instead of leaking a raw file.startsWith is not a function TypeError (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.selectCase validates its arguments before touching the active-case table. A caseIndex outside the function's @nudo:case list used to be accepted: -1 crashed the analysis (Cannot read properties of undefined (reading 'argsAbs') in the diagnostics) and 99 silently replaced the observation slot. A functionName that is not a function of the target file used to be stored as-is, so nudo.getActiveCases reported ghost entries such as {"":0}. Both now return a structured error and leave the table untouched.
    • nudo.selectContract validates 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 / uri arguments must be non-empty strings. A non-string file used to escape as a bare TypeError (file.startsWith is not a function), which reached the client as a JSON-RPC protocol error instead of a tool error carrying isError: true; a missing file silently fell back to the server's working directory.
    • An unknown command name on workspace/executeCommand now fails with the protocol-level MethodNotFound error instead of answering with a null result, 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 没有 MemberExpression property 分支 ⇒ 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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • 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:

      1. 形态一致性检查未以「靶属性不可配置」为前提 ⇒ ES2024 IsCompatiblePropertyDescriptor 只在 current.[[Configurable]] 为 false 时比对数据/访问器形态,引擎无条件抛 ⇒ 可配置靶 + 异形态陷阱整类误判;
      2. frozen 被当成 enumerable:false ⇒ Object.freeze 只改 writable/configurable、不改 enumerable ⇒ 冻结靶 + 诚实报告描述符的 Proxy 被判违约(同处注释"frozen ⇒ enumerable 全 false"本身是事实错误);
      3. 靶侧标志/extState 只查「内层 obj」不查「接收者」 ⇒ defineProperty 把 标志记在接收者上(brand 靶记在 brand)⇒ 取不到 ⇒ 回落 configurable:true ⇒ 陷阱报告与靶完全一致也被判违约。 修法:形态比对收进「靶不可配置」分支;frozen 不再改 enumerable;靶侧三标志 统一复用同文件 currentPropDesc(接收者优先、内层兜底)。不可配置靶 + 异形态陷阱仍抛(能力未关)。
    • 项目级 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 build exit 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. checkSource built its return-contract issues without a line / column, so every consumer fell back to the top of the file: the LSP drew the diagnostic at line 1 column 0, nudo check --gha annotated line=1,col=1, GitLab Code Quality reported lines.begin: 1, and --json emitted 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 sidecar fn({...}, <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-relied audit 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 0 is 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.
  • 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 上投影——CLI nudo test 已经打印该事实。 调用方文件现在出现与 CLI 同形的 call@L4 lens;被导入函数的 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 入口)按光标词法上下文 与作用域决定成员面 / 变量面。

  • 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: 指令面行为不变。
  • f87c9f9: Hover now agrees with nudo check on what a parameter's type is, and an early-return guard no longer narrows away a null that is still reachable.

    • Bug 773 — The flow facts treated if (!p) { return 0; } else { … } as an early-return guard and stripped the nullable(…) wrapper from p for the rest of the function. The else branch falls through to the code below the if, so p can still be nullish there; the hover showed a type that does not hold. The guard now only narrows when there is no else branch, or when the else branch also ends in return / 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)) while nudo check showed 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 inject bundle, so inline directives (@nudo:mock / @nudo:as / @nudo:replace, environment globals) were missing and the derivation collapsed to unknown ("inference failed") while the CLI gate showed the real type. HoverInterfaceOpts now carries inject and passes it to every generalizeFromAst call of the hover surface.
  • 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 时同时 fire onDidOpen 与 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)。

  • f87c9f9: fix(lsp): 诊断 range 夹到行尾 + check 通道保留 info 级(Bug 778 / 779 LSP 半)

    • Bug 778:service 的 column: 999「整行」哨兵被原样写进 LSP end.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 永不上屏,与 CLI nudo check 两侧集合不一致)。转换点 改为保留三档,档位取舍只由 filterCheckLspByLevel 决定(verbose 放行 info;default / errors / off 不放行,off 的门禁码可见性不变)。
    • env 通道同档同 range:nudo:env-unresolved 改走与 check 主通道同一个 转换点(checkIssueToLspDiagnostic)⇒ severity 与 range 与主通道同口径。
    • 对外交付两个前置件:envUnresolvedDiags 改为 export(供 pull 诊断面 消费);handleNudoDepFileChanged 排除变更文件自身(防自激重检)。
  • 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)—— 与 CLI buildCheckInjection 同口径(@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。
  • 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 }))同理。
  • 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 and import 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, so default is 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 of ns a 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 bare ns is not a reference.
    • Renaming an exported symbol across files edited the wrong side of an aliased import: import { oldName as alias } became import { 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.helper jumped to an unrelated export function helper in 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 renaming a in m.js left 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 as number().gt(0) is reported as not fn() form and has no effect), so go-to-definition no longer sends the user to a binding that cannot take effect.
  • 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 同口径)。
  • 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:throws or @nudo:budget was 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-syntax diagnostic 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-missing and nudo:mock-invalid was 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 autoBind value 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.
  • 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.json CLI 绿 / 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 (标题与兄弟命令同款风格)。
  • a6e9fa2: LSP navigation now agrees with itself: method and catch parameters have a definition, private class members keep their own identity, and renaming an aliased export renames the export instead of the local binding.

    • textDocument/definition returned null for a class method parameter, an object method parameter, and a catch parameter, while textDocument/references at 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, and catch clauses; a catch parameter is scoped to the catch clause itself.
    • A private class member (#name) was resolved as if it were the ordinary identifier name, so definition, references, and rename all 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; prepareRename reports 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 name a and the exported name b. 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 the imported side 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, and rename all 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/symbol never returned class members. The handler only walked the top level of documentSymbols, while class methods and class properties live in a symbol's children ⇒ they could never appear in a workspace search. The handler now walks the tree recursively and flattens it into SymbolInformation[], expressing the hierarchy through containerName (which is what the flat LSP protocol expects).
    • Bug 748 — filePathToUri and uriToFilePath were not inverses of each other. The encoding side concatenated file:// with the raw path (so %, #, ? and spaces were never escaped) ⇒ the server produced URIs that were not valid URIs; the decoding side ran a bare decodeURIComponent ⇒ a malformed percent escape threw an uncaught URIError and aborted didOpen / didChange / didClose, leaving that document with zero diagnostics. The encoding side now uses Node's pathToFileURL and the decoding side uses fileURLToPath with a try/catch fallback (malformed input degrades to the undecoded text and never throws), so the two are exact inverses; cacheKey benefits as well. URIs for non-file: schemes (untitled: …) are still returned verbatim.
    • Bug 749 — textDocument/documentSymbol ignored the client's capabilities. The server never kept params.capabilities, so it always answered with the hierarchical shape and the full SymbolKind range even when the client declared hierarchicalDocumentSymbolSupport: false or a restricted symbolKind.valueSet (both are protocol violations). The navigation handlers now consume the client capabilities that initialize captured: a client without hierarchical support receives a flat SymbolInformation[] (location instead of range / selectionRange / children), and a kind outside the client's valueSet is clamped to a safe value inside that set (with a note in detail). When the client sends no capability section at all the default answer is kept — hierarchical shape, full SymbolKind range.
    • Bug 750 — textDocument/rename never validated the new name. The request's newName was 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) and node --check would fail with a SyntaxError. 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 by definition only, was rejected by the other four navigation requests, and was listed by workspace/symbol, which had no gate at all ⇒ one coordinate, three different answers (the server contradicted itself). definition no longer has its sidecar escape hatch and workspace/symbol now 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.)
  • 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. onInitialize only echoed the server's own capability declaration, so no handler could answer according to what the client asked for: textDocument/documentSymbol always answered with the hierarchical shape and the full SymbolKind range, even when the client declared hierarchicalDocumentSymbolSupport: false or a restricted symbolKind.valueSet. The client capabilities are now captured during initialize and handed to the navigation handlers through the existing deps object (no new package export). When the client sends no capability section at all the value stays undefined and the handlers keep the default answer (hierarchical shape, full SymbolKind range) — an old client must not degrade the server's output. The initialize result 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 by definition only, was rejected by the other navigation requests and by all six IDE requests, and was listed by workspace/symbol, which had no gate at all — one coordinate, three different answers. The gate now has a single source of truth (server.ts's isNudoFile, 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.
  • 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 on HEAD).

    • 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 to export 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. definition and references stay 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 definition of the imported side lands in the imported module instead of the unrelated same-named export, and its references are 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.
  • a6e9fa2: LSP: the workspace-folder subscription must never take the server down.

    connection.workspace.onDidChangeWorkspaceFolders is a getter in vscode-languageserver@10.1.2 that throws (Client doesn't support sending workspace folder change events.) unless the client declared capabilities.workspace.workspaceFolders — and it only becomes usable after initialize, 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 with

    Error: 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 guards null / 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, and initialize still 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 after initialize — 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/codeAction request 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 undefined into the source, which then failed the very check it was meant to fix. The placeholder is now null, 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.
  • 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。
  • 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_FORKS still served the previous run's result. The effective value (environment variable, then package.json, then the default) is now part of the key.
    • An invalid nudo.check.entryThrows value was reported once per checked file. The warning is now printed once per distinct invalid value.
    • @nudo:as did 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-if attached 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.
  • 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 三处表项未动)。

  • 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

Patch Changes​

  • 52de5ca: Classify fs "miss" vs "read failure" everywhere. Replaced every existsSync(p) && statSync(p) double call (TOCTOU race + errno swallowing) with a single statSync(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 on e.code: sidecar contracts unreadable for reasons other than ENOENT print a warning: cannot read sidecar contract … in check/check --fix (no more silent contract-blind green runs); @nudo:mock seed evaluation failures warn in export before degrading; pnpm-workspace.yaml read failures other than ENOENT abort migrate (a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read report read-failed with 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-dts path-like arguments that don't exist now error as path not found instead of being treated as npm package names ending in a misleading no .d.ts files found.
  • 9a3d6e7: Stop silently swallowing business-Promise failures. nudo check/test --watch incremental 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) and handleNudoDepFileChanged (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-truncated misattributing call-cycle truncation to "depth/size budget", and make nudo check --json budget stats see the B-path ($callNamed) truncation (issue #158):

    • enterCall / evalEnterCall now attribute a truncation reason — cycle (same name+arg fingerprint already on the evaluation stack; data-dependent self/mutual recursion such as directory walkers or grow-style recursion) vs depth / calls (real budget exhaustion). The check diagnostic message, suggestion, structured action, and a new reason field 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 reports truncated:false alongside a nudo:recursion-truncated info: B-path counters are latched across execution sessions within one host entry and surfaced as evalCalls / maxEvalCalls / evalCallTruncated, plus cycleTruncated and a sorted reasons[] 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-reported nudo:fork-truncated).
    • The @nudo:budget quickfix (nudo check --fix / LSP code action) is no longer offered when the truncation reason is cycle; the reason is plumbed through check --json, the disk cache, LSP diagnostic data, and materializeAction.
    • Raising @nudo:budget on 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 own nudo:loop-truncated info with an honest message and suggestion (the call-budget knobs cannot lift a loop budget — @nudo:budget calls=/depth= does not apply), gets a loopTruncated flag in the check --json / health budget block (single-file and multi-file envelopes), and no longer offers the misleading @nudo:budget quickfix 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(核心变更):transpile recordPositions 插桩($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 | undefined sound)。重放 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,参数折叠文本注册表按路径键在命中路径补登记;此前第二个同内容侧车路径查不到折叠文本、回落谓词全展。
  • fa52735: 参数契约 inlay hints(形参后 where …)默认关闭:显式契约(递归 AST 节点联合等)行内展开可达数万字符。新增 nudo.inlayHints.parameters(boolean,默认 false)三级配置——项目 package.json#nudo.inlayHints.parameters 显式值赢,宿主设置(VS Code nudo.inlayHints.parameters / Zed language-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

    • $narrowMemberEq keep-arm refinement: surviving union members with a compatible discriminant slot now carry the eq(slotTerm, lit) fact on that slot (conjoined with any existing pred). formatShape(showLits) renders it via litPredValue, so the open-tail arm displays { type: lit("TemplateLiteral") } after node.type === 'TemplateLiteral' instead of the unrefined { type: string }; memberEqClass upgrades those members to only, improving chained discriminant narrowing and complement-arm pruning. any/unknown slots stay untouched (fail-closed markers).
    • litPredValue now reads eq(self, lit) facts through and-conjunctions, not only top-level eq preds.
    • LSP A0 hover replay resolves mid-token cursor positions: record keys are Babel start positions ($nodoPos uses loc.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; 不记录)。LSP absNodeAtPosition 词中回落从 Identifier 泛化为任意带 loc 节点(候选仅当起始键已有记录,取最小 span——词中标识符行为不变);新增无 ident 分支——hover return 关键字或表达式内非标识符位(?.[、[0]、.)直接显示推导类型(无 ident 前缀,pretty 渲染)。
  • 35ce944: Fix recursive-fn local hover poisoning and arity-only fn hover display

    • $nodoPos position 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-truncated opaque unknown into local-variable hovers (obj now shows the computed null | string | undefined).
    • const x = <non-call init> declarations record the bound Abs at the declarator-id position during hover replay (recordPositions only) — ternary/optional-chain/literal-initialized locals are hoverable (prop, q).
    • callTranspiledExportFullInner refines the called fn Abs returnType slot after a successful call (same policy as class method slots, display-only).
    • LSP hover: an arity-only fn Abs (empty returnType slot) no longer preempts the generalize intension face; fn-name/callee hovers show the full contract signature (node: nullable(astNode)) => null | string | undefined instead 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 host TypeError: Reduce of empty array with no initial value escaped module evaluation → fail-closed unknown exports when the callback folds a literal key over arr/abstract-string-prim items); empty fold degrades to unknown.
    • 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 like if (x >= 0) return x; console.log(x); return 1; under @nudo:contract return nonNeg.
    • extractImportEdges skips import edges whose target resolution throws ModuleReadError (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).
    • $copy snapshots 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,语义正确)。
    • 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.hover slash 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 组装用例(此前弹层组装零覆盖)。
  • 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.ts CollectAbsInlaysOpts 增加 modules 透传给 generalize;server-ide.ts hover/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)不参与选择器(推导面)。

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 轮互为跨次陈旧命中。
    • findProjectConfig stat 错误分类:非 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 自身侧车」改走 core loadModuleDepsFingerprint(覆盖 @nudo:import 全部 .nudo.js / require / 动态 import / 侧车闭包)——被 import 侧车内容变更(无 watcher 事件)不再命中陈旧缓存;截断走 fail-visible 唯一指纹。analysisCache / knownFiles / nudoDepParents 套与 service getSessionCacheLimits 同源的 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-return null | number is provable). Gold-FP protection kept: any-widened bare-prim arms downgrade siblings to unproven-return warnings instead of errors.

    #69 DX​

    • actionsForIssue kinds 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 empty shape({}).
    • L2 entry-may-throw suggestions 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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 Function on 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/service god package: harvest → @nudojs/harvester, IDE surface → @nudojs/lsp, emit products consolidated under @nudojs/service/emit.

    BREAKING for @nudojs/service subpath consumers:

    Removed subpathMigrate 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/service keeps ., ./analysis, ./evaluator, ./emit. The language server moves to @nudojs/lsp/server (bin nudo-lsp unchanged); @nudojs/lsp is now a side-effect-free library entry re-exporting the IDE surface.

    No dependency cycles: lsp → service, harvester stays independent of service. 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-level watch / harvest; flags --callsites, --output, --format zod, --dts, --emit-cases; API absToZodSchema; InferJson/serializeInferJson → CaseJson/serializeCaseJson; LSP agent tools nudo.infer / nudo.interface* and aliases → nudo.test / nudo.contract*; config key package.json#nudo.interface.* → package.json#nudo.contract.*. Root scripts infer/types/interface removed.
    • Primary verbs: check / test / contract / export / health / env harvest. Observation is check signatures + test case reports + IDE hover. Thin shell @nudojs/nudojs follows @nudojs/cli majors.
    • L2: undigested may-throw on entry/export functions is nudo:entry-may-throw (default error). Configure with --ignore-throws / --entry-throws or package.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.
    • check always prints signatures on success; unconstrained entry params display as any (true unknown = inference failure + nudo:unknown-inference).
    • test prints every case including synthetic call@/entry@; only declared @nudo:case expectations affect exit. --freeze[=update] solidifies witnesses.
    • Flags: --from, export --format dts|guard|schema|standard|all (--dialect zod for schema), export --out. --json cannot 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.
  • 0e1432a: feat!: source contract directive is @nudo:contract only

    @nudo:refine and @nudo:interface are 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:interface with @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 精化.

Minor Changes​

  • P1–P3 engineering hardening (review follow-ups) — no product-face breaks

    • @nudojs/parser: export typed Babel AST narrowers (ast-guards.ts); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).
  • 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 and dropped notes.
    • Projection prefers core absToConstraint (parity for eq(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, vendor nudo).

    CLI:

    • nudo export --format schema [--dialect zod] → *.nudo.schema.<dialect>.ts
    • nudo export --format standard → <fn>.nudo.standard.ts (contract-first domains; joinAbs when no contract)
    • test --json stdout is one JSON document (cases only); check --json stays a separate command
    • --ignore-throws now merges with package.json#nudo.check.ignoreThrows (additive)

    LSP:

    • Gate codes (nudo:entry-may-throw etc.) keep Error and Warning under analysis.diagnostics=off|errors so IDE matches CLI when entryThrows=warning

    Docs/product copy:

    • Day1 sidecar example uses fn({ params }, returns?) (not bare number().gt(0) on a function export)
    • Help / generated markers use schema/standard and nudo 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:case is debug / nudo test only, and the T.* directive grammar is removed.

    • Directive type expressions accept constraint builders (number(), lit(), shape(), union(), array(), any(), …) and concrete literals only. Bare T.* parses as unknown; parseTypeValueExpr is no longer exported — use parseCaseArgExpr.
    • serializeCaseArg / --emit-cases emit builders (number(), union(…)) instead of T.*.
    • LSP typeExprToDirective emits builders (number(), union(…), any()).
    • CLI infer reports call-site facts (call@L…) and debug "name" witnesses with Observed: joins — not Case "…" / Combined: as the type product. Contracts stay on *.nudo.js / @nudo:refine.
    • Constraint builders accept concrete nested literals so directive grammar round-trips.

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/env now 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/env slot if you needed harvest's version; otherwise no code change. Conflicts emit a nudo:env-harvest-conflict warning 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-call onConflict), 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=off stays explicit and uncached. clearNodeHarvestCache() also drops not-found misses so a later @types/node install is visible in-process. nudo:env-harvest-conflict warnings point at the conflicting import specifier when found (file-level line 0 otherwise).
    • @nudojs/env (minor): events / stream / querystring; high-frequency util slots; Promise APIs only under fs.promises / node:fs/promises (callback-style fs.readFile etc. no longer pretend to return Promise). Optional Node params (path.basename ext, url.URL base) keep typed labels (ext?: string) but are not required slots — requiredFnArity skips ? / ....
    • @nudojs/core (patch): formatShape renders fn rest labels (...paths) and optional labels (options?) as ...name: T / name?: T. leqAbs fn arity uses required slots only (requiredFnArity skips ...rest / name?): src is assignable to tgt iff src.required ≤ tgt.required (TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). Pairwise paramTypes contravariance is unchanged.
    • @nudojs/lsp (patch): freeze inventory in public-api.ts (also exported as @nudojs/lsp/public-api); agent slash requests register from NUDO_AGENT_TOOL_NAMES; selectCase / getActiveCases are 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.0 after the next release, and prefer leaf-clean coverage counts (empty { } shapes are not leaf-clean) over raw resolved ratios.

  • 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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

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: handleInterfaceEmit now passes agentToolDeps so workspaceRoots reach assertEmitTargetAllowed (was dead in production).
    • Emit fail-closed: empty workspaceRoots rejects; no ancestor-package.json authorization fallback; realpath blocks symlink escape; refuse writes under node_modules.
    • autoBind kill-switch complete: threaded through scan generalizeFromAst / same-file eiOpts; empty fromFile no 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 effectiveInterface memo in check; take*Since on memo hit/miss (no LSP diag theft); shift rejects non-finite offsets; @generated marker requires adjacent comment block; add-mode empty targets no longer rewrite trailing whitespace; emit tmp name randomized.
  • de47d84: Review fixes on feat/interface Phase 1:

    • autoBind kill-switch: analyzer's cross-file nudo:interface-domain-exceeds path now reads package.json#nudo.interface.autoBind (was silently ambient-loading sidecars when autoBind: false).
    • nudo check --callsites: inject usage-site call records so CI gate can surface nudo:interface-domain-exceeds (previously only reachable via analyze/interface paths).
    • Sidecar auto-bind coverage: localNamedExports accepts local export { x } / export { local as exported } list form (was declaration-only; silent miss for common style).
    • Directory targets: isNudoTargetPath excludes *.nudo.js / *.nudo.ts so check/infer/doctor no longer treat contract modules as source.
    • VS Code client: documentSelector includes TypeScript; file watcher covers **/*.{js,mjs,ts} (includes .nudo.ts sidecars).
    • LSP emit: failed interfaceEmit no longer claims "sidecar written" and skips the invalidation path.
    • UX: first --emit with empty default targets prints a --fn/--all tip; --fn/--all without --emit warn; CodeLens titles use "interface" not "refine"; domain-exceeds message is English (matches other diagnostics).
  • 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • Relational compare folds mixed concrete lits ("a" > 3 → false), so if (x > 3) does not join both branches for NaN inputs.
    • joinValues uses Object.is so join(NaN, NaN) stays NaN (NaN === NaN is false).
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]).
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead of call-site B-path nodes.
    • Param inlay no longer invents where x > 3 from if (x > 3) return x — only explicit @nudo:refine contracts show as preconditions.
    • Return inlay is a path summary with source param names: x + 1, x | x * 2 (not the refined number where x>3 | string | … dump).
    • Number range narrowing uses exclusive bounds (> 3, not integer-style >= 4).
    • Concrete if tests no longer narrow the tested value into a range (44 > 3 keeps x as 44).
    • True branch of x > k on unknown refines to number>… | string (JS ToNumber space).
    • flattenSum keys prim members by term/pred so number=A1>3 and number=A1*2 stay 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's unknown (record the declarator id in evalVarDecl).
    • const s = double("a") is NaN (JS "a" * 2), not unknown — concrete string/boolean lits coerce under ToNumber; formatAbs prints NaN/Infinity instead of null.
    • workspace/executeCommand accepts positional nudo.selectCase args from CodeLens ([uri, fn, index, name]), not only the agent object form.
    • Hover inside @nudo:case functions goes through TypeValue + activeCases instead 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-lsp bin (shebang on dist/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 of tsx + 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 --version reads the real package version, and nudo check accepts 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:path etc.).
    • 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, evaluateProgram is skipped so TypeValue no longer double-reports.
    • CLI check / types / test accept directories; check uses an Abs-only gate.
    • LSP hover / getTypeAtPosition on capable files read the Abs node table; *.nudo.js edits evict L0 and recheck open parents.
    • Public core surface now re-exports the algebra API (Abs, check, generalize, exec, bridge, parseSource, stripTypes).

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-node are replaced by a single @nudojs/env package 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/mcp is removed. @nudojs/lsp now exposes nudo.whatIf, nudo.suggestCase, nudo.trace, nudo.selectCase, and nudo.getActiveCases via workspace/executeCommand (custom-request aliases nudo/whatIf etc. included), adds pull-mode diagnostics, and works on files that are not open in the editor (disk fallback). nudo.whatIf now 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 at packages/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() includes NaN and ±Infinity, so a sequential guard such as if (x < 1) return 0; return x + y; cannot assume x >= 1 on the fall-through path (NaN < 1 is 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 $refineNotNaN also count as evidence). NaN guards (Number.isNaN(x), x !== x, x === x, !Number.isNaN(x)) establish ne(x, NaN) on the arm where that holds; Number.isFinite(x) is one-sided (true arm only). A const / let / var alias such as const 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-shadowed Number disables the builtin guard fact (fail-closed). De Morgan spellings (x < 1 || y < 2) are complemented per disjunct. The previous unproven results for bare number() are unchanged.

    Literal NaN / ±Infinity arguments (including 0/0, Number.NaN, Number.POSITIVE_INFINITY) now violate a finite precondition instead of passing silently; NaN and ±Infinity globals 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): relationFn gains an optional throws carrier (impl.relation.throws — same representation as AbsApplyResult.throws, never/absent = no throw; not written into the fn shape, which has no throws consumer). The $call relation arm routes it through the single routeApplyThrows entry (may-throw → pushThrowExit into 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 passes opts.throws through (opt-in; no existing declaration changes behavior).
    • A4 (construct paths dropped the apply throws slot): the two bare-unpack sites — $new's impl.apply branch (exec/class/construct.ts) and the bind-product [[Construct]] facet (exec/class/invoke.ts) — now route through routeApplyThrows instead of peeling .abs, so constructor-declared throws take effect on new X() too (previously call-face only). Under @nudo:env node, new URL(<invalid or abstract>) now records may-throw TypeError instead of silently succeeding; definite always-throw constructor applies surface as NudoThrow at the construct point. A source gate forbids reintroducing isAbsApplyResult(x) ? x.abs : x peeling 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 pin env-bug-64 2.4 rewritten as a positive assertion.
  • 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 70 audit; 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 / invokeKey hop 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) — extracted emitInvokeTail; the two arms now only define callOf ($invoke vs $invokeKey) and the method-value read ($get vs $idx). Emitted code text unchanged.
    • algebra/term.ts: surviveMulOne / surviveSubZero verbatim-twin closures → shared toNumberDomainTerm (Bug 010 number-domain guard for x*1 / x-0 identities, bigint mixed-type preservation).
    • algebra/check.ts: assume / invariant segment processing shares anchorSurfaceOf (#165 anchorable surface: contract formals ∪ AST params ∪ top-level locals); the two L2 entry-may-throw issue constructions (no-signature fallback vs generalized success) share pushEntryMayThrowIssue — only the actual line 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 share mapElements (index-keyed element mapping, abstract child folds to null with partial/unseen accounting, tuple holes).
    • builtins/object/methods.ts: Object.keys / Object.entries string- literal receiver arms share stringIndexTupleAbs (code-unit indexing, exact conf; element construction injected).
    • algebra/promote-scan.ts: ForOf's binding-window child walk and the generic tail walk share walkChildren.
    • arithmetic/muldiv.ts: div / mod share 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 as messagePortSlots (same cross-brand sharing pattern as the existing streamSlots); defineEnv deep structural dump verified byte-identical vs HEAD.
    • lsp/src/symbols.ts: FunctionDeclaration / FunctionExpression visitor bodies merged into a single "FunctionDeclaration|FunctionExpression" visitor key (babel traverse alias syntax), bodies were verbatim twins.
  • fd0fb09: Dedup batch 7 (jscpd --min-tokens 70 re-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) → single storageObj const (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → shared execSyncOptions; 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 → emitterCoreSlots shared by the EventEmitter brand and the process global object.
    • env node.ts path family — the drifted manual-sync pair: the top-level pathModule inlined the whole member table next to the platformPathMethods(posix/win32) factory and had already drifted (join.required only on the top-level copy). pathModule now 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 .searchParams slot table and the global URLSearchParams constructor share searchParamsCoreSlots (toString / iterator face / size stay per-site; insertion order preserved).
    • core builtins/error/binary.ts: DataView ctor and makeTypedArrayFromBuffer share bufferByteLengthLiteral (brand→inner obj→byteLength slot fold); TypedArray.of's inlined copy of the number-domain item enforcement now calls enforceTaItem (the .of cause variant is unified into the shared text — no pins).
    • core builtins/object/methods.ts: getOwnPropertySymbols obj arm and brand-inner arm share the ownSymbolsTuple tail (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) share unwrapExportDecl.
    • harvester harvest-dts.ts: resolveIfaceDecls inner-first relative namespace resolution loop (qualified arm + short-name arm) → addRelativeNsHit; absExtends' two es.k === "sum" member folds → foldSumFlags (the cs.k === "sum" fold is intentionally different and untouched).
    • service analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) share actualSlotTable (obj direct / brand inner-obj unwrap).
    • lsp server-navigation.ts: onDefinition now uses the shared navigationIdentAt preamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept.
    • lsp agent-tools.ts: suggestCase / trace share the analyzeToolFile preamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
  • 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 the crypto.webcrypto / Crypto / global crypto faces) now accept the integer TypedArray domain and reject plain Arrays, float views and primitives with a definite TypeError instead of returning unknown.
    • BUG-148: host objects that model slots as unknown (web Response.body, Headers.getSetCookie, document.location; node Event / CustomEvent / Request) now carry their real slot types.
    • BUG-149: performance.mark / performance.measure return PerformanceMark / PerformanceMeasure brands instead of throwing.
    • BUG-150: crypto.subtle call sites widen the rejection reason to OperationError ∪ TypeError (the static reason stays OperationError).
    • 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 / entries of the iterable families (node Headers / FormData; web Headers / FormData / URLSearchParams) are modeled as total iterators instead of degrading to unknown.
    • BUG-155: AbortSignal.any is function-valued, and the 10 WebAssembly.* / Temporal.* members are modeled as constructors.
    • BUG-161: the web constructor instance faces keep their brand (12 faces), so instanceof matches the runtime instead of reporting Object / false.
    • BUG-193: Buffer's static table no longer carries members the host does not have, and the node:buffer module face is modeled.
    • BUG-255: path.posix / path.win32 expose parse / format from one shared source of truth with path.
    • BUG-256: process.title is a string slot (it previously folded to undefined).
    • BUG-257: util.types models 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,上一行断言未动。

  • 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 old ENV_SHADOW_SKIP_GLOBALS constant. 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] returned undefined instead of "Map", RegExp.prototype.flags returned undefined instead of "" and Error.prototype.name returned undefined instead 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.add returned undefined even though "add" in s said true. 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] but Math[Symbol.toStringTag] returned undefined. A namespace object now exposes its Symbol.toStringTag.
    • Symbol.prototype.description returned the string "undefined" and did not record a throw; it now throws a TypeError, like the specification says.
    • Map.prototype.size and Set.prototype.size returned "undefined" and did not record a throw; they now throw a TypeError.
    • Intl.NumberFormat.prototype.format returned undefined and did not record a throw; reading a brand-check accessor of an Intl prototype now throws a TypeError.
    • A member that does not exist on a number, boolean or bigint primitive folded to unknown, which made every later read of that value look harmless. It now folds to undefined, so the later read is still recognised as a possible TypeError.
    • Symbol() instances resolved toString and toLocaleString to the matching members of Object.prototype, losing the brand check. The brand check is now performed.
    • The constructor of a class value resolved to a built-in constructor named after the class, so Widget.constructor === Function was false. It is now true.
    • A getter-only static accessor accepted a write; it now throws a TypeError in strict mode, like the instance-level accessors already did.
    • The prototype property of a class value was missing its "not writable" flag, so A.prototype = {} silently wrote through. It is now rejected with a TypeError.
    • process.env and process.versions were shown as Record<string, string | undefined> but reading process.env.HOME returned unknown, and the difference was reported as a failed inference. The read now uses the declared index domain.
    • A host or namespace object such as Math only projected its enumerable own properties, so Object.getOwnPropertyNames(Math) returned 0 and Math.PI could 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.
  • 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)⇒ OperationError DOMException(WebCrypto 规范);
    • navigator.clipboard.readText / writeText ⇒ NotAllowedError DOMException(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-throw TypeError), 台账「errors = []」的前提与原生不符。

    env 包的 exports map 未动(无新增导出面);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 → exact undefined),与 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 不再读出 exact undefined, 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 表),并带负控(宿主没有的成员仍被判 「确定缺失」)⇒ 证明没有把整张表改成全放行。

  • 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 包的 exports map 未动(无新增导出面)。

  • 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/promises API 面补齐(缺口):fs.openSync 此前未声明 ⇒ 补上(返回 fd(number);路径不存在 ⇒ may-throw Error (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-8 vs string ⇒ 声明会降 精度)。
    • 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.

    • envFn used to swallow whatever the host function threw: the apply wrapper caught every exception and returned the declared return type, so a declaration such as atob("!!!") 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-written throw is. 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-Error throw. Declarations whose host throws a brand that is not a standard error name — atob and btoa throw a DOMException named InvalidCharacterError — pass the brand explicitly through the new declaration-side throws option.
    • The new declaration-side enforceArgs option checks each argument against the declared parameter type before the host call happens. An argument that definitely does not fit makes the call throw a TypeError; an argument the engine cannot pin down (an unknown, an any, or a value that is not exact) makes the call possibly throw a TypeError. The check is opt-in, per declaration.
    • envFnVariadic accepts the same throws and enforceArgs options 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 the EnvApplyImpl apply signature — are internal to the package (src/abs-helpers.ts) and are not part of its exports surface: @nudojs/env/es, /web and /node export only defineEnv and the EnvDefinition type.
  • 69e67d3: The web environment now describes the browser the way the browser behaves.

    • The browser constructors are constructible again. Response, Request, Headers, URLSearchParams, EventTarget, Event and CustomEvent are declared with ctor: true, so new X() no longer reports a may-throw for a call that the browser makes happily. Response used to be a plain object rather than a function at all, which made new Response() a definite TypeError; it is now a constructor whose static json, redirect and error live on the constructor itself.
    • Request no longer copies the whole member table of Response. The status members ok, status, statusText, redirected and type belong to Response only — a native Request has no status at all — so reading request.status now yields undefined instead of a number. Request keeps its own members (method, body, mode, credentials, cache, redirect, referrer, referrerPolicy, integrity, signal, keepalive, duplex, destination) and shares bodyUsed with Response.
    • document and performance list their members. A member the table left out used to read as undefined, and calling it was reported as a definite TypeError — on document.getElementsByTagName, document.forms, document.write, performance.getEntries and the rest. The collections read as arrays, and performance also exposes navigation, serverTiming and timeOrigin.
    • The global list covers the browser globals that were missing: alert, screen, DOMParser, XMLHttpRequest, Worker, FileReader, matchMedia, IntersectionObserver, getComputedStyle, indexedDB and caches. Reading an undeclared global is a ReferenceError, so the missing ones were reported on perfectly ordinary browser code.
    • navigator.hardwareConcurrency is declared. It used to read as undefined, which made navigator.hardwareConcurrency > 4 fold to false without a word of complaint; it is a number now.
    • AbortSignal.any is declared, so combining signals no longer reads as a definite TypeError.
    • location.searchParams is declared, so location.searchParams.get("q") no longer reads as a definite TypeError; it returns string | null.
    • atob, btoa, TextEncoder and TextDecoder are 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 the InvalidCharacterError the browser raises, and valid base64 still folds to the exact string. new TextDecoder with an unsupported label reported a TypeError; it now reports the RangeError the browser raises. TextEncoder and TextDecoder are classes, so calling either without new reports the TypeError the browser raises, and calling them with new reports nothing.
    • queueMicrotask is no longer declared by the environment. The declaration shadowed the check that the argument is callable, so queueMicrotask(1) looked like a call that never throws; it now reports the TypeError the browser raises.
  • 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").name and friends were cast into an empty brand: reading a member gave undefined, and reading it twice gave a definite TypeError. The environment now declares the host constructors — with their instance faces, and with ctor: true for the ones Node can actually construct and ctor: false for the ones it cannot (AbortSignal, MessagePort) — together with the global objects crypto, performance and navigator. Reading crypto.randomUUID() now gives a string instead of unknown plus a misleading nudo:unknown-inference diagnostic 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.
    • Buffer is a constructor now. It was declared as a plain object, so new Buffer(1) was a definite TypeError although 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 Buffer instance face gained byteLength, buffer and byteOffset. They used to read as undefined where Node reports 4, an ArrayBuffer and 0.
    • The three process streams (stdin, stdout, stderr) share one socket face. process.stdout only had write and process.stdin only had on, so process.stdout.on("data", …) and process.stdin.setEncoding("utf8") were definite TypeErrors.
    • The process face gained twelve real members: emitWarning, abort, kill, release, features, umask, getActiveResourcesInfo, resourceUsage, availableMemory, loadEnvFile, getBuiltinModule and constrainedMemory. process.features is an open map over boolean | string | undefined values, so reading a flag no longer degrades to unknown.
    • process.hrtime is callable again. It was declared as an object, so process.hrtime() became unknown and produced a misleading nudo:unknown-inference diagnostic; it now returns a [seconds, nanoseconds] array, with hrtime.bigint() as a static member.
    • The node environment no longer declares structuredClone or queueMicrotask. 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.
  • 69e67d3: Node fs / fs/promises / path / os declarations 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 the times member, so reading cpus()[0].times.user produced an exact undefined and the engine concluded the call must throw a TypeError. The record now carries times with user / nice / sys / idle / irq, as the host does.
    • The node:path family checks the types of its arguments. A path argument that definitely is not a string makes the call throw a TypeError, which is what the host does — path.join(123) and path.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 of basename still accepts undefined, as the host does. path.posix and path.win32 follow the same rules.
    • The synchronous node:fs members report that they may throw. The host throws an Error (with a code such as ENOENT) 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 an Error; it is not marked as always throwing, because the engine cannot know whether the path exists. existsSync still never throws, and rmSync with force: true keeps ignoring a missing path.
    • fs/promises results use the same member tables as the synchronous family. The promise-family result was a trimmed copy, so reading mtimeMs, nlink or isBlockDevice() off it produced an exact undefined instead of the number or boolean the host returns, and the Dirent of readdir had no shape at all. readdir now also follows the host and returns names when withFileTypes is not set and directory entries when it is.
    • statSync and fs.promises.stat report the undefined the host returns for throwIfNoEntry: false. The result was declared as never undefined, so the checker reported the call as safe and went on to give a confident boolean or number for a member read that the host answers with a TypeError.
  • 69e67d3: The node environment now models the host's real throw and value behaviour for its url, crypto, child_process, util and assert modules.

    • node:url's URL and URLSearchParams and node:util's TextEncoder and TextDecoder are constructors now. They are declared as plain functions, so new URL("https://x.dev/a") was reported as a call that may throw a TypeError ("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:assert no longer claims that an assertion never fails. ok(false), strictEqual(1, 2), deepStrictEqual({a:1},{a:2}), notStrictEqual(1, 1), match("abc", /z/) and fail() throw an AssertionError in the host, and the declarations now say so: an assertion that is known to fail throws an AssertionError, an assertion that is known to hold throws nothing, and an argument the engine cannot pin down may throw. A missing argument to strictEqual throws a TypeError, the way the host does.
    • node:url's fileURLToPath no 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 a TypeError instead of quietly returning a string.
    • node:crypto's createHash, randomBytes, randomInt, pbkdf2Sync and timingSafeEqual now carry the throw the host throws for an out-of-range argument: an unsupported digest name throws an Error, an out-of-range size, iteration count or key length throws a RangeError, and two buffers of different lengths throw a RangeError.
    • node:util's promisify, callbackify, inherits and isDeepStrictEqual take their function arguments through the apply path, so the argument is no longer bound as a type variable. The signatures are unchanged.
    • url.pathToFileURL returns the full URL face (eleven components plus toString and toJSON) instead of a one-slot { href } object, so reading .pathname or .protocol no longer yields undefined, and reading a member of one of them no longer looks like a guaranteed TypeError.
    • child_process.spawnSync returns the full face of the host's result: pid, output, signal, status, stdout, stderr and error. Reading .pid no longer yields undefined, and reading .output[0] no longer looks like a guaranteed TypeError.
  • 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 双报)完全保留。
  • 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

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-safe parseVersion(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 支持 ctor facet 并给 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 宿主路径同口径)。
  • 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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/Date no longer shadow away call/construct

    Declaring nudo.env (e.g. "es") bound these globals as namespace-only objAbs objects. Once shadowed, Number(x) and new Array(n) found nothing callable/constructible and degraded to unknown — the opposite of the host identity path (no env), which folds via GLOBAL_FNS / $new's cls === Array.

    Dual-facet globals now model both faces (issue #58 option 1):

    • Abs fn may carry static slots (Number.isFinite, Array.isArray, …). $get / $in read them; typeof stays "function".
    • $new dispatches Abs constructors by name through evalBuiltinNew (Array/Date/Promise/Number/String/Boolean/Map/Set/Error), instead of only the Error/Promise special cases.
    • ES env declares Number/Array/Promise/Date as callable envFn with static slots and a ctor name, so call, construct, and statics all keep builtin semantics under env shadowing.

    Number(s) folds to number, new Array(n) to a holey tuple, and Number.isInteger / Array.isArray stay precise with nudo.env declared.

  • Updated dependencies [662aeb5]

    • @nudojs/core@1.2.2

0.4.8​

Patch Changes​

  • 5494f67: fix(env): Math.min / Math.max / Math.hypot are variadic

    The ES env declared them as binary (envFn([prim.num(), prim.num()], num)), so Math.min(a, b, c) — the ordinary usage — no longer matched the arity, and the call degraded to unknown. On a real project this turned an OSA Damerau–Levenshtein implementation into unknown and failed 8 case assertions the moment nudo.env was 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 yield number instead of unknown.

  • 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/env now 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/env slot if you needed harvest's version; otherwise no code change. Conflicts emit a nudo:env-harvest-conflict warning 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-call onConflict), 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=off stays explicit and uncached. clearNodeHarvestCache() also drops not-found misses so a later @types/node install is visible in-process. nudo:env-harvest-conflict warnings point at the conflicting import specifier when found (file-level line 0 otherwise).
    • @nudojs/env (minor): events / stream / querystring; high-frequency util slots; Promise APIs only under fs.promises / node:fs/promises (callback-style fs.readFile etc. no longer pretend to return Promise). Optional Node params (path.basename ext, url.URL base) keep typed labels (ext?: string) but are not required slots — requiredFnArity skips ? / ....
    • @nudojs/core (patch): formatShape renders fn rest labels (...paths) and optional labels (options?) as ...name: T / name?: T. leqAbs fn arity uses required slots only (requiredFnArity skips ...rest / name?): src is assignable to tgt iff src.required ≤ tgt.required (TS-like — rest src ⊑ required tgt; required src ⊭ rest tgt when src requires args). Pairwise paramTypes contravariance is unchanged.
    • @nudojs/lsp (patch): freeze inventory in public-api.ts (also exported as @nudojs/lsp/public-api); agent slash requests register from NUDO_AGENT_TOOL_NAMES; selectCase / getActiveCases are 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.0 after the next release, and prefer leaf-clean coverage counts (empty { } shapes are not leaf-clean) over raw resolved ratios.

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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

Patch Changes​

  • Updated dependencies [aea83f6]
    • @nudojs/core@2.0.0

0.2.5​

Patch Changes​

  • 61b8a6c: Fix soundness issues in Abs evaluation:

    • parseInt honors hex/octal/binary prefixes and explicit radix (no forced radix 10)
    • Array.isArray returns unknown boolean for any/unknown/sum, and sees through brand
    • Date.now() is an unknown number, not a folded wall-clock timestamp
    • strict numeric bounds win over non-strict at equal value (order-independent)
    • boundsSatisfiable no longer downgrades strict bounds via redundant ge/le
    • structural absShapeKey stops join/dedup collapsing distinct arrays, overloads, brands
    • denoteGuard renders NaN/±Infinity correctly
    • String.split with non-literal separator returns arr<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:env actually affect inference: declaration-only fnSigs (readFileSync) now become relationFns instead of unknown-on-call, B-path $invoke implements string methods and filters union members, and collectAbsCallRecords merges 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 --version reads the real package version, and nudo check accepts 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-node are replaced by a single @nudojs/env package 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/mcp is removed. @nudojs/lsp now exposes nudo.whatIf, nudo.suggestCase, nudo.trace, nudo.selectCase, and nudo.getActiveCases via workspace/executeCommand (custom-request aliases nudo/whatIf etc. included), adds pull-mode diagnostics, and works on files that are not open in the editor (disk fallback). nudo.whatIf now 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 at packages/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 / 指纹,无需手工清缓存。core formatShape 的展示面不发布生成器身份(既有契约,逐字不变)。

    残余批次(同批发布):

    • A2 声明/收割面:declare class 类值挂 callable:false;JSON.stringify(obj, 类构造器) 由 may-throw 升为确定抛 TypeError。HarvestSig.fn 新增 callable 字段、HARVEST_DISK_ABI v14 → v15(~/.cache/nudo/deps/ 旧收割缓存会干净 miss,无需手工清理);harvestedValueToAbs 的 absFunction mock 重建也整包搬运槽位。
    • 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).

    • Shape fn branch gains optional overloads?: FnOverload[] ({ paramTypes, returnType }[], declaration order = TS resolution order). Absent ⇒ every existing shape, key, and projection is byte-identical.
    • instantiateReturn dispatches on overloads: first arm in declaration order whose arity matches and whose params accept the arguments (per-param leqAbs, α 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). HarvestSig gains overloads so disk-cache round-trips keep the dispatch face; HARVEST_DISK_ABI v13 → v14 (old entries miss cleanly instead of silently losing overloads).
    • absKey includes overloads (distinct overload sets no longer share memo/fingerprint); substShape substitutes arm Abs data; snapshotAbs deep-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 check goes from 2 L2 entry-may-throw false reds (method 'toFixed' missing on string receiver / symmetric) to OK, matching tsc --strict exit 0; useNum() => string / useStr() => string exact. 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

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.ts shared factory consumed by both node.ts and web.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/service writeFileAtomic (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 a domainIssuesFromDiagnostics alias, lsp agent-tools drops its copy (Bug 632/1038 drift class closed).
    • ESM AST detection: core isEsmProgram exported via internal; service abs-modules-graph deletes its verbatim copy.
    • dependency collection: core collectDependencySpecsWithMode (import/require mode labels, Bug 238) replaces service's importSpecs/collectRequireSpecs copy; collectDependencySpecs stays a thin shell.
    • string-aware scan skeleton: core text-scan grows findTopLevelChar / walkTopLevelChars primitives; parser findReplaceSeparator / literalNestingDepth / outerParensWrapAll / findTrailingCommentStart consume 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.ts numericOpTail; AST walk skeleton unified in algebra/ast-walk.ts (skip-key differences parameterized); errorTypeAbs leaf module (algebra/error-type-abs.ts) breaks the fake cycle that forced super-access.ts to keep a copy; brand slot reads shared via builtins/brand-slot.ts.
    • harvester: dts-contract-draft memberKey delegates to exported computedMemberName.
    • LSP stdio framing: shared scripts/lib/lsp-framing.mjs frame reader for both smoke scripts.

    Dead exports removed (zero product consumers): bodyReadFieldsFor (service-emit), paramName (parser ast-guards), loadHarvestEnvFromDisk / harvestToAbsModules / summarizeNodeEnv (harvester), plus streamOptions dead block in env node.ts; service-emit barrel narrowed to externally-consumed symbols (16 removals, api docs regenerated en+zh). generateDts stays exported (cross-package test use).

    Docs: api/harvester.md (en+zh) no longer claims autoHarvestModules / harvestNodeTypes are exported from @nudojs/service (they live in @nudojs/harvester).

  • fd0fb09: Dedup batch 7 (jscpd --min-tokens 70 re-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) → single storageObj const (messagePortSlots pattern); exec-family options obj (execSync / execFileSync / spawnSync) → shared execSyncOptions; 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 → emitterCoreSlots shared by the EventEmitter brand and the process global object.
    • env node.ts path family — the drifted manual-sync pair: the top-level pathModule inlined the whole member table next to the platformPathMethods(posix/win32) factory and had already drifted (join.required only on the top-level copy). pathModule now 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 .searchParams slot table and the global URLSearchParams constructor share searchParamsCoreSlots (toString / iterator face / size stay per-site; insertion order preserved).
    • core builtins/error/binary.ts: DataView ctor and makeTypedArrayFromBuffer share bufferByteLengthLiteral (brand→inner obj→byteLength slot fold); TypedArray.of's inlined copy of the number-domain item enforcement now calls enforceTaItem (the .of cause variant is unified into the shared text — no pins).
    • core builtins/object/methods.ts: getOwnPropertySymbols obj arm and brand-inner arm share the ownSymbolsTuple tail (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) share unwrapExportDecl.
    • harvester harvest-dts.ts: resolveIfaceDecls inner-first relative namespace resolution loop (qualified arm + short-name arm) → addRelativeNsHit; absExtends' two es.k === "sum" member folds → foldSumFlags (the cs.k === "sum" fold is intentionally different and untouched).
    • service analyzer-orchestrate-uncached-cases.ts: the two expected-slot enforcers (literal face / predicate face) share actualSlotTable (obj direct / brand inner-obj unwrap).
    • lsp server-navigation.ts: onDefinition now uses the shared navigationIdentAt preamble (documents.get → isNudoFile → parse → ident-at-position) like onReferences / onPrepareRename; Bug 751 gate comment kept.
    • lsp agent-tools.ts: suggestCase / trace share the analyzeToolFile preamble (resolveToolFile → readSource → analyzeFileAsync "all", Bug 993 async preload).
  • 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 module records, 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 emits index / open (and slot optional / readonly) via objOf(slots, opts), so the interface and type alias forms harvest identically.
    • BUG-126: signatureToFnSig computes optionalParams (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 ModuleDeclaration falls 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.get uses the same \0 separator as set (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-based relationFingerprint — an optional-member DAG no longer explodes (17.4 s + RangeError → ~1 ms).
    • BUG-252: inferFrom / condFallback are emitted into relationFn options, so the persisted env module no longer degrades a conditional type to any (and the L1 gate stops being falsely green).
    • BUG-253: emitEnvModule no longer writes promoted interface members into the env's globals / module records.
    • BUG-265: a new private bag (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 of mock (so widenUncertainLiteral stops widening them), and the harvest JSON ABI is bumped v11 → v13 with the promoted-member provenance persisted — a cold and a hot nudo export are now byte-identical.

    Regression tests: harvester-bug-{123,124,126,141,142,143,144,212,213,252,253,265,280}-* and the ABI literal in harvest-bug-803-disk-facet-roundtrip.test.ts bumped to v13 (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.globals still carries promoted members because harvest-bug-807-method-two-paths and harvest-bug-808-promoted-optional-member assert exactly that shape.
    • harvest-disk.ts still swallows harvest failures (catch { h = null }); PackageHarvest has no diagnostic channel.
    • Core-side residual risk: absKey remains exponential on shared DAGs, so absFingerprint (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/node 24 path、lodash LoDashStatic 的 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。

  • 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 顶层的 CJS export = 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 也登记限定名(命名空间里的 class NodeJS.Process 的实例面可解析)。

    Bug 804 — 映射类型 / 模板字面量类型 / 索引访问类型(以及 keyof / typeof)落 unknown 后,declare const 整条绑定被丢弃 ⇒ 用户代码引用 它时被判「确定抛 ReferenceError」(L2 假红;tsc --strict exit 0)。

    • harvest-dts.ts 的 materialize var 分支:类型判不出时保留绑定(值为 unknown)——「类型未建模」是降级(值域未知),不是「符号不存在」⇒ 不再计入 skipped(丢了才计入)。

    Bug 826 — 收割的 declare class 类值没有 ctor facet ⇒ new X() 被判「可能抛 TypeError(可构造性未知)」⇒ L2 假红。

    • harvest-dts.ts 的 classValueAbs:类值走 absCtorSig(带 ctor: true facet)—— core 的 new 路径按 callee 的 ctor facet 判可构造性。
    • harvest-to-abs.ts 的 harvestedValueToAbs:mock 化时透传 ctor facet(否则又变回「可构造性未知」)。
  • 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 --strict exit 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。
  • 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 进入接口成员表并带 ctor facet(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)的既有正确处理:

    1. 条件类型:新增 ConditionalTypeNode 分支 ⇒ 判不出时取两支并集 (收割面 mapConditionalType 同口径),extends unknown 的恒真形态只取真支; 不再整条降级 any(),且降级明确可见(note ⇒ 计入 skipped)。
    2. 计算成员名:memberKey 按收割面 computedMemberName 同口径认 Symbol.iterator → @@iterator / Symbol.asyncIterator → @@asyncIterator / 计算键的字符串字面量 ⇒ 不再整条丢弃;不可静态判定者留 note ⇒ 部分丢失时汇总行也看得见(此前只在「全部成员被丢」时才发 note)。
    3. extends 基接口成员:collectSymbols 按限定名登记(命名空间内的 interface 登记为 A.Opts),interfaceMembers 按限定名解析基类 ⇒ 基接口成员进草稿,且 A.Base 与 B.Base 不互相并入。
    4. 命名空间限定名:A.Opts 能解析(此前只有短名桶 ⇒ 降级 any())。
    5. class 构造器签名:投影为类值的构造器 fn(收割面同款:类值 = 构造器) ⇒ new Thing(…) 不再零义务;该条计入 skipped(契约 DSL 无 new 语义 ⇒ 需人工审阅),汇总行不再说谎。
    6. ambient module 体:declare module "x" { … } / declare global { … } 的体被遍历 ⇒ 内部导出进草稿且计数(此前整块不可见也不计数)。
    7. 重载 arity:元数相同 ⇒ 形参按位合并(并集,不比 TS 更严, 收割面 Bug 827 同口径);元数不同 ⇒ 仍取首个 overload(改成最宽会让 f("a") 变成「参数不够」⇒ 假红)但明确标注窄口径(note 写明 arity 与 「多参调用不在覆盖内」)。
    8. 跨文件再导出 / 跨文件导入的类型:名字可见、降级可见且计入 skipped(类型需模块解析器 ⇒ 本片无法闭合,已如实标注为剩余缺口)。

    草稿面不比 TS 更严(新投影只会更宽:并集 / 可见降级),负控形态(与族 51 无关的 声明)的草稿输出逐字不变;既有金标全绿(packages/harvester 72 个测试文件 / 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 --draft now 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 default therefore got the synthesized key _default, while the key that actually binds is default — copying the draft into *.nudo.js left the contract in place but inert, and nudo check stayed green on a call that violated it. The key is now the export identity (the same source as nudo contract --emit), and an unsafe binding name is emitted in the alias form const _nudo_N = …; export { _nudo_N as <identity> };.
    • The builder import and the generated export const <name> shared one module scope, so a function whose name is a builder name (number, lit, union, …) produced import { number } from "@nudojs/core" next to export const number = … — a parse-time SyntaxError: 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-dts draft.
    • 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 as not-projectable and 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) returning 1 | null was drafted as fn({ 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 the nudo check signature) and is not written when it does not cover it.
    • --draft --write overwrote a hand-edited *.nudo.draft.js without 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.
  • 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

Patch Changes​

  • aae0f96: Fix stale-cache windows in cache keys and session eviction. nodeHarvestCacheKey floored mtimeMs to whole seconds (same-second, same-size rewrites of @types/node reused a stale harvest — now uses the raw float mtime, matching the repo-wide mtimeMs+size strict-equality contract). The path-env cache key/validation only compared mtimeMs (coarse-mtime filesystems could keep serving a stale defineEnv factory and re-register it, self-perpetuating — now mtimeMs+size, and the direct-import URL query carries size so the ESM module cache can't replay old content). The path-env fallback copy filename hashed only path: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, so pnpm install / watcher rounds see upgraded or newly installed @types without a process restart. checkMemoKey now normalizes filePath via stablePathKey (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 single statSync(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 on e.code: sidecar contracts unreadable for reasons other than ENOENT print a warning: cannot read sidecar contract … in check/check --fix (no more silent contract-blind green runs); @nudo:mock seed evaluation failures warn in export before degrading; pnpm-workspace.yaml read failures other than ENOENT abort migrate (a snapshot/read failure no longer disguises the file as "other" and skips rollback); mock files that exist but can't be read report read-failed with 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-dts path-like arguments that don't exist now error as path not found instead of being treated as npm package names ending in a misleading no .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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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/service god package: harvest → @nudojs/harvester, IDE surface → @nudojs/lsp, emit products consolidated under @nudojs/service/emit.

    BREAKING for @nudojs/service subpath consumers:

    Removed subpathMigrate 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/service keeps ., ./analysis, ./evaluator, ./emit. The language server moves to @nudojs/lsp/server (bin nudo-lsp unchanged); @nudojs/lsp is now a side-effect-free library entry re-exporting the IDE surface.

    No dependency cycles: lsp → service, harvester stays independent of service. 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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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
  • 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 --version reads the real package version, and nudo check accepts 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 @types during analysis-path harvest and guard oversized dts work.

    • Analysis can resolve package roots upward and feed harvested Abs into the B module graph.
    • harvestDts accepts optional maxFileBytes / maxMs and 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 interface terminology to contract end to end.

    • Core: effectiveInterface → effectiveContract, InterfaceSource → ContractSource, InterfaceTierInfo → ContractTierInfo, interfaceTierOf → contractTierOf, takeInterfaceDiags* → takeContractDiags*, and the algebra/interface/ directory → algebra/contract/.
    • Service: emitInterface / draftInterface / interfaceSurface → emitContract / draftContract / contractSurface; interface-*.ts files → contract-*.ts; ifaceCacheKey → contractCacheKey and the disk-cache namespace iface → contract.
    • Diagnostics: nudo:interface-* → nudo:contract-* (no alias layer).
    • CLI/LSP: CodeLens titles ⚡ persist contract / ↻ update contract / ⚡ draft contract; agent messages no contract found / no contract changes; CheckIssue actions and hover/inlay fields use contractSource / contractDisplay / contractActive.
    • Docs, examples (contract-derivation/, contract-draft/), API snapshots, and website references updated.

    TypeScript's interface keyword, Babel AST TSInterface*, and historical release notes are intentionally unchanged.

  • 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 (buildEvalInjection in @nudojs/service; CLI check/migrate/health, LSP agent tools, and vite-plugin all consume it — the health copy still used the object-spread env merge that Bug 1037 fixed everywhere else, hand-rolled env absolutization, and dropped mockFromErrors); parseIgnoreThrows/configIgnoreThrows (service; CLI / LSP / vite-plugin); CHECK_FACE_DIAG_CODES and CHECK_ISSUE_OPTIONAL_KEYS (@nudojs/core/internal); normalizeRealPath (service; replaces 6 realpath-fallback micro-copies with two divergent identity-key 口径); Object.prototype name list now derived instead of hand-synced; normalizeModulePath/externalAbsCallRecords/stripIssuesByCode shared 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 as null in the process cache; unreadable dts entries count into stats.skipped; nudo migrate enumeration surfaces non-ENOENT failures instead of silently skipping (a chmod-000 package could silently vanish from retire --all); nudo export --out refuses 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 structured nudo:path-io path 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 (use transpileSource) from @nudojs/core, generateGuardFunction (use generateGuardFunctionFromAbs) from @nudojs/service/emit, maybeLeak/leakIfNeeded/resetLeakCounter from @nudojs/core/internal.
    • Behavior notes: nudo health now merges env modules via mergeHarvestUnderEnv (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 surface nudo:internal info 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); analyzeFileUncachedInner module-issue mapping is table-driven; runHealth split into print/json helpers.

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 mergeHarvestUnderEnv instead of object spread — so adding an unrelated @nudo:env line 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-unresolved like 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.

  • 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.include entry 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 的绿构建可能变红 / 静默构建可能变吵):

    1. nudo.analysis.diagnostics: "off" 不再静默契约门禁。此前门禁诊断 (L1 nudo:constraint-violated / L2 nudo:entry-may-throw)与显示通道合并 过滤 ⇒ off 项目零诊断、failOnError: true 也照样绿(坏契约上的 绿灯 CI)。现在门禁通道独立:error 级的 check 诊断在任何档位(含 off) 都照常上报、照常拦构建。
    2. 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 (L1 nudo:constraint-violated, L2 nudo:entry-may-throw) were merged into the display path and filtered together with it, so an off project reported zero diagnostics and a build with failOnError: true still 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 under failOnError: true, in every diagnostics tier including off. 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 bare console.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: true reported 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:col part 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 and grep '(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(本版本一并生效)」逐条说明):

    1. 899 —— nudo.analysis.diagnostics: "off" 不再抹掉契约门禁:error 级的 check 诊断在任何档位(含 off)都照常上报、照常拦构建 ⇒ 此前靠 off 拿到 绿灯 CI 的流水线由绿转红。
    2. 1002 —— build.logLevel: "silent" 下插件什么都不输出(含汇总行) ⇒ 依赖 [nudo] Analysis complete: … 这行做日志采集的脚本取不到该行。
    3. 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 analyze warning —— 构建不炸。

    Breaking behavior changes(本版本一并生效)

    • 899 —— nudo.analysis.diagnostics: "off" 不再抹掉契约门禁。此前门禁 诊断(L1 nudo:constraint-violated / L2 nudo: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/**"] 静默把整份分析归零)。

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 降成 INFO nudo: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): 按 ES2024 OrdinaryOwnPropertyKeys 改两段排列。
    • 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 + 误导的 INFO nudo:opaque-result。check-may-throw.ts 反向 import generalize.ts ⇒ 跨模块复用会成包环 ⇒ 按仓库既有「就地复刻」惯例本地实现 裸实例兜底。
    • nudojs/src/migrate.ts 透出 ctorParamPropsSuperMissing note:core 已置位 但用户看不到 ⇒ 补提示。
    • LSP / service 的项目级 env 预载基准(见上「中危」条)。

    验证​

    全仓 tsc --noEmit(含测试文件)0 错误;pnpm run test 1756 文件 / 14515 用例全绿(exit 0);pnpm run build exit 0;verify-doc-examples.sh 278 checks passed / 0 failed;coverage:env -- --check exit 0。25 条缺陷各配 一条「修前红 / 修后绿」的回归测试(新增 24 个测试文件),高危项另在 产品 CLI 面逐条复现核对(与原生 node v26.10.0 逐值一致)。

  • 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, the shouldAnalyzeFile guard, config.root).
    • check-assembly.ts — assembling the checkSource call and turning its issues into diagnostics.
    • report.ts — the diagnostic reporting loop, failOnError aggregation, the build-end summary, and the single message-rendering outlet.

    index.ts is 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's exports map, 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.entryThrows was ignored during a build: the plugin always applied the strictest level, so a project that had moved the gate to "warning" (or "off") saw nudo check pass while vite build reported an error — and with failOnError: true the build was interrupted. The configured level is applied now, matching the CLI and the editor.

    • package.json#nudo.check.ignoreThrows was ignored for the same reason: a throw class listed there was still reported as nudo:entry-may-throw. The listed classes are ignored now.

  • c52b107: fix(vite-plugin): 补 Bug 901 的回归钉 —— info 不计入 warning 计数 + info 走 info 通道(假阳性片)

    • Bug 901 的核心症状已由族 26 随 f87c9f9d 落地(changeset fix-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), 未改动任何实现:钉住两条已成立的行为 ——

      1. info 不计入 warning 计数:汇总行 [nudo] Analysis complete: X error(s), Y warning(s) 的 Y 只数 warning 级诊断;info 级诊断不计入,且汇总不得比「实际 warning 条数」多。
      2. info 走 this.info 上屏:info 级诊断出现在 vite 的 info 通道,不混进 warn 流 (否则 info 冒充告警)。
    • 该钉在 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.node raised from >=20 to >=22 on all published packages. Node 20 reached end-of-life on 2026-04-30, and the nightly engine-smoke matrix only covers Node 22 (the packageManager-pinned pnpm already requires node:sqlite, i.e. Node >= 22.5, to orchestrate at all). No code or API changes — installs on Node 20 will now warn per npm engines semantics.

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.exclude supports real globs (fix-12 batch).

    • parser: file-level directives (@nudo:env / @nudo:mock-module) written inside JSDoc blocks emit nudo:directive-syntax with the correct /// form instead of being dropped silently.
    • service: nudo.analysis.exclude accepts glob patterns (shared compilePattern, 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.
  • 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() < 1 now TypeError (cmp relational ops); eq/ne unchanged
    • 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 in LiteralValue
    • AbsApplyResult {abs,throws} + callTranspiledExportApply (sole wrap point) + $call throws routing
    • directive-scan single-source extractors; directives bind AST nearest Function (nested/class/object methods)
    • stablePathKey / stablePathKeyGraph for L0/LSP/CLI/disk path identity

    Product / CLI / migrate:

    • check --json path errors enter the CheckJson envelope (pathErrors, ok:false); ok↔exit single source
    • migrate: missing paths error (no parent package.json fallthrough); retire is atomic with rollback; rewritten paths are single-quoted
    • malformed directives warn instead of silent drop; @nudo:skip requires 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-llms confines 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); service analyzer-ast / lsp symbols no longer use as any on 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.ts split into watch/commands/navigation/code-actions/ide modules (public API unchanged); path-env clear on dependent eviction.
    • @nudojs/service: interface-derivation / analyzer-orchestrate split 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 logAnalysisSummary helper (logging surface unchanged).
  • 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-structure now means HOF argument not callable / arity mismatch only. Obligations come from explicit *.nudo.js / @nudo:refine contracts 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.mode shipped default is now exports (was directives). Files with export / 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 for export { 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

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 --version reads the real package version, and nudo check accepts 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 endsWith heuristics).
    • Runs analyzeFileAsync plus checkSource so Abs constraint issues surface as Vite warnings/errors.
    • Exposes clearAnalysisSessionCaches for long-lived Vite processes.

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.mode is forwarded to the language server as initializationOptions and re-pushed on workspace/didChangeConfiguration (only for nudo.* changes). Priority: an explicit project package.json#nudo.analysis.mode always wins; the VS Code setting only provides the default when the project does not set it (also stated in the setting description). nudo.coexistence.suggestMuteTsValidation is consumed extension-side: when false, Nudo: Apply coexistence settings no longer offers the tsserver mute suggestion — only the guide link.
  • Case highlight decorations now parse via @nudojs/parser (parse + extractDirectivesQuiet, the same @nudo:case grammar as the server) instead of a parallel regex implementation in the extension; pure span computation lives in src/case-decorations.ts (unit-tested), the extension only maps spans to vscode.Range.
  • Bundle fix: tsup auto-externalized dependencies, so out/extension.js shipped unresolvable require("vscode-languageclient/node") (and would have for the new @nudojs/parser) while the vsix excludes node_modules/. tsup.config.ts now bundles both into the self-contained out/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/lsp dist) over IPC instead of tsx + 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 git Version Packages commits.

0.3.0​

Minor Changes​

  • Ship the B-path engine line with the monorepo 0.3 packages (@nudojs/* 0.3 / @nudojs/lsp 0.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