Skip to content

v1.9.1 — Per-Symbol split_file (Item B)

Choose a tag to compare

@o2alexanderfedin o2alexanderfedin released this 30 Apr 04:32
· 140 commits to main since this release

v1.9.1 — Per-Symbol split_file (Item B)

Closes the v1.6 Plan 3 deferral and the long-standing E1-py 4-way split byte-identity e2e test.

Highlights

  • _RopeBridge.move_global — AST-based identifier offset + rope.Project.do in-place apply.
  • _split_python rewires for per-symbol path — moves are applied in-place via rope.Project.do, NOT batched. Batched edits don't converge because MoveGlobal.get_changes is computed against the current view; per-symbol moves only converge when each iteration writes to disk and refreshes rope's project state.
  • _rewrite_package_reexports post-pass — rope's MoveGlobal updates direct importers but not package-level from .OLD import S patterns in __init__.py. The post-pass parses every .py under the project, locates ImportFrom nodes targeting the source module (relative imports keyed by basename + parent-dir match; absolute imports keyed by full dotted path), and rewrites the moved names onto the new modules. Avoids rewriting from calcpy import X (the package) when only calcpy.calcpy (the module) was the source.
  • Reverse iteration — rope's MoveGlobal prepends each moved symbol to the target file; iterating reversed(members) yields the user-supplied order in the target. Critical for forward declarations like Expr = Union[Num, Add, ...] which need Num/Add defined above.
  • Buffer-aware eof preflight in spike S6.

Engine submodule

Bumped to 550561ba (tag v1.9.1-split-python-symbol-list on o2alexanderfedin/o2-scalpel-engine).

Tests

test_v19_b_split_python_per_symbol_move.py is the contract. E1-py 4-way split byte-identity (failing for >30 days) is GREEN.