feat(control_plane): BackendPlan wire types - #434
Merged
Merged
Conversation
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>
5 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.
Summary
Implements §3 of #433 (
control_plane/docs/design-backend-plan-wire-format.md): theBackendPlan/Materialization/RoutingEntryRust types, a proto schema (proto/backend_plan.proto), and round-trip conversions between them.asap_sketch::{SummaryKind, SummaryParams}for the materialization payload (one wire shape for both exact and approximate families — no separateExactAggregatevariant, per the design doc §3),asap_ir/control_plane::intent_algebra'sSource/ColumnRef/WindowKindfor the L3 IR fragments,control_plane::sketch_algebra::capability::Capabilityfor routing, andasap_types::{PolicyFingerprint, MonitorSpec}(already shared withdata_planefor exactly this cross-crate reason).StorageBackend/RetentionPolicyare new, deployment-local types —control_planecannot depend ondata_plane's existingStorageBackend(dependency runs the other way), so this mirrors its variants rather than reusing it directly, matching the same constraintasap_types::MonitorSpec's own doc comment already documents for that type.PartialEqonasap_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 anydata_planeconsumer —RoutingIndex(design doc §4), which is what actually reads this at query time, is separate work.Test plan
cargo build --release -p control_plane— cleancontrol_plane/src/backend_plan/mod.rs: everySummaryKind/SummaryParamsvariant, everyCapabilityvariant, everyStorageBackendvariant,Source/ColumnRef, and a fullBackendPlanwith both an exact and an approximate materialization — all encode/decode to equal values. Also covers the missing-oneofdecode-error path (no panics on malformed input).🤖 Generated with Claude Code