Skip to content

Implement new SDK interface for engine 1.0.0-beta.12 - #37

Merged
shykes merged 11 commits into
mainfrom
sdk-module-interface
Sep 6, 2026
Merged

shykes merged 11 commits into
mainfrom
sdk-module-interface

Conversation

@shykes

@shykes shykes commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Implement the new SDK interface planned for 1.0.0-beta.12

This is a breaking change. Once merged, the SDK will no longer be recognized by 1.0.0-beta.11 and earlier. It will still load as a module, but will not trigger SDK detection.

To test with 1.0.0-beta.12 or later:

Install the SDK:

$ dagger mod install github.com/dagger/go-sdk@pull/37/head

Verify that the SDK was recognized:

$ dagger sdk list

Init a dang module with default name and path.

$ dagger mod init go

Add a package mode to the standalone Go client generator. It writes client code under a parent module, omits a nested go.mod, and updates the parent Dagger requirement without lowering it or overriding a custom replace directive.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes force-pushed the sdk-module-interface branch from ccd7e98 to dd5ce98 Compare September 4, 2026 06:43
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
dagger/dagger#13992 replaces the beta SDK-module interface with no
compatibility adapter: an SDK is an installed module that implements
detectScope(ws) and generateScope(ws, isModule, name, clients), recorded
under [sdks.<name>] in dagger.toml. The engine persists a scope, sets
Workspace.cwd to it, and asks the SDK for the complete scope; the SDK writes
the module manifest itself. The same change removes currentModule.asSDK and
ModuleSource.generateLocalDependencies, which the beta entry points
selected, and it ignores an SDK's own @generate functions.

detectScope answers with the directory of the nearest pyproject.toml, lifted
to the owning Python module when that is the vendored sdk/ library.
generateScope scaffolds a module that has no config file from the configured
template and the engine's manifest builder, which writes dagger-module.toml
and its legacy dagger.json fallback for the python runtime, then generates
the module in place; a module that already has a config is only generated,
and a new module is generated even under a skip marker. Module clients are
refused rather than silently skipped, so a client add fails atomically.

The template, Python version, uv, and base image choices are constructor
settings, which the CLI exposes as `dagger module init python --template=...
--python-version=...` flags and persists on the scope. initModule,
targetRuntime, modules, and the generateAll @generate hook go away with the
interface they served, as in dagger/dang-sdk#13 and dagger/go-sdk#37. mod
stays for the config helpers and reads the registered modules through
Workspace.sdk(name).modules; the cwd policy moves into Dang.

Mod gains a public `generated` workspace, which generateScope returns
directly. A changeset computed at a scope cwd cannot be re-applied with
withChanges: Workspace.changes compares both sides at their cwd, so the
round trip copied the scope subtree onto the workspace root. skipGenerate
anchors its findUp start at the root for the same reason: Workspace.findUp
resolves a relative start against the cwd.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
…mmand tree

