Skip to content

refactor(query): add semantic kernel - #2909

Merged
Ahoo-Wang merged 1 commit into
agent/query-service-architecture-upgradefrom
agent/query-service-p1a-semantic-kernel
Aug 9, 2026
Merged

refactor(query): add semantic kernel#2909
Ahoo-Wang merged 1 commit into
agent/query-service-architecture-upgradefrom
agent/query-service-p1a-semantic-kernel

Conversation

@Ahoo-Wang

Copy link
Copy Markdown
Owner

Summary

  • add the internal P1-A query semantic kernel: QueryTarget, per-subscription QueryInvocation, operation/result shapes, execution/validation modes
  • add backend-independent, deeply immutable NormalizedValue and NormalizedCondition models
  • add record and analytics plan skeletons, including Global | By(NonEmptyList<Dimension>) grouping
  • add exact Kotlin reflection and real Java compile/runtime guards for the existing seven-method QueryService and QueryType
  • update the architecture plan with the P1-A status and the one-pass admission/materialization boundary required by P1-B

Why

This is the first additive slice of the query-service architecture upgrade. It establishes a deterministic semantic boundary before admission, normalization, planning, policy, or backend compilers are wired into production traffic.

The branch is stacked on #2908. Review this PR against agent/query-service-architecture-upgrade; it does not include or replace the Phase 0 changes.

Boundary decisions

  • legacy record DTOs inside QueryInvocation are explicitly ephemeral raw references, not value objects or cache keys
  • P1-B must validate and defensively materialize those DTOs in one bounded pass before normalization to avoid TOCTOU
  • analytics input is internal and backend-independent; no public analytics wire API is introduced
  • no Jackson/Swagger annotations, backend driver types, physical field names, Spring wiring, or runtime traffic changes are included
  • Kotlin internal types still compile to JVM-visible classes, so they are treated as unsupported implementation details rather than described as a strict zero-ABI JAR diff

Validation

  • ./gradlew :wow-query:test --tests 'me.ahoo.wow.query.internal.*' --tests 'me.ahoo.wow.query.PublicQueryContractCompatibilityTest'
  • ./gradlew :wow-query:test --tests 'me.ahoo.wow.query.JavaQueryServiceCompatibilityTest' --tests 'me.ahoo.wow.query.PublicQueryContractCompatibilityTest'
  • ./gradlew :wow-query:check
  • ./gradlew :wow-openapi:test --tests 'me.ahoo.wow.openapi.snapshot.OpenApiCompatibilitySnapshotTest'
  • git diff --cached --check

@github-actions github-actions Bot added the area: documentation Changes to project documentation label Aug 7, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 82 complexity

Metric Results
Complexity 82

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.68908% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.21%. Comparing base (3d82a82) to head (3cbb469).

Files with missing lines Patch % Lines
...uery/internal/normalization/NormalizedCondition.kt 64.63% 22 Missing and 7 partials ⚠️
...hoo/wow/query/internal/analytics/AnalyticsModel.kt 54.16% 10 Missing and 1 partial ⚠️
...ow/query/internal/normalization/NormalizedValue.kt 54.54% 7 Missing and 3 partials ⚠️
...e/ahoo/wow/query/internal/model/QueryInvocation.kt 84.61% 6 Missing and 2 partials ⚠️
...n/me/ahoo/wow/query/internal/value/NonEmptyList.kt 45.45% 5 Missing and 1 partial ⚠️
...otlin/me/ahoo/wow/query/internal/plan/QueryPlan.kt 97.87% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                              Coverage Diff                               @@
##             agent/query-service-architecture-upgrade    #2909      +/-   ##
==============================================================================
- Coverage                                       92.38%   92.21%   -0.18%     
- Complexity                                       6826     6843      +17     
==============================================================================
  Files                                             984      990       +6     
  Lines                                           26089    26327     +238     
  Branches                                         2684     2713      +29     
==============================================================================
+ Hits                                            24103    24277     +174     
- Misses                                           1088     1138      +50     
- Partials                                          898      912      +14     
Flag Coverage Δ
contract 47.25% <ø> (-0.03%) ⬇️
integration 75.08% <ø> (ø)
local 87.79% <72.68%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ahoo-Wang
Ahoo-Wang merged commit 3cbb469 into agent/query-service-architecture-upgrade Aug 9, 2026
11 checks passed
@Ahoo-Wang
Ahoo-Wang deleted the agent/query-service-p1a-semantic-kernel branch August 9, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: documentation Changes to project documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant