Conversation
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
Six endpoints on the legacy planning API have no caller anywhere in the workspace — not the data plane, not the process e2e tests, not the docs: `/plan/auto`, `/plan/pareto`, `/plan/:metric/rollback`, `/plan/:metric/diff`, `/agents`, and `/config/:metric`. Removing them retires the autonomous allocation chain that existed only to serve `/plan/auto`: `epsilon_alloc::build_auto_plan` and its knob allocation, which pulled in `query_planning`, and through it `sketch_selection` and `asap_tier_implement`. `epsilon_alloc` itself stays. `derive_sample_p` and `split_budget` are live on the physical path (`physical/compiler.rs` and `types.rs`), so the module keeps those two and loses the rest. `POST /api/v1/plan`, `GET /api/v1/plan/:metric` and `/api/v1/cost-model` are untouched: the data plane's capability-miss notifier and config fetcher call the first two, and `control_plane/tests/component_process_e2e.rs` uses the third as its readiness probe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ss loop
`POST /api/v1/plan` and `GET /api/v1/plan/:metric` have no working
consumer. The apparent ones do not function:
* The data plane's capability-miss notifier POSTs a
`CapabilityMissPayload` — `{kind, metric, statistics, data_range_ms,
grouping_labels, spatial_filter_normalized}`. `handle_plan` accepts a
`QuerySpec`, whose `accuracy_sla` carries no serde default, so every
notification fails deserialization with `missing field accuracy_sla`.
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.
* `control_plane_client::config_fetcher::ControlPlaneClient`, which polls
`GET /plan/:metric` and posts `/plan`, is never constructed outside its
own module.
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 13, 2026 22:37
7305832 to
a1749b7
Compare
With the legacy planning endpoints gone, the only remaining entry into the
collector config chain was `GET /api/v1/collector-config/agent`, the HTTP
config provider for collector bootstrap. Removing it retires the whole
chain in one piece, because every part of it exists to serve that entry:
workloads.yaml startup pre-population
-> Analyzer / DeploymentPlanCompiler
-> PlanStore / WorkloadStore
-> Replanner (expiry + SLA-violation + backend-repost tickers)
-> Scraper (SLA violation detection)
-> OpAMP on-connect / on-disconnect hooks
-> colored_dag stage allocation and three-stage split
-> per-runtime YAML/TOML emitters
Splitting it would leave states that do not compile, so it lands together.
Two pieces are extracted rather than deleted, because the ASAPPlanner path
depends on them:
* `physical::backend_stage` keeps `BackendStageConfig`, `BackendAggregation`,
`BackendReadout` and `AggregationInput`. `PhysicalCompiler` builds these and
`backend_plan::from_stage_config` consumes them. The collector-side
neighbours (`EdgeStageConfig`, `GatewayStageConfig`, `ExportTarget`,
`StageId`) do not come along.
* `emit::backend_wire` keeps the storage-routing classifier and
`build_backend_aggregation_json`. That builder stays the single source of
the aggregation wire shape, so `BackendPlan` materializations and the JSON
format keep one `PolicyFingerprint` identity space.
`deployment_cost` keeps only what still has consumers: `online` behind
`/api/v1/cost-model`, `tco` behind `/api/v1/tco`, and `wire` for the
post-ASAP cost model. `SketchCosts` and the benchmark table move into
`online`, its only remaining caller.
Behaviour change to note: `/metrics` no longer exposes `asap_active_plan_id`.
The gauge read `PlanStore`, which was legacy plan history.
AppState is down to opamp, online_store, runtime_samples,
active_summary_catalog and backend_client.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
zzylol
force-pushed
the
refactor/703-remove-collector-emit
branch
from
September 14, 2026 00:23
49ef7db to
354ef73
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 14, 2026 00:27
a1749b7 to
ebb601c
Compare
zzylol
force-pushed
the
refactor/703-remove-legacy-plan-endpoints
branch
from
September 14, 2026 00:56
ebb601c to
9e2117d
Compare
Contributor
Author
|
Superseded. main moved substantially while this was open (#712, #714, #717 — the last renamed |
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, final deletion step. Stacked on #718 → #715 → #713 — review those first.
−22,510 / +607.
control_planegoes from ~51k lines to 29,070;main.rsfrom 3,500+ to 1,108.Why this lands as one commit
With the legacy planning endpoints gone (#718), the only remaining entry into the collector config chain was
GET /api/v1/collector-config/agent, the HTTP config provider for collector bootstrap. Removing it retires the whole chain, because every part exists to serve that entry:Splitting it would leave intermediate states that do not compile.
Deleted
emit/stage_config.rsphysical/colored_dag/replan.rsemit/backend_push.rsphysical/workload_planner.rspipeline.rsdeployment_cost/{delta,sketch_capability}+ scoringemit/{agent,otap,telegraf}.rsstore/,monitor/,physical/{plan_cache,stage_split,topology}.rsAlso gone: the
USE_TYPED_STAGE_SPLITkill switch (#703 item 12) — its "off" branch was the legacy emitter;RealizationProvider::stages(item 10), which had no callers;physical/topology.rs(item 11), a pure re-export.Extracted, not deleted
Two pieces the ASAPPlanner path depends on:
physical::backend_stage(87 lines) keepsBackendStageConfig,BackendAggregation,BackendReadout,AggregationInput.PhysicalCompilerbuilds these;backend_plan::from_stage_configconsumes them. Their collector-side neighbours (EdgeStageConfig,GatewayStageConfig,ExportTarget,StageId) do not come along.emit::backend_wire(419 lines) keeps the storage-routing classifier andbuild_backend_aggregation_json. That builder stays the single source of the aggregation wire shape, soBackendPlanmaterializations and the JSON format keep onePolicyFingerprintidentity space — the invariantfrom_stage_config's module doc calls load-bearing.deployment_costkeeps only what still has consumers:online(behind/api/v1/cost-model),tco(behind/api/v1/tco),wire(post-ASAP cost model).SketchCostsand the benchmark table move intoonline, its only remaining caller.Behaviour change
/metricsno longer exposesasap_active_plan_id. The gauge readPlanStore, which was legacy plan history and is gone. Every otherasap_runtime_*gauge is unchanged.Resulting surface
Production routes are now the ASAPPlanner path only:
AppStateis down toopamp,online_store,runtime_samples,active_summary_catalog,backend_client.OpampServeris constructed bare and retains onlypublish_collector_plans, which the physical path uses.Testing
cargo +1.98.0 check -p control_plane --all-targets— clean, no warnings.cargo +1.98.0 test -p control_plane --lib— 387 passed, 0 failed (705 → 387; the 318 covered deleted code).cargo +1.98.0 test -p data_plane --lib— 1193 passed, 0 failed, unchanged.🤖 Generated with Claude Code