Skip to content

feat(control_plane): BackendPlan wire types - #434

Merged
zzylol merged 1 commit into
mainfrom
feat/backend-plan-wire-types
Jul 30, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/backend-plan-wire-types

Conversation

@zzylol

@zzylol zzylol commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements §3 of #433 (control_plane/docs/design-backend-plan-wire-format.md): the BackendPlan/Materialization/RoutingEntry Rust types, a proto schema (proto/backend_plan.proto), and round-trip conversions between them.

  • Reuses this deployment's canonical vocabulary directly rather than re-encoding it: asap_sketch::{SummaryKind, SummaryParams} for the materialization payload (one wire shape for both exact and approximate families — no separate ExactAggregate variant, per the design doc §3), asap_ir/control_plane::intent_algebra's Source/ColumnRef/WindowKind for the L3 IR fragments, control_plane::sketch_algebra::capability::Capability for routing, and asap_types::{PolicyFingerprint, MonitorSpec} (already shared with data_plane for exactly this cross-crate reason).
  • StorageBackend/RetentionPolicy are new, deployment-local types — control_plane cannot depend on data_plane's existing StorageBackend (dependency runs the other way), so this mirrors its variants rather than reusing it directly, matching the same constraint asap_types::MonitorSpec's own doc comment already documents for that type.
  • Added one derive (PartialEq on asap_types::MonitorSpec) to make round-trip test equality checks possible — no behavior change.

Scope: types + round-trip tests only, no behavior change. Not wired into emit/, main.rs's planning path, or any data_plane consumer — RoutingIndex (design doc §4), which is what actually reads this at query time, is separate work.

Test plan

  • cargo build --release -p control_plane — clean
  • Round-trip tests in control_plane/src/backend_plan/mod.rs: every SummaryKind/SummaryParams variant, every Capability variant, every StorageBackend variant, Source/ColumnRef, and a full BackendPlan with both an exact and an approximate materialization — all encode/decode to equal values. Also covers the missing-oneof decode-error path (no panics on malformed input).

🤖 Generated with Claude Code

Implements the typed control-plane -> data-plane wire contract from
control_plane/docs/design-backend-plan-wire-format.md (#433) §3: the
BackendPlan/Materialization/RoutingEntry Rust types, a proto schema
(proto/backend_plan.proto), and round-trip conversions between them.

Reuses this deployment's canonical vocabulary directly rather than
re-encoding it: asap_sketch::{SummaryKind, SummaryParams} for the
materialization payload (one wire shape for both exact and approximate
families, matching ASAPController#170's unification -- no separate
ExactAggregate variant), asap_ir/control_plane::intent_algebra's
Source/ColumnRef/WindowKind for the L3 IR fragments,
control_plane::sketch_algebra::capability::Capability for routing, and
asap_types::{PolicyFingerprint, MonitorSpec} (already shared with
data_plane for this exact cross-crate reason).

StorageBackend/RetentionPolicy are new, deployment-local types --
control_plane cannot depend on data_plane's existing StorageBackend
(the dependency runs the other way), so this mirrors it rather than
reusing it directly, same constraint asap_types::MonitorSpec's own doc
already documents for that type.

Scope: types + round-trip tests only, no behavior change. Not wired
into emit/, main.rs's planning path, or any data_plane consumer --
RoutingIndex (design doc §4), which is what actually reads this at
query time, is separate follow-on work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol merged commit 4296698 into main Jul 30, 2026
@zzylol
zzylol deleted the feat/backend-plan-wire-types branch July 30, 2026 02:07
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