Skip to content

chore: add a Python boundary ratchet for the Rust-hosted migration - #1089

Merged
kvlonge merged 4 commits into
mainfrom
chore/python-boundary-ratchet
Oct 12, 2026
Merged

kvlonge merged 4 commits into
mainfrom
chore/python-boundary-ratchet

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Why

SQLBuild is moving to a Rust-hosted architecture where Python remains only for user code, adapters, the executor and public Python APIs. Earlier migration work left Python drivers and fallbacks in place. This makes completion measurable and stops new Python or Python fallbacks from slipping in unnoticed.

Changes

  • python-boundary.toml lists the modules that stay Python, each with a reason (user-code, adapter, executor, public-api) and a note. Every other Python file under src/sqlbuild is movable; remaining_lines (146,314 today) must equal their line count, so adding movable Python fails and every reduction lowers the committed number.
  • The same check fails when code swallows a native failure: a try or suppress around a native call (including _native_* wrapper modules) whose handler does not raise on every path. Four reviewed exceptions are listed with reasons (cache misses and a reported lint error, not Python fallbacks).
  • make check-python-boundary, included in make check-ci.
  • AGENTS.md: migration rules (delete replaced Python, no fallbacks, allowlist changes need a reason and user approval, moving code into a staying path is not progress).
  • New E2E: a project-local adapter's render_create_table_as override is used by sqb build.

Verification

  • uv run pytest tests/unit/scripts/python_boundary tests/e2e/src/sqlbuild/cli/commands/main/adapters
  • make check-ci (includes the new check against the repository)

@kvlonge
kvlonge enabled auto-merge (squash) October 12, 2026 13:18
@kvlonge
kvlonge force-pushed the chore/python-boundary-ratchet branch from 67f69ff to 3324231 Compare October 12, 2026 13:34
@kvlonge
kvlonge force-pushed the chore/python-boundary-ratchet branch from 3324231 to ec1c636 Compare October 12, 2026 14:14
@kvlonge
kvlonge merged commit a6d4f9f into main Oct 12, 2026
36 checks passed
@kvlonge
kvlonge deleted the chore/python-boundary-ratchet branch October 12, 2026 14:58
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.

1 participant