fix(data-source): export kotlinx-io as api — Source/Sink are in the public API - #1295
Open
michalharakal wants to merge 1 commit into
Open
michalharakal wants to merge 1 commit into
michalharakal wants to merge 1 commit into
Conversation
…public API DataSourceArtifact.openSource()/copyTo(), DataSourceRemoteContent and DataSourceArtifactStore expose kotlinx.io.Source and Sink, but kotlinx-io was an implementation dependency (runtime scope in the published POM). A consumer could not call those functions without declaring kotlinx-io itself: "Cannot access class kotlinx.io.Source". Found by the first external JVM consumer, the cartridge blueprint materializer plugin.
aharakal
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by dog-fooding: the cartridge blueprint materializer (SKaiNET-cartridge-blueprints#1) now fetches model sources through
skainet-data-source(hf://, sha256, shared cache, offline policy) instead of its own downloader — the first consumer outside this repository.Problem.
DataSourceArtifact.openSource()/copyTo(),DataSourceRemoteContentandDataSourceArtifactStoreexposekotlinx.io.Source/Sink, butkotlinx-io-corewas animplementationdependency →runtimescope in the published POM. A consumer compiling against those functions getsCannot access class 'kotlinx.io.Source'until it declares kotlinx-io itself.Fix.
api(libs.kotlinx.io.core)incommonMain. Generated JVM POM:kotlinx-io-core-jvmruntime→compile; Ktor and coroutines stayruntime.Verified:
:skainet-data:skainet-data-source:jvmTestgreen.Also confirmed while testing (no change needed): the Ktor transport does not forward an
Authorizationheader to another authority on redirect, so a Hugging Face token does not travel to the hub's CDN host; checksum validation happens before the cache commit, so a wrong pin does not poison the cache. One ergonomic note for later:DataSourceResolveris a plain interface — as afun interfaceit would be easier to stub in consumers' tests.