refactor(http): drop Arc<dyn Store> from HttpServer + runtime-info adapter - #169
Merged
Merged
Conversation
…apter Phase 5 M2.3.6g step 3 — `HttpServer` and the protocol-adapter trait's `handle_runtime_info` family switch from `Arc<dyn Store>` to `Arc<SketchIndex>`. The Prometheus adapter's earliest-timestamp field is renamed from `earliest_timestamp_per_aggregation_id` to `earliest_timestamp_per_sid` (wire-format change; the data shape is otherwise identical: u64 → u64 map). Adds `SketchIndex::earliest_timestamps_per_sid() -> HashMap<u64, u64>` that returns each sid's `first_seen_unix_ms` from instance metadata. Replaces the legacy `Store::get_earliest_timestamp_per_aggregation_id` call sites (HTTP runtime-info endpoint, `/api/v1/store/metrics`). Test fixtures that constructed an HttpServer with a `SketchStore` now bind it to `_store` and pass a fresh empty `SketchIndex` to the constructor — they don't exercise the runtime-info path so the empty index is fine. 811/811 lib tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jul 29, 2026
zzylol
added a commit
that referenced
this pull request
Jul 29, 2026
…-time (#425) Written independent of what's currently implemented, grounded entirely in ASAPController's own current interfaces -- specifically the `## Interface` sections added to docs/l1-query-language.md through l5-physical-plan.md in ASAPController#169 (every signature there verified against ASAPController main at cc18c98, 2026-07-28). Core claim: control_plane should be a thin planning-time shell around asap-ir/asap-l2/asap-plan/asap-sketch, contributing exactly two things ASAPController doesn't ship -- an L5 physical planner (ASAPController has no asap-physical crate; L5 is explicitly speculative there, real here) and deployment-specific L4 extension points (CostModel, Matcher). data_plane should be a thin serving-time shell implementing SummaryExecutor once. The gap table (S4) finds L2-L4 substantially already at this target (thin re-export shims, ControlPlaneCostModel, SummaryFamilyMatcher) -- the two genuinely open items are L1 (adopt asap-frontend-promql, retiring query_parser/ outright) and the serving-time cutover (SummaryExecutor is fully implemented but not yet the live path). L5 should NOT shrink -- it's this deployment's own permanent contribution, not legacy debt, precisely because no asap-physical crate exists upstream. S5 reconciles this with data_plane/docs/l4node-plan-executor-design.md (PR #409)'s open questions -- PR #169's Reduction::{Reduce(GroupKeys), PerEntity} type looks like it resolves the grouping-ambiguity question that doc flagged as blocking, via a real upstream IR signal rather than a per-deployment heuristic. Supersedes #409 with a version grounded in ASAPController's now-merged official interface docs rather than proposing/guessing at them. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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 5 M2.3.6g step 3 —
HttpServerand the protocol-adapter trait'shandle_runtime_infofamily switch fromArc<dyn Store>toArc<SketchIndex>. The Prometheus adapter's earliest-timestamp field is renamed fromearliest_timestamp_per_aggregation_idtoearliest_timestamp_per_sid(wire-format change; data shape otherwise identical:u64 → u64map).Implementation
SketchIndex::earliest_timestamps_per_sid() -> HashMap<u64, u64>returns each sid'sfirst_seen_unix_msfrom instance metadata.Store::get_earliest_timestamp_per_aggregation_idat:handle_runtime_info(/api/v1/status/runtimeinfo)/api/v1/store/metricsendpointTest fixtures that constructed an
HttpServerwith aSketchStorenow bind it to_storeand pass a fresh emptySketchIndex— they don't exercise the runtime-info path.Test plan
cargo test -p data_plane --lib— 811/811 pass.cargo check --workspaceclean.🤖 Generated with Claude Code