dagger/dagger#13992 records an SDK under [sdks.<name>] with one scope per
managed module, and ignores [modules.<name>.as-sdk]. dagger.toml moves to
that form, as in dagger/dang-sdk#13 and dagger/go-sdk#37: the checks that
read the registered modules pass on an engine with #13992, and `dagger
generate` drives the same fixtures generateAll drove before. The sdk-sdk
contract checks covered the beta interface and go with it.

.dagger/lock and .dagger/config.toml predate the workspace layout: nothing
reads the config, and an engine with #13992 refuses the version 1 lock file
before it can initialize a module in this checkout.

The README follows the CLI: module operations live under `dagger module`,
install records the SDK, init generates the whole module in one step, and
`module deps` / `module engine` are gone. Module dependencies are replaced
by generated clients, which this SDK does not produce yet.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
The released engine cannot drive the new SDK interface, so the check that
proves the whole flow builds its own engine: engine-dev from
dagger/dagger's sdk-ux-module-max branch, pinned in dagger.lock, gives a
playground with the CLI and engine from that branch. The check mounts this
checkout as the python SDK, lists it, initializes a Python module, and calls
a function of the generated module. dagger/dang-sdk#13 and dagger/go-sdk#37
use the same check.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
dagger/dagger#13992 replaces the beta SDK-module interface with no
compatibility adapter: an SDK is an installed module that implements
detectScope(ws) and generateScope(ws, isModule, name, clients), recorded
under [sdks.<name>] in dagger.toml. The engine persists a scope, sets
Workspace.cwd to it, and asks the SDK for the complete scope; the SDK writes
the module manifest itself. The same change removes currentModule.asSDK and
ModuleSource.generateLocalDependencies, which the beta entry points
selected, and it ignores an SDK's own @generate functions.

detectScope answers with the directory of the nearest pyproject.toml, lifted
to the owning Python module when that is the vendored sdk/ library.
generateScope scaffolds a module that has no config file from the configured
template and the engine's manifest builder, which writes dagger-module.toml
and its legacy dagger.json fallback for the python runtime, then generates
the module in place; a module that already has a config is only generated,
and a new module is generated even under a skip marker. Module clients are
refused rather than silently skipped, so a client add fails atomically.

The template, Python version, uv, and base image choices are constructor
settings, which the CLI exposes as `dagger module init python --template=...
--python-version=...` flags and persists on the scope. initModule,
targetRuntime, modules, and the generateAll @generate hook go away with the
interface they served, as in dagger/dang-sdk#13 and dagger/go-sdk#37. mod
stays for the config helpers and reads the registered modules through
Workspace.sdk(name).modules; the cwd policy moves into Dang.

Mod gains a public `generated` workspace, which generateScope returns
directly. A changeset computed at a scope cwd cannot be re-applied with
withChanges: Workspace.changes compares both sides at their cwd, so the
round trip copied the scope subtree onto the workspace root. skipGenerate
anchors its findUp start at the root for the same reason: Workspace.findUp
resolves a relative start against the cwd.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
…mmand tree

dagger/dagger#13992 records an SDK under [sdks.<name>] with one scope per
managed module, and ignores [modules.<name>.as-sdk]. dagger.toml moves to
that form, as in dagger/dang-sdk#13 and dagger/go-sdk#37: the checks that
read the registered modules pass on an engine with #13992, and `dagger
generate` drives the same fixtures generateAll drove before. The sdk-sdk
contract checks covered the beta interface and go with it.

.dagger/lock and .dagger/config.toml predate the workspace layout: nothing
reads the config, and an engine with #13992 refuses the version 1 lock file
before it can initialize a module in this checkout.

The README follows the CLI: module operations live under `dagger module`,
install records the SDK, init generates the whole module in one step, and
`module deps` / `module engine` are gone. Module dependencies are replaced
by generated clients, which this SDK does not produce yet.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
The released engine cannot drive the new SDK interface, so the check that
proves the whole flow builds its own engine: engine-dev from
dagger/dagger's sdk-ux-module-max branch, pinned in dagger.lock, gives a
playground with the CLI and engine from that branch. The check mounts this
checkout as the python SDK, lists it, initializes a Python module, and calls
a function of the generated module. dagger/dang-sdk#13 and dagger/go-sdk#37
use the same check.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
dagger/dagger#13992 replaces the beta SDK-module interface with no
compatibility adapter: an SDK is an installed module that implements
detectScope(ws) and generateScope(ws, isModule, name, clients), recorded
under [sdks.<name>] in dagger.toml. The engine persists a scope, sets
Workspace.cwd to it, and asks the SDK for the complete scope; the SDK writes
the module manifest itself. The same change removes currentModule.asSDK and
ModuleSource.generateLocalDependencies, which the beta entry points
selected, and it ignores an SDK's own @generate functions.

detectScope answers with the directory of the nearest pyproject.toml, lifted
to the owning Python module when that is the vendored sdk/ library.
generateScope scaffolds a module that has no config file from the configured
template and the engine's manifest builder, which writes dagger-module.toml
and its legacy dagger.json fallback for the python runtime, then generates
the module in place; a module that already has a config is only generated,
and a new module is generated even under a skip marker. In a module scope
the client set becomes the module's dependency set: the manifest builder
loads the manifest files the module has, replaces the dependencies with one
entry per client, and writes those files back, so the vendored bindings
include the clients' types; a module with neither clients nor dependencies
keeps its manifest untouched. Standalone clients, in a scope without a
module, are refused rather than silently skipped, so a client add fails
atomically.

The template, Python version, uv, and base image choices are constructor
settings, which the CLI exposes as `dagger module init python --template=...
--python-version=...` flags and persists on the scope. initModule,
targetRuntime, modules, and the generateAll @generate hook go away with the
interface they served, as in dagger/dang-sdk#13 and dagger/go-sdk#37. mod
stays for the config helpers and reads the registered modules through
Workspace.sdk(name).modules; the cwd policy moves into Dang.

Mod gains a public `generated` workspace, which generateScope returns
directly. A changeset computed at a scope cwd cannot be re-applied with
withChanges: Workspace.changes compares both sides at their cwd, so the
round trip copied the scope subtree onto the workspace root. skipGenerate
anchors its findUp start at the root for the same reason: Workspace.findUp
resolves a relative start against the cwd.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
…mmand tree

dagger/dagger#13992 records an SDK under [sdks.<name>] with one scope per
managed module, and ignores [modules.<name>.as-sdk]. dagger.toml moves to
that form, as in dagger/dang-sdk#13 and dagger/go-sdk#37: the checks that
read the registered modules pass on an engine with #13992, and `dagger
generate` drives the same fixtures generateAll drove before. The sdk-sdk
contract checks covered the beta interface and go with it.

.dagger/lock and .dagger/config.toml predate the workspace layout: nothing
reads the config, and an engine with #13992 refuses the version 1 lock file
before it can initialize a module in this checkout.

The README follows the CLI: module operations live under `dagger module`,
install records the SDK, init generates the whole module in one step, and
`module deps` / `module engine` are gone. Module dependencies are replaced
by generated clients, which this SDK does not produce yet.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
The released engine cannot drive the new SDK interface, so the check that
proves the whole flow builds its own engine: engine-dev from
dagger/dagger's sdk-ux-module-max branch, pinned in dagger.lock, gives a
playground with the CLI and engine from that branch. The check mounts this
checkout as the python SDK, lists it, initializes a Python module, and calls
a function of the generated module. dagger/dang-sdk#13 and dagger/go-sdk#37
use the same check.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
dagger/dagger#13992 replaces the beta SDK-module interface with no
compatibility adapter: an SDK is an installed module that implements
detectScope(ws) and generateScope(ws, isModule, name, clients), recorded
under [sdks.<name>] in dagger.toml. The engine persists a scope, sets
Workspace.cwd to it, and asks the SDK for the complete scope; the SDK writes
the module manifest itself. The same change removes currentModule.asSDK and
ModuleSource.generateLocalDependencies, which the beta entry points
selected, and it ignores an SDK's own @generate functions.

detectScope answers with the directory of the nearest pyproject.toml, lifted
to the owning Python module when that is the vendored sdk/ library.
generateScope scaffolds a module that has no config file from the configured
template and the engine's manifest builder, which writes dagger-module.toml
and its legacy dagger.json fallback for the python runtime, then generates
the module in place; a module that already has a config is only generated,
and a new module is generated even under a skip marker. In a module scope
the client set becomes the module's dependency set: the manifest builder
loads the manifest files the module has, replaces the dependencies with one
entry per client, and writes those files back, so the vendored bindings
include the clients' types; a module with neither clients nor dependencies
keeps its manifest untouched. Standalone clients, in a scope without a
module, are refused rather than silently skipped, so a client add fails
atomically.

The template, Python version, uv, and base image choices are constructor
settings, which the CLI exposes as `dagger module init python --template=...
--python-version=...` flags and persists on the scope. initModule,
targetRuntime, modules, and the generateAll @generate hook go away with the
interface they served, as in dagger/dang-sdk#13 and dagger/go-sdk#37. mod
stays for the config helpers and reads the registered modules through
Workspace.sdk(name).modules; the cwd policy moves into Dang.

Mod gains a public `generated` workspace, which generateScope returns
directly. A changeset computed at a scope cwd cannot be re-applied with
withChanges: Workspace.changes compares both sides at their cwd, so the
round trip copied the scope subtree onto the workspace root. skipGenerate
anchors its findUp start at the root for the same reason: Workspace.findUp
resolves a relative start against the cwd.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
…mmand tree

dagger/dagger#13992 records an SDK under [sdks.<name>] with one scope per
managed module, and ignores [modules.<name>.as-sdk]. dagger.toml moves to
that form, as in dagger/dang-sdk#13 and dagger/go-sdk#37: the checks that
read the registered modules pass on an engine with #13992, and `dagger
generate` drives the same fixtures generateAll drove before. The sdk-sdk
contract checks covered the beta interface and go with it.

.dagger/lock and .dagger/config.toml predate the workspace layout: nothing
reads the config, and an engine with #13992 refuses the version 1 lock file
before it can initialize a module in this checkout.

The README follows the CLI: module operations live under `dagger module`,
install records the SDK, init generates the whole module in one step, and
`module deps` / `module engine` are gone. Module dependencies are replaced
by generated clients, which this SDK does not produce yet.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
The released engine cannot drive the new SDK interface, so the check that
proves the whole flow builds its own engine: engine-dev from
dagger/dagger's sdk-ux-module-max branch, pinned in dagger.lock, gives a
playground with the CLI and engine from that branch. The check mounts this
checkout as the python SDK, lists it, initializes a Python module, and calls
a function of the generated module. dagger/dang-sdk#13 and dagger/go-sdk#37
use the same check.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
dagger/dagger#13992 replaces the beta SDK-module interface with no
compatibility adapter: an SDK is an installed module that implements
detectScope(ws) and generateScope(ws, isModule, name, clients), recorded
under [sdks.<name>] in dagger.toml. The engine persists a scope, sets
Workspace.cwd to it, and asks the SDK for the complete scope; the SDK writes
the module manifest itself. The same change removes currentModule.asSDK and
ModuleSource.generateLocalDependencies, which the beta entry points
selected, and it ignores an SDK's own @generate functions.

detectScope answers with the directory of the nearest pyproject.toml, lifted
to the owning Python module when that is the vendored sdk/ library.
generateScope scaffolds a module that has no config file from the configured
template and a dagger-module.toml from the engine's manifest builder, naming
the python runtime and writing no dagger.json, then generates the module in
place; a module that already has a config is only generated, and a new
module is generated even under a skip marker. In a module scope the client
set becomes the module's dependency set: the manifest builder loads the
manifest file the module has, replaces the dependencies with one entry per
client, and writes that file back, so the vendored bindings include the
clients' types; a module with neither clients nor dependencies keeps its
manifest untouched. Standalone clients, in a scope without a module, are
refused rather than silently skipped, so a client add fails atomically.

The template, Python version, uv, and base image choices are constructor
settings, which the CLI exposes as `dagger module init python --template=...
--python-version=...` flags and persists on the scope. initModule,
targetRuntime, modules, and the generateAll @generate hook go away with the
interface they served, as in dagger/dang-sdk#13 and dagger/go-sdk#37. mod
stays for the config helpers and reads the registered modules through
Workspace.sdk(name).modules; the cwd policy moves into Dang.

Mod gains a public `generated` workspace, which generateScope returns
directly. A changeset computed at a scope cwd cannot be re-applied with
withChanges: Workspace.changes compares both sides at their cwd, so the
round trip copied the scope subtree onto the workspace root. skipGenerate
anchors its findUp start at the root for the same reason: Workspace.findUp
resolves a relative start against the cwd.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
…mmand tree

dagger/dagger#13992 records an SDK under [sdks.<name>] with one scope per
managed module, and ignores [modules.<name>.as-sdk]. dagger.toml moves to
that form, as in dagger/dang-sdk#13 and dagger/go-sdk#37: the checks that
read the registered modules pass on an engine with #13992, and `dagger
generate` drives the same fixtures generateAll drove before. The sdk-sdk
contract checks covered the beta interface and go with it.

.dagger/lock and .dagger/config.toml predate the workspace layout: nothing
reads the config, and an engine with #13992 refuses the version 1 lock file
before it can initialize a module in this checkout.

The README follows the CLI: module operations live under `dagger module`,
install records the SDK, init generates the whole module in one step, and
`module deps` / `module engine` are gone. Module dependencies are replaced
by generated clients, which this SDK does not produce yet.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/python-sdk that referenced this pull request Sep 4, 2026
The released engine cannot drive the new SDK interface, so the check that
proves the whole flow builds its own engine: engine-dev from
dagger/dagger's sdk-ux-module-max branch, pinned in dagger.lock, gives a
playground with the CLI and engine from that branch. The check mounts this
checkout as the python SDK, lists it, initializes a Python module, and calls
a function of the generated module. dagger/dang-sdk#13 and dagger/go-sdk#37
use the same check.

Signed-off-by: Yves Brissaud <[email protected]>
@shykes
shykes force-pushed the sdk-module-interface branch 2 times, most recently from a5715a7 to 7bbcbe8 Compare September 4, 2026 18:39
Replace the legacy SDK hooks with detectScope and generateScope. ModuleManifest creates both manifest formats from scope inputs and SDK defaults, then writes the final files.

Generate standalone client packages for every scope at the nearest Go module. Module scopes also generate in-module bindings. Preserve existing client packages and unrelated files.

Use ModuleSource.generatedContextDirectory only for built-in Go codegen. Discard its manifest output before applying the generated code.

Signed-off-by: Solomon Hykes <[email protected]>
Build the development engine from the module-max branch. Use this checkout as its Go SDK and run manifest builder checks inside that engine.

Initialize and run a generated Go module to verify the complete SDK path.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes force-pushed the sdk-module-interface branch from 7bbcbe8 to 031338c Compare September 4, 2026 20:37
@shykes
shykes marked this pull request as ready for review September 4, 2026 23:22
@shykes shykes changed the title feat: implement SDK scope interface Implement new SDK interface for engine 1.0.0-beta.12 Sep 5, 2026
Generate manifests with the pinned sdkHelpers.moduleManifest function. Return null when no go.mod exists and cover that result in the end-to-end check.

Pin the engine fixes needed to build the CLI and discover SDK commands.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes merged commit 718c9c6 into main Sep 6, 2026
2 checks passed
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