Skip to content

feat(sketch_algebra): implement Matcher for asap_plan::Implementation - #399

Merged
zzylol merged 1 commit into
mainfrom
feat/matcher-impl-for-implementation
Jul 20, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/matcher-impl-for-implementation

Conversation

@zzylol

@zzylol zzylol commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Step 2 of the sketch-identity unification plan (design doc — not committed to the repo, see conversation for the published artifact). Step 1 (audit whether ASAPController needs serde on SummaryKind/SummaryParams) concluded no — every real emit path in control_plane builds JSON/YAML by hand (build_backend_aggregation_json etc.), never via serde_json::to_value on a typed struct; the existing Serialize/Deserialize derives on sketch_algebra::SketchKind/SketchParams only back #[cfg(test)] round-trip tests. No ASAPController PR needed — folded into this repo's own work instead.

This step:

Scope note: this deliberately does not implement the single-vs-multi-population re-aggregation rule (e.g. a keyed Sum accumulator serving an unkeyed Sum query) — Implementation carries no grouping information at all, so a two-Implementation Matcher can't correctly answer that question. That logic already exists as production code in asap_types::capability_matching::find_compatible_aggregation, which checks type compatibility and grouping-label subset-compatibility side by side; the two checks compose at the caller, not inside a single Matcher::is_satisfied_by.

This PR is purely additive — no existing enum (Capability, SketchKindHandle, sketch_algebra::SketchKind) is touched or deleted. That's later steps in the same plan.

Test plan

  • cargo build --workspace — clean
  • cargo test -p control_plane — 834 passed (824 + 10 new), 1 pre-existing unrelated failure (invalid_sketch_type_override_falls_back_to_default)

🤖 Generated with Claude Code

Step 1 of the sketch-identity unification (see
scratchpad/artifacts/enum-unification-plan.md). Bumps the ASAPController
pin (asap-ir, plus newly-added asap-plan/asap-sketch deps) to 283b6ab
(merge of PR #141) to pick up Matcher/Implementation and
SummaryKind/SummaryParams.

SummaryFamilyMatcher restores, verbatim, the family-compatibility logic
that briefly lived as a concrete Implementation::is_satisfied_by method
in asap-plan (PR #140) before Stage 1 of this migration converted it
into a trait with no default implementation (PR #141) -- pulled from
ASAPController's git history (commit da8fa75, the last one with the
corrected per-kind params_for test helper) rather than reconstructed
from memory, so the 10 ported tests are a faithful restoration, not a
reinterpretation.

Scope note: this deliberately does NOT implement the
single-vs-multi-population re-aggregation rule (e.g. a keyed Sum
accumulator serving an unkeyed Sum query) -- Implementation carries no
grouping information, so a two-Implementation Matcher can't correctly
answer that question. That logic already exists as production code in
asap_types::capability_matching::find_compatible_aggregation, which
checks type compatibility and grouping-label subset-compatibility side
by side. The two checks compose at the caller.

This is additive -- no existing enum (Capability, SketchKindHandle,
sketch_algebra::SketchKind) is touched or deleted yet. That's later
steps in the same plan.

- cargo build --workspace: clean
- cargo test -p control_plane: 834 passed (824 + 10 new), 1
  pre-existing unrelated failure
  (invalid_sketch_type_override_falls_back_to_default)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol merged commit 6928da8 into main Jul 20, 2026
@zzylol
zzylol deleted the feat/matcher-impl-for-implementation branch July 20, 2026 21:26
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