fix(extract): emit nodes for exported scalar bindings - #2300
fix(extract): emit nodes for exported scalar bindings#2300oleksii-tumanov wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This pull request modifies the JavaScript/TypeScript extraction logic in graphify/extractors/engine.py so that simple exported scalar const bindings (e.g. export const NUMBER = 42;) emit nodes, whereas previously only function-valued or object/array/call/new initializers did. It introduces is_exported and is_exported_scalar_binding checks that gate this behavior on module-level exported identifier declarations that normalize to a non-empty ID. The PR also adds a new test file tests/test_js_exported_scalar_bindings.py covering that exported scalars emit nodes (while internal/local scalars do not), that certain binding patterns like destructuring and $/_ names are excluded, and that exported bindings satisfy named import targets across files.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 565 functions depend on the 175 node(s) this change touches.
Health — this change adds coupling hotspots:
- worse:
extract_js()— 74 callers, 2 callees
Verification — 565 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 506 function(s) in the blast radius were not formally verified this run
· 1 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #2266
Result
For a scalar
A_PREFIXbeside call-initializedA_MAX:Testing
uv run --frozen pytest tests/test_js_exported_scalar_bindings.py tests/test_languages.py -q --tb=short(335 passed)uv run --frozen pytest tests/ -q --tb=short(3851 passed, 3 skipped)uv run --frozen ruff check graphify/extractors/engine.py tests/test_js_exported_scalar_bindings.py(passed)uv run --frozen python -m tools.skillgen --check(passed)