diff --git a/docs/plans/2026-10-18-2259-fix-lexical-binding-provenance-plan.md b/docs/plans/2026-10-18-2259-fix-lexical-binding-provenance-plan.md index 0a3ee9fc5..c9ac47dd9 100644 --- a/docs/plans/2026-10-18-2259-fix-lexical-binding-provenance-plan.md +++ b/docs/plans/2026-10-18-2259-fix-lexical-binding-provenance-plan.md @@ -252,7 +252,8 @@ Every requirement and issue acceptance table is covered, no unjustified call-tar - Profiling the 512-unit wrapper arm showed native node construction (`namedChildren`, `childForFieldName`, `id`) dominating context construction. `7fcf3506c` limits the lexical-binding walk to functions whose formals contain an expression; `6061ca71b` collects wrapper evidence in one tree-cursor walk that materializes only inspected nodes and keys declarations by start offset. On the 512-unit wrapper workload, context construction fell from 58 to 48 ms. - Review of `61de364ff` found that star exports reaching two export names of one declaration (`export { request, request as send }` behind two barrels) were counted as conflicting, which blocked the import and dropped its FETCHES edge. `4d62bd045` keys star-export candidates by the declaration each name refers to; distinct declarations stay ambiguous. A unit diamond and a real-parser fixture pair cover both cases; with the fix reverted only the diamond edge disappears. - A multi-lane review of `5c179994c` (review 5575463241) found two recall regressions and several smaller gaps; `3c00b9f32` and `d3c357276` fix them. CommonJS wrappers captured as their assignment produce facts again. Name-only fallback considers only definitions that can be the target (module-level exports for an unresolvable import, top-level functions for an undeclared global). Only possible wrappers and module-level functions are emitted, and the index is built only with routes and candidate calls. Rebound bindings prove no wrapper across files; `(x) = …` is a write; calls inside recovered syntax and instance-field initializers resolve; local exports make star-export conflicts visible; resolved barrel frames are shared; HTTP hooks are guarded per file and failed files still record their function names; an undeclared constructor write keeps its type for reads in the writing scope. Each behavior row fails on the previous source. The receiver baseline counts one new dropped write from the added CommonJS fixture (`9c4821106`). -- Final semantic comparison at `528ea1478` (export fingerprint `4db24f57…`, clean tree, unchanged since `6061ca71b`) keeps the single expected CALLS change; all other CALLS and override edges match the baseline export `3e00ca5b…`. -- Final scaling at `528ea1478` against baseline `565e50276` ran back to back on CPU 23; the host's 1-minute load had a median of 2.51 and peaked at 19.10. Every candidate check stays at or below 1.27 against the 1.8 ceiling. The baseline fails six of nine arms: `position-index`, `position-deep-completed`, `nested-helpers`, `nested-helper-chain`, `reverse-chain` and `name-collisions`. Workload fingerprints match except `name-collisions`, where the baseline's false positive is recorded as `known-baseline-failure`. The three arms that were already linear keep a constant factor over the baseline median at the largest input: 1.13x spread aliases, 1.01x completed scopes, 1.01x wrapper aliases (1.24x, 1.14x and 1.14x on `4d62bd045`; identifier nodes are now materialized lazily, but run-to-run noise on this host is about 0.1x, so the drop is not attributed to it). +- A behavior-preserving simplification pass (`3db8657ba`) shares the CommonJS `module`/`exports` checks, derives `LEXICAL_FUNCTION_TYPES` from the TypeScript `FUNCTION_NODE_TYPES`, reads each node's type once in the route-facts loop, and returns the latest-starting scope from the position index before the max-end search when it already contains the point. Focused suites (5019 tests), build, typechecks and lint pass; the resolver integration files that timed out at 30 s on the 9p checkout pass with a 120 s limit. +- Final semantic comparison at `3db8657ba` (export fingerprint `4db24f57…`, clean tree, unchanged since `6061ca71b`) keeps the single expected CALLS change; all other CALLS and override edges match the baseline export `3e00ca5b…`. The main merge `e2a92dab8` changes no measured file. +- Final scaling at `3db8657ba` against baseline `565e50276` ran back to back on CPU 23; the host's 1-minute load had a median of 2.79 and peaked at 16.94. Every candidate check stays at or below 1.32 against the 1.8 ceiling. The baseline fails six of nine arms: `position-index`, `position-deep-completed`, `nested-helpers`, `nested-helper-chain`, `reverse-chain` and `name-collisions`. Workload fingerprints match except `name-collisions`, where the baseline's false positive is recorded as `known-baseline-failure`. The three arms that were already linear keep a constant factor over the baseline median at the largest input: 1.11x spread aliases, 1.03x completed scopes, 1.02x wrapper aliases (between 1.01x and 1.24x across earlier pairs; run-to-run noise on this host is about 0.1x). - The full suite passed in CI at `61de364ff` (1269 files passed and 12 skipped; 27194 tests passed, 83 skipped, none failed) and again at `5c179994c` (73 checks green). A local full run on the 9p checkout was stopped after four hours in the serial database lane, where real-analysis tests hit their timeouts; it is not recorded as a pass. At `528ea1478`, focused suites (5019 tests), HTTP integration (56), build, test typecheck, lint and formatting pass; receiver accuracy matches the updated baseline and tool accuracy matches (29/32). - Graph impact/change checks remain unavailable: neither repository-wide indexing attempt published an index. Source caller tracing supplements this unknown result; no clean or low-risk graph result is claimed.