backend-plan: construct BackendPlan from BackendStageConfig (Phase 1) - #437
Merged
Merged
Conversation
Phase 1 of the BackendPlan end-to-end wiring (control_plane emit -> data_plane serving). Pure, additive: a new from_stage_config() function builds a typed BackendPlan from the same BackendStageConfig input emit_backend_streaming_config_json already turns into the legacy JSON wire format. No wire/push change yet -- that's Phase 2/3. Fingerprint parity with the legacy StreamingConfig path is the critical invariant: Materialization.fingerprint is derived by round-tripping through build_backend_aggregation_json + AggregationConfig::from_yaml_data (the exact JSON shape and parser data_plane's real POST /api/v1/streaming-config handler uses), not a re-derived field mapping, so the two identity spaces can never drift apart. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 30, 2026
This was referenced Jul 30, 2026
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
Phase 1 of 4 in the BackendPlan end-to-end cutover (see
control_plane/docs/design-backend-plan-wire-format.md, #433). Addscontrol_plane::backend_plan::from_stage_config— builds a typedBackendPlanfrom the sameBackendStageConfiginputemit::stage_config::emit_backend_streaming_config_jsonalready turns into the legacy JSON wire format.Pure and additive: no wire/push change in this PR, nothing consumes the new function yet. Follow-ups: Phase 2 (wire push + new data_plane endpoint), Phase 3 (real call-site wiring), Phase 4 (serving-time cutover — the actual behavior change).
Materialization.fingerprintis derived by round-tripping throughbuild_backend_aggregation_json(nowpub(crate)) +AggregationConfig::from_yaml_data— the exact JSON shape and parserdata_plane's realPOST /api/v1/streaming-confighandler uses — rather than a second, independently-derived field mapping. This keeps the new and legacy identity spaces bit-for-bit unified by construction.RoutingEntry.satisfies(Capability) is derived from each readout's(sketch_kind, op)pair, orCapability::ExactAggforagg_type_overriderows.Test plan
cargo test --release -p control_plane --lib backend_plan::— 14/14 pass, including a fingerprint-parity test that independently hand-builds the expectedAggregationConfig(not via the JSON round-trip) and asserts equal fingerprints.cargo build --release --workspace— clean.