Skip to content

refactor(intent_algebra): rename legacy_expr → relational, legacy_to_canonical → lower_to_canonical - #231

Merged
zzylol merged 1 commit into
mainfrom
pr-rename-legacy
May 14, 2026
Merged

zzylol merged 1 commit into
mainfrom
pr-rename-legacy

Conversation

@zzylol

@zzylol zzylol commented May 14, 2026

Copy link
Copy Markdown
Contributor

PR 2 of the "de-legacy the L1/L2 path" cleanup (follows #228#230).

Why

The legacy_* naming was a misnomer. After #228#230 slimmed it down and #230 deleted the dead language_logical_plan scaffold, legacy_expr is the real, current L2 relational IR every query_parser front end emits, and legacy_to_canonical is the genuine L2→L3 lowering pass. Neither is removable debt — the 5-layer design mandates both layers exist. So: rename them honestly.

Changes — pure rename, no behavior change

  • intent_algebra/legacy_expr.rsintent_algebra/relational.rs
  • intent_algebra/legacy_to_canonical.rsintent_algebra/lower_to_canonical.rs
  • convert_legacy re-export alias → convert
  • All ~25 consumer modules updated to the new paths.
  • Module-header docs + design.md §3/§6 refreshed to describe relational as the L2 IR (not "legacy").

The type stays spelled QueryExpr — consumers already disambiguate it from the canonical query_expr::QueryExpr via the established LQueryExpr alias. A type rename is a separate, larger change if wanted.

"legacy" no longer appears in any live module path or identifier in this area. Remaining "legacy" mentions elsewhere in the tree refer to genuinely pre-canonical code (the untyped optimizer/physical binding path, accuracy_sla, …), not this IR.

Test plan

  • cargo build --workspace clean
  • cargo test -p control_plane — 741 pass (714 + 27), 0 failures (pure rename, test count unchanged)

Remaining in the arc

PR 3 (separate): reconcile the two L3-construction paths — convert_root (string→L2→L3) vs lower_parsed_query (ParsedQuery→L3) — and resolve the lower.rs naming now that lower_to_canonical exists alongside it.

🤖 Generated with Claude Code

…canonical → lower_to_canonical

The "legacy" naming was a misnomer. After #228#230, `legacy_expr` is the
real, current **L2 relational IR** every `query_parser` front end emits,
and `legacy_to_canonical` is the genuine **L2→L3 lowering pass** — neither
is removable debt; the 5-layer design mandates both layers exist.

Pure rename, no behavior change:

  * `intent_algebra/legacy_expr.rs`        → `intent_algebra/relational.rs`
  * `intent_algebra/legacy_to_canonical.rs`→ `intent_algebra/lower_to_canonical.rs`
  * the `convert_legacy` re-export alias    → `convert`

All ~25 consumer modules updated to the new paths; module-header docs and
design.md §3/§6 references refreshed so they describe `relational` as the
L2 IR rather than calling it legacy. The type is still spelled
`QueryExpr` (consumers already disambiguate it from the canonical
`query_expr::QueryExpr` via the established `LQueryExpr` alias) — a type
rename is a separate, larger change if wanted.

The word "legacy" no longer appears in any live module path or identifier
in this area; remaining "legacy" mentions elsewhere refer to genuinely
pre-canonical code (the untyped optimizer/physical path, `accuracy_sla`,
etc.), not this IR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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