Skip to content

fix(control-plane): preserve query semantics through physical planning - #449

Merged
zzylol merged 1 commit into
mainfrom
fix/mvp-query-contracts
Sep 2, 2026
Merged

zzylol merged 1 commit into
mainfrom
fix/mvp-query-contracts

Conversation

@zzylol

@zzylol zzylol commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Why

The MVP demo must preserve the query meaning selected by ASAPPlanner and must fail closed when evidence is insufficient.

What

Physical planning no longer rewrites quantile/frequency intent through an incompatible sketch override; bare global HLL count is cumulative; the full-stack HLL regression is enabled; compiler documentation distinguishes implemented behavior from deferred APIs.

How

Keep statistic semantics owned by the Planner query contract, constrain override handling, and align HLL merge behavior with the emitted plan.

Before this PR

An override could change the requested statistic, and the global-count regression was disabled, allowing documented and executable behavior to diverge.

After this PR

A query retains its planned statistic through physical planning, and global HLL count is regression-tested end to end.

Evidence

Execution example: the controller emits an HLL global-count plan and the backend merges results across SIDs. Visual and performance evidence are not applicable.

Verification

  • Unit tests: cargo test --workspace --lib — 927 passed, 2 ignored.
  • End-to-end tests: live_serve_hll_global_count_merges_across_sids — passed.
  • Focused behavior: 25 control-plane override tests — passed.
  • Other checks: cargo check -p control_plane, package formatting, and git diff --check — passed.

Architectural decisions

Planner owns query semantics; physical overrides may select compatible implementations but may not redefine the operation.

Limitations and follow-up

This PR deliberately does not migrate to the latest Planner IR. That staged migration begins in #450 and is tracked by #448.

Human review — do not complete with an agent

  • The MVP boundary is correct.
  • New conceptual layers or public interfaces are necessary.
  • The before/after description matches the intended product behavior.
  • Human reviewer:
  • Decision and rationale:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant