refactor(sdk): reframe sei SDK as a wire-client product (Phase A)#443
Conversation
The SDK ships WIRE providers (k8s, docker) that speak RPC/CRDs to an
already-running chain. An in-process ("local") provider is a category
error: it would link sei-chain's Go source (uninstallable in the
controller; co-versioned with the chain). The in-process harness lives
in sei-chain and conforms to these handle interfaces by shape,
registered/constructed consumer-side.
- delete the local ErrNotImplemented stub package
- drop the built-in "local" mode + SEI_LOCAL from env resolution
(registry stays generic — a consumer may still Register("local", …))
- name the contract seam: Provider/*Handle + *Spec + registry stay free
of controller-runtime/apimachinery/CRD imports
- add a go-list import-discipline test enforcing that seam
- pin built-in modes to exactly {k8s, docker}; refresh docs
docker is untouched. No interface signatures change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Removals: entire Documentation: Tests: new Public ** Reviewed by Cursor Bugbot for commit ba8ccf7. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ba8ccf7. Configure here.
Review-gate: PASS — mergingCoral slate (blinded, 4 lenses): unanimous RATIFY.
Bugbot: clean. CI: lint / test / test-integration / verify-generated all green. The two advisory doc nits are non-blocking and will be folded into a later SDK-docs touch. |
What
Make the
sdk/seipieces idiomatically express a settled design decision: the SDK is a wire-client product + contract owner. Its providers (k8s, docker) are WIRE clients — they speak RPC/CRDs to an already-running chain, so version-pinning them is fine. An in-process ("local") provider is a category error for the SDK: it would link sei-chain's Go source (the controller can't transitively build it; and it co-versions the harness with the chain). The in-process harness lives in sei-chain, satisfies these handle interfaces by shape, and is registered/constructed consumer-side. The SDK stops pretending to host "local".Changes
sdk/sei/provider/localErrNotImplementedstub package.localmode +SEI_LOCALfromresolveMode(and the resolve/ambiguity error text). The registry stays generic — a consumer may stillprovider.Register("local", …)its own in-process adapter andOpen(ctx, "local")explicitly.dockeruntouched (legitimate wire stub).Provider/*Handle+*Spec+ the registry are the stable, dependency-light contract — the seam a future leaf module would extract — and must stay free of controller-runtime/apimachinery/CRD imports. Documented inprovider.goandCLAUDE.md. Not extracted now (deferred).go list -depsimport-discipline test that mechanically enforces that seam on the coreseipackage.{k8s, docker}; refresh package/Provider/Object()docs andsdk/CLAUDE.md.No
Provider/handle interface signatures change. No contract sub-package/module extraction, no harness changes, no sei-chain changes (Phases B/C).Verification
go build ./...,go test ./sdk/... -race,go vet ./sdk/...,gofmt -s -l sdk/,golangci-lint run ./sdk/...(0 issues) — all green.For reviewers
{docker, k8s}" — stricter, so an extra built-in mode also fails. Intentional: the SDK's built-in surface is now closed.TestResolveMode_ExplicitBeatsEnvnow resolves a"consumer-mode"name, doubling as coverage that a consumer passes its own mode explicitly (the only path left for a non-wire provider).imports_test.goshells out togo list; it confirmed core has zero hits while the k8s provider pulls apimachinery, so it discriminates correctly.Out of scope (Phase A)
Interface-signature changes; contract sub-package/module extraction; integration harness (Phase B); sei-chain (Phase C).
🤖 Generated with Claude Code