Repository navigation
Refactor #1295: extract bounded reentry glue from lowering.py - #1299
Merged
Merged
Conversation
Moves 16 reentry helpers (~470 LOC) out of cypher/lowering.py into a focused cypher/reentry/ subpackage: - naming.py — hidden-column / carry-name conventions (4 helpers) - scope.py — alias-scope traversal for hidden reentry refs (2 helpers) - carry.py — prefix carry-column / order helpers (4 helpers) - rewrite.py — AST/query rewriters for reentry expressions (7 helpers) All names are re-exported from cypher/lowering.py so existing callers keep working unchanged. The moved modules import lowering lazily inside function bodies for the few helpers (_unsupported, _render_expr_node, _rewrite_where_clause_and_resync, _first_pattern_node_alias, etc.) they still need from lowering, avoiding circular imports at module load. lowering.py: 10192 → 9684 LOC (-508). The orchestrator (_compile_bounded_reentry_query) and _map_terminal_reentry_query intentionally stay in lowering.py for this slice — they share heavy edit surface with the sibling #1294 dual-contract retirement (PR #1297). A follow-on slice can move them once #1297 lands. Refs: #1260 S2 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
lmeyerov
force-pushed
the
1295-extract-reentry-glue
branch
from
May 5, 2026 02:37
0b2be45 to
76990fd
Compare
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GFQL monolith shrinkdown S2 (#1260): extract bounded-reentry helpers from
cypher/lowering.pyinto a focusedcypher/reentry/subpackage._literal_limit_value, ~470 LOC) intonaming.py/scope.py/carry.py/rewrite.py.cypher.loweringso existing imports keep working unchanged (gfql_unified.py:35,tests/test_gfql.py:8).from graphistry.compute.gfql.cypher import lowering as _loweringinside function bodies for the few lowering helpers still needed (_unsupported,_unsupported_at_span,_render_expr_node,_rebuild_expr_node,_rewrite_expr_identifiers,_rewrite_where_clause_and_resync,_first_pattern_node_alias,_parse_row_expr). Avoids circular imports at module load.carry.pydeclaresResultProjectionPlanas aTYPE_CHECKING-only forward-string back-edge to lowering.lowering.pyLOC: ~10,192 (pre-#1297) → 9,659 (post-#1297 + this PR).Out of scope (per #1295/#1260 S2 framing + #1294/#1297 guardrail)
_compile_bounded_reentry_queryand_map_terminal_reentry_querystay inlowering.py. These are Refactor #1294: retire dual-contract reentry extras path #1297 hot zones; deferred to a follow-on monolith-shrinkdown slice. Diff verified to leave both untouched.Validation
pytest -q tests/compute/gfql/cypher/ tests/compute/test_gfql.py: 1235 passed, 92 skipped, 15 xfailed, 0 failed./bin/ruff.sh graphistry/compute/gfql/cypher/: clean./bin/typecheck.sh graphistry/compute/gfql/: 73 source files cleanfrom graphistry.compute.gfql.cypher.lowering import ...Multi-wave review
agents/skills/review/SKILL.mdflow: 3 parallel reviewer agents (correctness/symbol-parity, architecture/conventions, testing) in Wave 1; solo amplification in Wave 2. Both waves non-significant-advance (0 BLOCKER / 0 IMPORTANT). 6 cosmetic SUGGESTIONs all about helper-count phrasing in CHANGELOG, addressed in this PR.Refs
lowering.pyLOC reduced materially; existing tests green)Test plan
pytest tests/compute/gfql/cypher/ tests/compute/test_gfql.py./bin/ruff.sh+./bin/typecheck.sh🤖 Generated with Claude Code