Skip to content

Fix HybridQueryRanker commonMain compile (unblocks v0.5.0 publish)#479

Merged
wow-miley merged 1 commit into
mainfrom
wow-miley/fix-ranker-common
Apr 30, 2026
Merged

Fix HybridQueryRanker commonMain compile (unblocks v0.5.0 publish)#479
wow-miley merged 1 commit into
mainfrom
wow-miley/fix-ranker-common

Conversation

@wow-miley
Copy link
Copy Markdown
Contributor

Summary

The v0.5.0 tag pushed by #478 triggered publish.yml, which failed at :ampere-core:compileCommonMainKotlinMetadata because HybridQueryRanker.kt:64 used MutableMap.putIfAbsent — a JVM-only method not available in commonMain. The regular PR CI doesn't run the metadata-compile task, so the issue slipped through when AMPR-156 (#476) merged.

This swaps putIfAbsent for getOrPut, which exists in commonMain and is semantically identical when the return value is discarded inside forEach.

Verification

  • ./gradlew :ampere-core:compileCommonMainKotlinMetadata — passes locally (was the failing task in the publish run)
  • ./gradlew :ampere-core:jvmTest --tests "*HybridQueryRanker*" — passes
  • ./gradlew ktlintFormat — clean

Release recovery (after merge)

Maven Central never received 0.5.0 (publish failed before the upload step), so the v0.5.0 tag can be safely moved to the merge commit and re-pushed to retrigger publish.yml:

git tag -f v0.5.0 <merge-commit>
git push origin v0.5.0 --force

Fix authored and committed by Claude Opus 4.7 on Miley's behalf.

`MutableMap.putIfAbsent` is JVM-only and breaks
`:ampere-core:compileCommonMainKotlinMetadata`, which is what the
publish.yml workflow runs on tag push. The regular PR CI doesn't run
that task, so the issue slipped through when AMPR-156 (#476) merged and
only surfaced when the v0.5.0 tag triggered the publish workflow.

Swap to `getOrPut`, which is in commonMain and has the same effect
(insert if absent, leave existing alone) when the return value is
discarded inside `forEach`.

Verified with `./gradlew :ampere-core:compileCommonMainKotlinMetadata`
and the existing HybridQueryRankerTest.

Commit authored by Claude Opus 4.7 on Miley's behalf.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Concept staleness check — clean. No tracked-source changes need a concept update.

@wow-miley wow-miley merged commit b614341 into main Apr 30, 2026
3 checks passed
@wow-miley wow-miley deleted the wow-miley/fix-ranker-common branch April 30, 2026 16:22
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