Skip to content

dang: bump vito/dang to v2.4.1 - #15128

Merged
vito merged 13 commits into
mainfrom
dang-v2.4.0
Nov 11, 2026
Merged

vito merged 13 commits into
mainfrom
dang-v2.4.0

Conversation

@vito

@vito vito commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Bumps github.com/vito/dang/v2 from v2.3.1-0.20261103042248-00dc3801b409 to v2.4.1 (which restores builtin JSON/YAML/TOML scalar types, vito/dang#295) and adapts the Dang SDK. The root go.mod is the only module that depends on vito/dang.

Changes

1. dang.DefaultVersion is gone: undeclared Dang versions are pinned by engine version

vito/dang#287: a dang.toml without a dang key now means CurrentVersion (2.4), the same as no dang.toml at all. Without a pin, every existing keyless module would jump from 2.1 to 2.4 and break on bare type patterns. The engine now pins every module that declares no dang version, using dang.ContextWithVersion. The pin depends on the module's engineVersion (from dagger.json/dagger-module.toml, or from dang.toml's [imports.Dagger] dagger):

engineVersion Dang version (no dang key, or no dang.toml)
< v0.21.5 (engine.MinimumDangV2ModuleVersion) 1.0 (unchanged)
v0.21.5 … < v1.0.0-beta.28 2.1: what these modules always got (Dang's old default; v1.0.0-beta.26 and v1.0.0-beta.27 shipped Dang 2.1)
>= v1.0.0-beta.28 (dangv2.Dang24ModuleVersion, the first engine embedding Dang 2.4) 2.4, pinned explicitly so a later Dang bump never reinterprets them
manifest v2 entrypoints, any engine version 2.1 (DefaultEntrypointDangVersion, unchanged)

A declared dang = "X.Y" always wins. The comparison uses engine.APIVersionAtLeast, so prereleases compare correctly and dev builds count as the release. Future language bumps add a row to DefaultModuleDangVersion, as the README now says. This follows "roll forward aggressively, pin as needed": new modules get the current language, and existing ones keep theirs.

2. Type patterns need ! from Dang 2.4

None of the repo's Dang modules, toolchains or fixtures is governed by 2.4: they all declare an engineVersion below v1.0.0-beta.28, or pin dang = "2.1" (the generated entrypoints). So no source needed dang migrate. A new integration test, TestDang/TestDangTomlTypePatternVersion, covers the gate: bare e: Error => works at beta.27, keyless or not, and fails at beta.28 with "write e: Error! =>". T! works at both, and dang = "2.1" at beta.28 accepts bare patterns. An engine caps a module's view at its own version, so until a release reaches the cut, only an engine of that version serves Dang 2.4: the test runs its modules on a nested dev engine reporting v1.0.0-beta.28 (_EXPERIMENTAL_DAGGER_VERSION, as futureClient does), and the unit tests that expect 2.4 set engine.Version to the cut.

3. JSON: bare JSON is Dang's builtin scalar; Dagger's is Dagger.JSON

From vito/dang v2.4.1, bare JSON in a type is Dang's builtin JSON-text scalar at every language version (beside the JSON.encode/JSON.decode codec and Decoded data). In a Dagger module it is not Dagger's scalar JSON, which stays Dagger.JSON (as the generated defaultValue: (… :: Dagger.JSON!) arguments already spell it); convert between them with a cast. The engine's entrypoint contract interfaces (core/sdk/dang/v2/entrypoint.go), the generated entrypoints of the repo's own Go modules and the Dang fixtures keep bare JSON, unchanged from main. The engine passes receiverValue/fnArgs as JSON text and reads back a scalar named JSON, which the builtin scalar satisfies.

Bare JSON has to keep working: released engines (≤ v1.0.0-beta.26) declare the contract with it, and so does every entrypoint github.com/dagger/go-sdk generates. dang v2.4.0 had dropped the builtin JSON type, and spelling these Dagger.JSON fails on those engines. v2.4.1 restores the builtin scalar instead.

4. createInterfaceTypeDef evaluates directives in dang.DeclarationScope

vito/dang#292 makes DeclareDir's imports file-local. Interface-method directive arguments are now evaluated in dang.DeclarationScope(env, name), the declaring file's scope. Object methods already used their constructor's closure.

5. Display: GraphQL objects show as their lazy query (intentional, not version-gated)

vito/dang#289 (and #283/#284): toString, string interpolation, List.join and print render values as Dang literals at every language version, pinned ones included. This is by design and covered by release notes rather than a gate:

  • a Dagger object renders as <Container: container.from(address: …)>, not its ID. Select .id where an ID is wanted.
  • records/maps/lists render as Dang literals ({{a: 1}}, ["x", "y"]), floats as 1.0. Build JSON text with JSON.encode, not toString/interpolation.

I audited every toString/${…}/print/JSON.encode in the repo's Dang sources and inline Go fixtures. All of them render strings, ints, enums, scalars or IDs (toString(x.id)), and the JSON-asserting tests use JSONEq, so nothing in the repo needed migrating.

6. Other API changes

Only dang.DefaultVersion broke compilation. One unit test (TestDeclaresEntrypointPrebuildParsesOncePerContent) now checks at the entrypoint's Dang version: the syntax cache is keyed by version, and 2.1 is no longer the current version.

The Go SDK module ([modules.go-sdk] in dagger.toml) is pinned to the go-sdk v1.6.0 tag (9f90a58, dagger/go-sdk#104), which depends on sdk-helpers v1.0.11. Earlier sdk-helpers tags declare engineVersion v1.0.0 with no Dang version, so Dang 2.4 rejects their bare type patterns. v1.0.11 pins dang = "2.1".

7. Docs and skills

core/skills/dang-dagger-modules/SKILL.md (engine-version table, T! patterns, bare JSON as the builtin scalar vs Dagger.JSON, the JSON codec and Decoded, display form, pitfalls), core/sdk/dang/README.md (version table, the new-language-version procedure, which changes reach every version), and docs/current_docs/reference/sdks/dang.mdx (interpolation renders Dang literals and objects as lazy queries). The Dang language skill itself comes embedded from vito/dang.

Tests run

On vito/dang v2.4.1: go test ./core/sdk/dang/..., go test ./core/schema -run 'DangSourceVersion|DangSDKVersion' and go test ./core -run Skill pass, and core/integration compiles. The other results below come from runs on vito/dang#295 before its final review fixes. Those fixes change only the error reported for a rejected literal at a return, YAML.decode of empty trailing documents, and dang's own CLI. No test here expects return type mismatch.

  • go test ./core/sdk/dang/...: pass. TestEntrypointContractConformance runs bare-JSON entrypoints against the bare-JSON contract with Dagger's scalar JSON auto-imported.
  • go test ./core/schema/: pass (TestDangSourceVersionMutations, run as a beta.28 engine, expects 2.1 for a beta.27 override and 2.4 for a beta.28 one)
  • go test ./core/ -run Skill: pass
  • A throwaway unit test (not committed) drove callDangFunction → entrypointJSONResult through a bare-JSON call. receiverValue/fnArgs arrive as ScalarValues of the builtin JSON type. Returning fnArgs, text :: JSON!, JSON.encode(…) :: JSON! and ("{}" :: Dagger.JSON!) :: JSON! all yield a scalar named JSON with valid JSON text. So do the literal casts the repo's fixtures use: "{}", "\"hello\"", the fnArgs != ("{\"status\":\"Ready\"}" :: JSON!) comparison and the triple-quoted llm_tool_state document, as well as backtick literals (an interpolated `{"t": "${receiverType}"}` :: JSON! and a comparison with a backtick literal). Invalid literals, quoted or backtick, cast or compared, are rejected with invalid JSON when the source is checked, even in a branch that never runs. JSON.encode of a record embeds JSON values as strings, which the generated Go dispatcher accepts.
  • String and backtick literals cast to bare JSON!/YAML!/TOML! or compared with one, in the repo's .dang files and the Dang fixtures inlined in Go tests: all valid JSON. No backtick literal is cast or compared, and no YAML/TOML casts exist.
  • TestDang/TestDangTomlTypePatternVersion: pass. Other integration tests (TestDang/TestDangToml…, TestModule/TestDangModuleEntrypoint…): not run yet.

Follow-ups outside this repo

  • None for JSON: with dang v2.4.1, go-sdk's generated entrypoints keep bare JSON and need no change.

@vito
vito force-pushed the dang-v2.4.0 branch 4 times, most recently from 1b86e0e to fb60e73 Compare November 10, 2026 16:16
eunomie pushed a commit to eunomie/go-sdk that referenced this pull request Nov 10, 2026
sdk-helpers v1.0.11 (dagger/sdk-helpers#17) declares Dang 2.1 in dang.toml.
Earlier tags carry no Dang version, so an engine with Dang 2.4
(dagger/dagger#15128) reads them as 2.4 and rejects their bare `error: Error
=>` rescue patterns.

Point the dependency at v1.0.11 and move the lock's floating v1 entry (which
the dang SDK's helpers@v1 dependency resolves through) and the nested
floor-engine lock to it as well.

Signed-off-by: Alex Suraci <[email protected]>
vito added 10 commits November 10, 2026 21:14
Dang 2.4 requires `!` on type patterns, drops dang.DefaultVersion (a
dang.toml without a `dang` key now means the current version), keeps
data as Decoded with the builtin codec namespaces as automatic imports,
restores builtin `JSON`/`YAML`/`TOML` scalar types (vito/dang#295),
scopes DeclareDir's imports per file and displays GraphQL objects as
their pending query. The following commits adapt the Dang SDK.

The pin is vito/dang#295's head, ahead of v2.4.1; retarget it to the tag
once released.

Signed-off-by: Alex Suraci <[email protected]>
vito/dang v2.4.0 drops dang.DefaultVersion: source whose version no
dang.toml declares, with or without a dang.toml, is Dang's current
version, now 2.4, whose type patterns need a `!`. The engine pins every
such module instead, so it keeps meaning what it meant:

  engineVersion                      Dang
  < v0.21.5                          1.0
  v0.21.5 ... < v1.0.0-beta.26       2.1
  >= v1.0.0-beta.26                  2.4

v1.0.0-beta.26 (Dang24ModuleVersion) is the first engine that embeds Dang
2.4. A manifest v2 entrypoint that declares no Dang version stays Dang 2.1
whatever its engine version, as it was. A declared `dang` version always
wins.

Signed-off-by: Alex Suraci <[email protected]>
DeclareDir's imports are file-local from vito/dang v2.4.0 on, so the
module scope alone no longer resolves an import an interface method's
directive argument names. Evaluate them in dang.DeclarationScope, the
scope of the file declaring the interface, as object methods already
are through their constructor's closure.

Signed-off-by: Alex Suraci <[email protected]>
The Dang module skill gives the engine-version table for the Dang
language, type patterns written `T!`, bare `JSON` as Dang's builtin
JSON-text scalar beside Dagger's `Dagger.JSON` (converted with a cast),
Dang's `JSON` codec and `Decoded` data, and how a Dagger object displays.
The Dang SDK reference renders interpolated values as Dang literals and
objects as their lazy query.

Signed-off-by: Alex Suraci <[email protected]>
A Dang SDK module that declares no Dang version is Dang 2.1 before
engineVersion v1.0.0-beta.26, where a type pattern may leave out its
`!`, and Dang 2.4 from it on, where it must not; a declared version
wins.

Signed-off-by: Alex Suraci <[email protected]>
The engine's version pin covers only what Dang gates on its language
version. From vito/dang v2.4.1 bare `JSON` in a type is Dang's builtin
JSON-text scalar in every version, not Dagger's scalar (`Dagger.JSON`),
and values display as Dang literals, Dagger objects as their lazy query.

Signed-off-by: Alex Suraci <[email protected]>
Record the Dang version pins and the changes that reach every Dang
version, for the release notes.

Signed-off-by: Alex Suraci <[email protected]>
v1.0.0-beta.26 shipped with Dang 2.1 (vito/dang 00dc380), and
v1.0.0-beta.27 will too, so modules declaring either were written for 2.1
and must keep it. Move Dang24ModuleVersion to v1.0.0-beta.28.

An engine caps a module's view at its own version, so an engine built
before the cut serves even a module declaring v1.0.0-beta.28 Dang 2.1. The
tests that expect Dang 2.4 now run as an engine of the cut: the unit tests
set engine.Version (as core/schema's view tests do), and
TestDangTomlTypePatternVersion runs its modules on a nested dev engine
reporting v1.0.0-beta.28 (as futureClient does).

Signed-off-by: Alex Suraci <[email protected]>
sdk-helpers v1.0.11 (3be7456) pins its Dang modules to Dang 2.1, so they
keep working now that modules without a `dang` version can default to Dang
2.4. Also record the tag's sha, as v1.0.8's is.

Signed-off-by: Alex Suraci <[email protected]>
go-sdk 9f90a58 (dagger/go-sdk#104) depends on sdk-helpers v1.0.11, which
pins `dang = "2.1"`. Earlier sdk-helpers tags declare engineVersion v1.0.0
without a Dang version, so this engine evaluates them as Dang 2.4, which
rejects their bare type patterns (`err: Error =>`). bb23e8d..9f90a58 only
bumps sdk-helpers; dagger/go stays at b0476af, as sdk/go/runtime pins it.

dagger.lock gains sdk-helpers `version v1.0.11`; its tag commit was already
locked for `v1`. To be replaced by the go-sdk v1.6.0 tag.

Signed-off-by: Alex Suraci <[email protected]>
vito added 2 commits November 11, 2026 03:01
go-sdk v1.6.0 tags 9f90a58, the commit the Go SDK module already pinned,
so the module's tree is unchanged.

dagger.lock gains go-sdk `version v1.6.0` and the tag's commit. The
unversioned go-sdk entry, which `workspace migrate`'s unversioned
references resolve through, moves from v1.1.0 to v1.6.0; nothing else in
the repo referenced v1.1.0, so its commit entry goes.

Signed-off-by: Alex Suraci <[email protected]>
Retarget from the v2.4.1-0.20261110161231-fcb24298b2d7 pseudo-version to
the v2.4.1 tag (247f410, the merge of vito/dang#295). It adds, past
fcb2429: rejected scalar/enum literals at returns reported as the literal's
own error rather than `return type mismatch`, YAML.decode ignoring empty
trailing documents, and dang's own CLI querying `introspectionSchemaJson`,
which this engine serves in every view. go.sum now verifies against
sum.golang.org.

Signed-off-by: Alex Suraci <[email protected]>
@vito vito changed the title dang: bump vito/dang to v2.4.0 dang: bump vito/dang to v2.4.1 Nov 11, 2026
@vito
vito marked this pull request as ready for review November 11, 2026 03:24
@vito
vito requested a review from a team as a code owner November 11, 2026 03:24
Keep what a user acts on (which modules get Dang 2.4, how to pin or
migrate, the every-version display and JSON changes) and link the v2.4.1
release notes for the rest.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit 057dd64 into main Nov 11, 2026
97 checks passed
@vito
vito deleted the dang-v2.4.0 branch November 11, 2026 16:19
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.

2 participants