Skip to content

refactor(core): extract metric package - #25

Closed
zhangzhenghao wants to merge 1 commit into
mainfrom
refactor/core-metric
Closed

refactor(core): extract metric package#25
zhangzhenghao wants to merge 1 commit into
mainfrom
refactor/core-metric

Conversation

@zhangzhenghao

Copy link
Copy Markdown
Collaborator

Summary

  • extract dense-vector metric computation and ordering into internal/core/metric
  • preserve existing core.Metric and metric constants through aliases while establishing the lower-level dependency boundary
  • expose metric validity and prevalidated kernel selection for later algorithm package extraction
  • move metric-specific tests to the new package

This is the first small step of restructuring internal/core after Alibaba zvec’s core/metric, core/quantizer, and core/algorithm responsibility split. It intentionally makes no scoring, ordering, persistence, or public API behavior changes.

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • git diff --check
  • go test ./internal/core/metric -coverprofile=/tmp/xvec-core-metric.cover (100% statement coverage)

@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.39%. Comparing base (236f506) to head (2a80530).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/core/quantized_index.go 0.00% 0 Missing and 1 partial ⚠️
internal/core/refiner.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #25   +/-   ##
=======================================
  Coverage   61.38%   61.39%           
=======================================
  Files         155      156    +1     
  Lines       40415    40415           
=======================================
+ Hits        24810    24814    +4     
+ Misses      12367    12365    -2     
+ Partials     3238     3236    -2     

☔ 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.

@zhangzhenghao

Copy link
Copy Markdown
Collaborator Author

Closing this PR because the verified commit will be pushed directly to main.

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.

2 participants