Skip to content

feat: coherence gate for shared library closures (#448) - #450

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
issue-448-sdk-composition-generated-library-sdks-must-import-shared
Aug 23, 2026
Merged

feat: coherence gate for shared library closures (#448)#450
antoinetoussaint-byte merged 1 commit into
mainfrom
issue-448-sdk-composition-generated-library-sdks-must-import-shared

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

Closes#448.

Summary

  • Multi-SDK composition fails to link, not just look messy: when two
    independently generated library SDKs carry the same first-party
    contract at incompatible majors, a consumer that installs both panics
    (proto: file ... already registered in Go; duplicate descriptor-pool
    symbol 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.
  • New pkg/composition resolves a consumer's transitive
    library-dependency closure (over the existing LibraryDeps graph),
    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.
  • Wired into sync library-dependencies, which is where a service's
    closure 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:

Test plan

  • go test ./pkg/composition/... ./cmd/sync/...
  • Unit tests (injected resolver): coherent shared library passes; a
    true cross-major diamond is reported with both sides named;
    unsatisfiable transitive dep errors; dependency cycle terminates.
  • Integration test against a real on-disk workspace via the real
    LibraryResolver (coherent closure passes; unsatisfiable local
    constraint errors).
  • go vet and gofmt clean on changed packages.

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
antoinetoussaint-byteforce-pushed the issue-448-sdk-composition-generated-library-sdks-must-import-shared branch from 32b119d to 1469a6aCompareAugust 23, 2026 08:54
@antoinetoussaint-byte
antoinetoussaint-byte merged commit f0cf330 into mainAug 23, 2026
5 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@antoinetoussaint-byte