refactor(intent_algebra): rename legacy_expr → relational, legacy_to_canonical → lower_to_canonical - #231
Merged
Conversation
…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>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 deadlanguage_logical_planscaffold,legacy_expris the real, current L2 relational IR everyquery_parserfront end emits, andlegacy_to_canonicalis 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.rs→intent_algebra/relational.rsintent_algebra/legacy_to_canonical.rs→intent_algebra/lower_to_canonical.rsconvert_legacyre-export alias →convertrelationalas the L2 IR (not "legacy").The type stays spelled
QueryExpr— consumers already disambiguate it from the canonicalquery_expr::QueryExprvia the establishedLQueryExpralias. 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 --workspacecleancargo 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) vslower_parsed_query(ParsedQuery→L3) — and resolve thelower.rsnaming now thatlower_to_canonicalexists alongside it.🤖 Generated with Claude Code