feat: coherence gate for shared library closures (#448) - #450
Merged
antoinetoussaint-byte merged 1 commit intoAug 23, 2026
Conversation
Add pkg/composition, which resolves a consumer's transitive library-dependency closure and rejects version diamonds — a shared library required at more than one major. Independently generated SDKs that embed or import the same first-party contract fail to link when a consumer installs both at incompatible majors (duplicate proto registration panic in Go, descriptor-pool clash in Python). Catching the diamond at resolution time turns that runtime panic into a clear config error. Wire the gate into `sync library-dependencies`, which is where a service's closure is resolved for local development. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
antoinetoussaint-byte
force-pushed
the
issue-448-sdk-composition-generated-library-sdks-must-import-shared
branch
from
August 23, 2026 08:54
32b119d to
1469a6a
Compare
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.
Closes #448.
Summary
independently generated library SDKs carry the same first-party
contract at incompatible majors, a consumer that installs both panics
(
proto: file ... already registeredin Go; duplicate descriptor-poolsymbol in Python). This PR adds the composition-layer coherence check
the issue asks for — the analog of Epic: durable versioned library publishing — storage abstraction for go get / pip / npm #446's immutability lock.
pkg/compositionresolves a consumer's transitivelibrary-dependency closure (over the existing
LibraryDepsgraph),records every constraint on each library, and rejects a version
diamond — any shared library required at more than one major. The
error names each side of the diamond so the consumer can pin one major.
sync library-dependencies, which is where a service'sclosure is already resolved for local development — the diamond is now
a clear configuration error instead of a runtime panic.
Scope / what is deferred
This delivers the coherence gate (issue's fix #3). The other two
fixes are already partly in place or blocked:
library.codefly.yaml(fix #1) alreadyexist in the model (
resources.Library.LibraryDeps); this PR is thefirst consumer that resolves the closure coherently.
proto-module → published-library package-coordinate mapping, which
is produced by the library store in Epic: durable versioned library publishing — storage abstraction for go get / pip / npm #446/feat(librarystore): versioned library store + GitHub Go strategy (#446) #447 (not yet merged). It is
left for a follow-up on top of that store rather than stubbed here.
Test plan
go test ./pkg/composition/... ./cmd/sync/...true cross-major diamond is reported with both sides named;
unsatisfiable transitive dep errors; dependency cycle terminates.
LibraryResolver(coherent closure passes; unsatisfiable localconstraint errors).
go vetandgofmtclean on changed packages.