Skip to content

refactor: move the project layer of the Python bindings into sqlbuild-python-project - #1520

Merged
kvlonge merged 15 commits into
mainfrom
refactor/python-project
Nov 16, 2026
Merged

kvlonge merged 15 commits into
mainfrom
refactor/python-project

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

sqlbuild-python is over the crate size limit. This slice moves the project layer into its own crate and removes the one-line main/ forwarders the split added, here and in sqlbuild-python-front.

Changes

  • New crate sqlbuild-python-project holds the compiled project and its views, graph, planner, analysis session, SQL test glue, snapshot, references, lineage, fingerprints and contracts. Every old path is deleted and its callers updated. There are no re-exports.
  • In front and project, a main/ entry now holds the body it used to forward to, as sqlbuild-rules does. _helpers imports it back where needed. 37 entries still forward because their bodies are over the entry size budgets.
  • Imports the move split are grouped again where the source grouped them.
  • fensu: the sqlbuild-python cap is lowered, and XSB072/XSB073 budgets are re-keyed (totals 3,603→3,602 and 1,520→1,517). Allowlist entries cover existing duplicates the move touched.

Code-line growth of the sqlbuild-python* crates:

before fold after
this PR vs main +5,096 +1,329
main/ forwarders (bodies, use, mod) +3,572 37 left
use lines +2,064 +1,761
records written out +420 +420
re-exports 0 0

13 of the +1,329 name long record tuples for clippy.

Public records stay written out: they live in models.rs, where FPRSR001 allows no macro calls.

No DuckShop case: this is a behaviour-neutral Rust move with no new project shape, value or lifecycle.

Verification

  • The _native surface is identical to main's build.
  • A dense 3,000-model compile gives identical JSON and identical files (11,175) to main.
  • Dense timing vs main, 7 alternating runs: cold 7.52→7.57 s wall, warm 0.51 s both, edit 1.55→1.54 s.
  • After merging main, fensu, clippy and the build tests pass. Before it: make check-ci passed; make test: 12,296 passed; 14 failures are the known local ones that need Docker or an installed sqb as on slice 3.

…ython-front

Discovery, model configuration and headers, scopes, macro rendering and
authored values, SQL text, model attachment and the compile driver, cursors,
contract and refactor facts, and the consumption, observation and audit result
state tables move into a new crate between sqlbuild-python-base and
sqlbuild-python, one area per helper bucket. sqlbuild-python imports their
entry points directly; the extension module surface is unchanged.
…servation boundary

The observation boundary matched `observations_state` as a whole word, so the
`append_observations` and `register_observations_state` entries the front crate
exports, and the files that call them, fell outside it after the move. The
pattern now names both entries, and their callers are listed again.
Incomplete: both crates compile with no warnings; fensu layout findings
(helper containers, models roles, tuple arity, Debug derives) and the
pipeline's budget, allowlist and readme steps are still open. Not tested.
Groups the moved helper modules into buckets, splits the snapshot and
resource views into their own areas, keeps the native_host edge, and
records Debug and record-tuple exceptions. fensu check passes; new
duplicate clusters are not allowlisted yet. Not tested.
Gives each cluster the move touches a reason in [dupes]; fensu dupes
reports no new clusters against the slice base. Not tested.
Keeps both rules imports, and sets the sqlbuild-python cap to the
measured 169,863 code lines (main's 72 added lines on top of 169,791).
SchemaHandles prints no fields again, so audit arguments stay out of
Debug output. Removes the budgets of the deleted bindings/models.rs
and merges repeated duplicate allowlist entries.
@kvlonge
kvlonge enabled auto-merge November 16, 2026 15:36
# Conflicts:
#	crates/sqlbuild-python/src/bindings/_helpers/planner_strategy/constants.rs
#	crates/sqlbuild-python/src/bindings/_helpers/planner_strategy/model_entries.rs
#	fensu.toml
@kvlonge
kvlonge disabled auto-merge November 16, 2026 15:55
@kvlonge
kvlonge added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 50bcf76 Nov 16, 2026
33 checks passed
@kvlonge
kvlonge deleted the refactor/python-project branch November 16, 2026 17:18
kvlonge added a commit that referenced this pull request Nov 17, 2026
Slice 4 of the large-project integration replay. Moves the planner,
graph, fingerprint, analysis and resource-view helpers into the project
crate as #1520 did, keeping the large-project tree's own changes
(relation-name prefetch, dialect-bound planner strategy, live reads).

Validation so far: cargo check --workspace --all-targets passes with no
warnings, and the file layout matches #1520's tree. Not built or tested
yet. fensu check reports about ten more layout faults than the previous
wip commit; they are left for the final pass after the main merge.
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