Skip to content

fix(extract): emit nodes for exported scalar bindings - #2300

Open
oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/exported-scalar-bindings
Open

fix(extract): emit nodes for exported scalar bindings#2300
oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/exported-scalar-bindings

Conversation

@oleksii-tumanov

Copy link
Copy Markdown
Contributor

Summary

  • emit nodes for simple exported JS/TS bindings with scalar initializers
  • preserve suppression for non-exported/local scalars and avoid malformed nodes for unsupported binding patterns
  • cover JS/TS scalar shapes and final named-import target integrity

Fixes #2266

Result

For a scalar A_PREFIX beside call-initialized A_MAX:

exported nodes: ['A_MAX', 'A_PREFIX']
dangling named-import targets: 0

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)

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TS/JS AST extractor creates no node for export const with a scalar initializer

1 participant