Skip to content

feat(control_plane): Phase 2 step 1 -- merge schema.rs onto asap-ir - #393

Merged
zzylol merged 1 commit into
phase1b/real-asap-ir-dependencyfrom
phase2/schema-rs-merge
Jul 18, 2026
Merged

zzylol merged 1 commit into
phase1b/real-asap-ir-dependencyfrom
phase2/schema-rs-merge

Conversation

@zzylol

@zzylol zzylol commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #392 (base branch set accordingly -- merge #392 first, then
this). First step of Phase 2 (docs/migration-plan-backend-plan.md):
schema.rs.

Column/ColumnId/DataType/Schema/CseError/cse_reuse_is_legal
are now re-exported from asap_ir::intent_algebra::schema instead of
defined locally. Unlike AggIntent's merge in #392 (which needed a
boundary-conversion layer because AccuracyTarget's wire shape actually
changed), this one is a clean full swap -- a fresh diff showed asap_ir's
version is a purely additive, backward-compatible superset:

  • Column gains table: Option<String> (SQL join qualifier) +
    Column::new()/with_table() constructors.
  • Schema gains closed: bool (schema-on-read completeness flag) +
    column_id_qualified().
  • DataType is byte-identical, no changes at all.

Both new fields are #[serde(default)], confirmed backward-compatible by
asap_ir's own tests (schema_closed_defaults_to_open_when_absent,
column_table_defaults_to_none_when_absent). That's what made a full
swap the right call here instead of #392's boundary-conversion approach
for Column/DataType -- and it let me delete the
to_asap_column/from_asap_column/to_asap_dtype/from_asap_dtype
helpers agg_intent.rs needed in #392, since there's only one
Column/DataType type now.

Blast radius was smaller than expected

The migration plan flagged ~38 Column{} literals as the risk here.
Turned out most of those grep hits were field references or doc comments,
not constructions -- only 15 real struct-literal sites across 9 files
needed the new field added (table: None / closed: false).

Verification

Remaining Phase 2 work

Per the migration plan: expr_ir.rs (new file, D2 decision), fresh diff
on query_expr.rs/relational.rs, fresh diff on
binder.rs/column_resolution.rs, cse.rs move to L4 (with the
regression pass that requires), lower.rs, then retargeting the
PromQL/SQL frontends.

Test plan

🤖 Generated with Claude Code

Column/ColumnId/DataType/Schema/CseError/cse_reuse_is_legal are now
re-exported from asap_ir::intent_algebra::schema instead of defined
locally. Unlike AggIntent's merge (Phase 1b), this needed no boundary-
conversion layer: fresh diff showed asap_ir's version is a purely
additive, backward-compatible superset of the pre-merge local type --

- Column gains `table: Option<String>` (SQL join qualifier) +
  Column::new()/with_table() constructors.
- Schema gains `closed: bool` (schema-on-read completeness flag) +
  column_id_qualified().
- DataType is byte-identical, no changes.

Both new fields are #[serde(default)], confirmed backward-compatible by
asap_ir's own tests. This is what made a full swap the right call here
instead of Phase 1b's boundary-conversion approach for Column/DataType --
deleted agg_intent.rs's to_asap_column/from_asap_column/to_asap_dtype/
from_asap_dtype helpers, no longer needed once there's only one
Column/DataType type.

Blast radius was much smaller than the migration plan's stale ~38-site
estimate: 15 real Column{}/Schema{} struct-literal construction sites
across 9 files needed the new field added (table: None / closed: false)
-- most of the original grep hits were field references or doc comments,
not constructions.

Verified: full workspace builds clean; control_plane's 820-test suite
passes unchanged (same 1 pre-existing failure as #392, confirmed
unrelated).

Remaining Phase 2 work (docs/migration-plan-backend-plan.md): expr_ir.rs,
query_expr.rs/relational.rs fresh diff, binder.rs/column_resolution.rs
fresh diff, cse.rs move to L4, lower.rs, PromQL/SQL frontend retarget.
@zzylol
zzylol merged commit 3b4278c into phase1b/real-asap-ir-dependency Jul 18, 2026
@zzylol
zzylol deleted the phase2/schema-rs-merge branch July 18, 2026 17:15
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