Skip to content

refactor(fixture)!: the fixture API leaves the runtime root - #65

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fixture/out-of-the-runtime-root
Oct 8, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
fixture/out-of-the-runtime-root

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

What this is

Every service that imported codefly to resolve its own address also linked a GitHub API client and an HTTP artifact downloader it never calls:

codefly-base → sdk-go → core/composition → github.com/google/go-github/v89

The entire reason was fixture.go — 98 lines in the root package — needing core/composition for three types. core/composition carries GitHubResolver, which downloads release artifacts (artifact, provenance, signature, metadata assets) from GitHub releases.

Resolving a seeded identity by role is a test-time concern. A service binary has no business carrying the code that fetches release assets from GitHub — it is dead weight in every image and a supply-chain surface in a process that should only ever talk to its own composition.

The change

The API moves to sdk-go/fixture, losing nothing:

before after
codefly.Fixture() fixture.Selected()
codefly.WithFixture(name) fixture.With(name)
codefly.FixtureSelection fixture.Selection

Breaking, and safe: a search across codefly-dev and obin-ai finds no consumer of the fixture API outside sdk-go's own test.

Proven, not assumed

In a generated service, go list -deps . — the packages the binary links, excluding test binaries — now matches neither core/composition nor go-github, while core/resources is still linked for address resolution. The generated service's go.mod no longer names go-github at all.

That is exactly what service-go's manifest-guard refuses, so this unblocks codefly-dev/service-go#128, which gives that agent a resolving scaffold.

go vet and the full suite are green.

Worth knowing

GitHubResolver has no consumer in core either — only the CLI uses it (pkg/composition/*), legitimately. So the alternative fix was moving the resolver into its own package in core; this one is smaller, single-repo, and targets the actual mistake: install-time code reachable from a runtime root package.

🤖 Generated with Claude Code

Every service that imported `codefly` to resolve its own address also linked
a GitHub API client and an HTTP artifact downloader it never calls:

    codefly-base -> sdk-go -> core/composition -> go-github/v89

The whole reason was fixture.go, 98 lines in the ROOT package, needing
core/composition for three types -- and composition carries GitHubResolver,
which downloads release artifacts. Resolving a seeded identity by role is a
TEST-time concern; a service binary has no business carrying the code that
fetches release assets from GitHub.

It moves to sdk-go/fixture: FixtureSelection becomes fixture.Selection,
codefly.Fixture() becomes fixture.Selected(), codefly.WithFixture() becomes
fixture.With(). Nothing is lost.

Breaking, and safe: a search across codefly-dev and obin-ai finds NO consumer
of the fixture API outside sdk-go's own test.

Proven, not assumed -- in a generated service, `go list -deps .` (the packages
the BINARY links) now matches neither core/composition nor go-github, while
core/resources is still linked for address resolution. The generated service's
go.mod no longer names go-github at all, which is what service-go's
manifest-guard refuses (codefly-dev/service-go#128).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte merged commit b752bd7 into main Oct 8, 2026
16 checks passed
@antoinetoussaint-byte
antoinetoussaint-byte deleted the fixture/out-of-the-runtime-root branch October 25, 2026 17:03
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