Skip to content

refactor(cli): render sqb plan output natively - #1099

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-plan-output
Oct 13, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-plan-output

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Why

Phase 3 of the Rust-hosted SQLBuild port (CHI-592): CLI output rendering moves to Rust. This step covers sqb plan (text and JSON) and the plan section printed by sqb build.

Changes

  • Plan text and completion formatting in sqlbuild-core cli_text (sections, tree rows, bounded sections, plan document).
  • Glue in bindings/_helpers/plan_output/ reads planner objects by attribute; planner logic stays Python.
  • New native functions: format_plan, format_plan_json, serialize_future_cursor_safety, serialize_maximum_start_safety.
  • Deleted cli/output/_helpers/{plan_text,plan_json,cursor_plan,future_cursor_safety,maximum_start_safety,selection_diagnostics}.py and cli/output/main/{plan,_plan_json}.py.
  • Two planner display modules called only from Rust renamed with a leading _.
  • Movable Python: 118,042 → 115,330 lines.

Intentional differences: integer microbatch batch_size parsed in Rust; planned batch counts cap at i64::MAX; cursor details are computed for every non-skipped model, including rows beyond the display limit.

Verification

  • Real CLI runs on 17 DuckDB projects × 16 plan/build/test variants (text, JSON, colour, verbose, full refresh, after edits): no differences.
  • Independent review compared ~9,000 generated plans against the deleted Python: no differences.
  • 6,580 focused tests incl. plan e2e; compiler differential; byte-identical 1k compile output; make check-ci; hygiene scan.

@kvlonge
kvlonge enabled auto-merge (squash) October 13, 2026 07:35
@kvlonge
kvlonge merged commit ea5e93d into main Oct 13, 2026
40 checks passed
@kvlonge
kvlonge deleted the feat/native-plan-output branch October 13, 2026 08:12
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