@@ -173,32 +173,32 @@ impl Client {
173173 let semver_check: bool = additional_options. skip_semver_check ;
174174 let pkg_authority = additional_options. package ;
175175
176- // construct verificable publishing source
176+ // construct verifiable publishing source
177177 let ( data, candidate) =
178178 DecodedComponent :: from_publishing_source_with_package ( data, pkg_authority) . await ?;
179179
180180 let ( package, version) = (
181181 candidate. package ( ) . to_owned ( ) ,
182182 candidate. version ( ) . to_owned ( ) ,
183183 ) ;
184-
185- // instantiate LoaderPublisher
186184 let source = self . resolve_source ( & package, registry) . await ?;
187185
188- // execute pre-flight
186+ // execute pre-flight checks
189187 if !semver_check {
190- // fetch nearest neighbors of interest
188+ // fetch nearest neighbors of interest, sorted in descending order
191189 let mut neighbors: [ Option < VersionInfo > ; 2 ] = [ None , None ] ;
192190 for version_info in
193191 fetch_semver_series ( source. as_ref ( ) . as_ref ( ) , & package, & version) . await ?
194192 {
195193 match version. cmp ( & version_info. version ) {
196194 Ordering :: Equal => return Err ( Error :: VersionAlreadyExists ( version. to_owned ( ) ) ) ,
197195 Ordering :: Greater => {
196+ // incoming version is greater than neighbor
198197 neighbors[ 0 ] = Some ( version_info) ;
199198 break ;
200199 }
201200 Ordering :: Less => {
201+ // incoming version is lesser than neighbor
202202 neighbors[ 1 ] = Some ( version_info) ;
203203 }
204204 }
@@ -347,15 +347,6 @@ impl Client {
347347// Fetch every prior release in the same semver compatibility series as
348348// `version`, sorted in descending order.
349349//
350- // The "series" here is the cargo-style `^` compat range, not just
351- // `~major.minor.*`. We can be that permissive because
352- // `wit_component::semver_check` is *structural*: it strips every package
353- // version to `None` before comparing, so it enforces additive-only changes
354- // regardless of how the version numbers move. The only thing the version
355- // numbers are used for here is *which neighbors to check against* — and the
356- // semver contract already says everything inside a compat range must be
357- // additive, so that's the right gate.
358- //
359350// X.y.z (X >= 1) -> X.* (minors are additive within a major)
360351// 0.Y.z (Y >= 1) -> 0.Y.* (in 0.x, minor bumps are breaking)
361352// 0.0.Z -> 0.0.Z (every patch is its own series)
@@ -379,7 +370,6 @@ async fn fetch_semver_series(
379370 . await
380371}
381372
382- // fetch a package from
383373async fn fetch_and_resolve_package (
384374 source : & ( dyn LoaderPublisher + Sync ) ,
385375 package : & PackageRef ,
0 commit comments