Remove the legacy plan endpoints and the dead capability-miss loop - #718
Merged
Merged
Conversation
zzylol
force-pushed
the
refactor/703-remove-legacy-endpoints
branch
from
September 13, 2026 21:04
c85021f to
5fe87fc
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 13, 2026 21:06
79fdbf5 to
71e6f4c
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 13, 2026 21:16
71e6f4c to
7305832
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-endpoints
branch
from
September 13, 2026 22:25
794befe to
7588fbb
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 13, 2026 22:37
7305832 to
a1749b7
Compare
zzylol
changed the base branch from
refactor/703-remove-legacy-endpoints
to
main
September 13, 2026 22:42
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 14, 2026 00:27
a1749b7 to
ebb601c
Compare
…ss loop
`POST /api/v1/plan` and `GET /api/v1/plan/:metric` have no working
consumer. The apparent one does not function: the data plane's
capability-miss notifier POSTs a `CapabilityMissPayload` — `{kind,
metric, statistics, data_range_ms, grouping_labels,
spatial_filter_normalized}` — while `handle_plan` accepts a `QuerySpec`,
whose `accuracy_sla` carries no serde default. Every notification fails
deserialization with `missing field accuracy_sla`, and no control-plane
handler accepts that payload at all. The non-2xx becomes an `Err` that
`spawn_capability_miss_notify` logs at WARN and drops, so the loop has
been a silent no-op.
That left `control_plane/tests/component_process_e2e.rs` as the only
real caller, and it exercises the legacy path itself.
Removing the endpoints therefore needs no rewrite. The three gaps that
would have made porting `handle_plan` onto `PhysicalCompiler` awkward —
`QuerySpec::query_string` being optional, the absent
`LifecyclePlanningInput` cost evidence, and the absent
`window_implementations` — do not have to be closed.
`AppState` loses `analyzer`, `planner`, `store`, `scraper` and
`backend_routing_cache`, all unread once the handlers are gone.
The legacy planner modules behind them stay for now: the startup
`workloads.yaml` pre-population still runs `Analyzer` and
`DeploymentPlanCompiler` to fill `workload_store`, which
`handle_bootstrap_agent_config` reads. That chain retires with the
collector-facing emitters.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 14, 2026 00:56
ebb601c to
9e2117d
Compare
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.
#703 item 18, second deletion step. Stacked on #715 (which is stacked on #713) — review those first.
The finding that makes this a deletion, not a rewrite
The issue treats
POST /api/v1/planas "still fully alive". It is routed, but it has no working consumer. Both apparent ones are broken or unwired:1. The capability-miss feedback loop never worked. The data plane POSTs a
CapabilityMissPayload:{"kind": "...", "metric": "...", "statistics": [...], "data_range_ms": 300000, "grouping_labels": [...], "spatial_filter_normalized": "..."}handle_planaccepts aQuerySpec, whoseaccuracy_slahas no#[serde(default)]. Verified by deserializing the exact payload againstQuerySpec:No control-plane handler accepts that payload at all — there is no
capability_missroute and no field namedspatial_filter_normalizedanywhere in the crate. The resulting non-2xx becomes anErrthatspawn_capability_miss_notifylogs at WARN and drops, so the loop has been a silent no-op in production.2.
config_fetcher::ControlPlaneClient— which pollsGET /plan/:metricand posts/plan— is never constructed outside its own module.That left
control_plane/tests/component_process_e2e.rsas the only real caller, and it exercises the legacy path itself.Consequence: the three gaps that would have made porting
handle_planontoPhysicalCompilerawkward —QuerySpec::query_stringbeingOption, the absentLifecyclePlanningInputcost evidence, and the absentwindow_implementations(select_lifecyclehard-errors without a concrete implementation) — do not need to be closed at all.What goes
POST /api/v1/plan,GET /api/v1/plan/:metric, and their handlersdata_plane/src/drivers/control_plane_client/entirely, plus the engine'scontrol_plane_clientfield,with_control_plane_client, and bothspawn_capability_miss_notifycall sites--control-plane-endpointand its--profile asapqueryexclusion check, now unreachablecontrol_plane/tests/component_process_e2e.rsanddata_plane/src/tests/capability_miss_http_e2e_tests.rsmain.rscovering the deleted routesAppState::{analyzer, planner, store, scraper, backend_routing_cache}— all unread once the handlers are gone2,031 lines removed, 10 added.
What deliberately stays
pipeline.rs,physical/plan_cache.rs,physical/workload_planner.rsandstore/are untouched. The startupworkloads.yamlpre-population (main.rs) still runsAnalyzerandDeploymentPlanCompilerto fillworkload_store, whichhandle_bootstrap_agent_configreads. That chain retires together with the collector-facing emitters in the next step; splitting it here would leave a state that does not compile.Testing
cargo +1.98.0 check -p control_plane -p data_plane --all-targets— clean, no warnings.cargo +1.98.0 test -p control_plane --lib— 705 passed, 0 failed.cargo +1.98.0 test -p data_plane --lib— 1193 passed, 0 failed.Unrelated note
rustc 1.98.0ICEs onevaluate_obligationunder incremental compilation while checking this change.CARGO_INCREMENTAL=0(orcargo clean -p control_plane) works around it. Not caused by anything here, but worth knowing if CI hits it.🤖 Generated with Claude Code