Skip to content

Centralize identifier casing in the engine and SDKs - #14501

Closed
vito wants to merge 153 commits into
dagger:mainfrom
vito:identifier-casing
Closed

vito wants to merge 153 commits into
dagger:mainfrom
vito:identifier-casing

Conversation

@vito

@vito vito commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Every layer that converts identifier casing makes its own guess about acronyms, and the guesses disagree:

  • The engine normalizes module names with strcase, which lowercases runs of capitals unless the whole name is a registered acronym: LLMContentBlock → LlmcontentBlock, MyMod + HTTPClient → MyModHttpclient. A module type that references a core type starting with an acronym (LLMMessage, JSONValue) gets a namespaced copy instead. core/llm.go papers over this with one strcase.ConfigureAcronym per affected core type, and withFinalTypeName exists only because re-normalizing a final name corrupts it.
  • SDK codegen has at least seven independent converters. Python, Rust and Elixir generate prerequisite_sh_as; Go generates ParentShas and VcsGeneratedPaths; .NET generates WithMcpserver. The same core type is JSONValue in Go/TypeScript/Python/Elixir and JsonValue in Rust/PHP.

This PR replaces all of them with one implementation, engine/naming, and moves the engine (for modules that opt in through engineVersion), the CLI, and every SDK's codegen onto it. A name is parsed once into words (ordinary words, acronyms like HTTP, and terms with a fixed spelling like GitHub, IPv6) using a versioned dictionary of acronyms and terms, falling back to a case heuristic. The words can then be formatted in any casing (PASCAL, CAMEL, SNAKE, SCREAMING_SNAKE, KEBAB, FLAT), in either acronym style (HTTPClient / HttpClient).

Design: hack/designs/identifier-casing.md (parsing algorithm, guarantees, test vectors, engine and SDK integration, compatibility).

What's in this PR

  1. engine/naming: parser, formatter, and the dictionary, selected by engine version (naming.DictionaryFor) so a later addition never renames anything for a module on an older version. Tests cover every row of the design's test-vector table, the three guarantees (round trip, idempotence, canonical names come back unchanged), and every core name in docs/docs-graphql/schema.graphqls: all type, field and argument names are canonical (the 7 that weren't are renamed, item 7).
  2. Experimental core API (@experimental, visible from v1.0.0-0): Query.identifier, Query.formatIdentifiers(names, casing, acronyms, version) (plain strings, so codegen formats thousands of names in one round trip; version selects the dictionary of the schema being generated, defaulting to the caller's), Query.namingDictionary, plus Identifier, IdentifierWord, NamingTerm, IdentifierWordKind, Casing, AcronymStyle. formatIdentifiers is uncached, and dagql now renders lists of leaf values without a result per element, which took a ~1000-name call from ~780 ms to ~11 ms.
  3. Codegen asks the engine for names (the rules live only in the engine). Every in-repo SDK's codegen collects the schema's names and calls formatIdentifiers once per casing it uses: Go and TypeScript (cmd/codegen), PHP and Java live; Python, Rust, Elixir and .NET read a names file written by the online step (codegen introspect --names-out ... --names CASING:ACRONYMS,...). Module runtimes (Python, PHP, Elixir, Java) write the same names file for module codegen. Gate: a schema without Query.formatIdentifiers (views before v1.0.0-0) keeps each SDK's old converter, so older schemas generate byte-identical code.
  4. Engine naming for every module on a v1 view (engineVersion v1.0.0-0 and up, prereleases included; core.IdentifierNamingVersion): a core.Namer taken from the caller's view (typedef constructors) or the module source (module assembly), with the legacy strcase path kept byte for byte for modules below v1.0.0. Manifest v2 entrypoint modules declare no engineVersion and are served at the engine's own version, so they get the new naming too. This is the real fix for Clean up longstanding API warts and pending breaking changes #13668's core-type acronym bug: LLMMessage and JSONValue references resolve to the core types, and MyModHttpclient becomes MyModHTTPClient. Also:
    • CLI: commands and flags are named with engine/naming (E2ETest is --e2e-test, not --e-2-e-test); old spellings of commands, flags and shell function names stay accepted.
    • Go module codegen: cmd/codegen can't import core, so module_naming.go mirrors core.Namer, gated on Query.formatIdentifiers like SDK codegen.
  5. Hidden transition aliases in dagql (dagql.Aliases): types, fields (struct-tag fields included), arguments, input object fields and enum values can declare old spellings, optionally limited to some views. Queries are validated against SchemaWithAliasesForView, but Schema, introspection and codegen never see the aliases, which would collide in SDK generators (shortSha/shortSHA → short_sha). Field, argument and type aliases are rewritten to the canonical name at parse time; enum value and input field aliases are resolved by their decoders. Either way the calls, IDs and cache keys are the canonical ones. EnumValues.RenameView renames an enum value per view. Each use adds a dagger.io/dag.alias span event. The in-engine Dang runtime gets a schema JSON with the field, argument, input field and enum value aliases, so Dang callers using old spellings typecheck. Every alias goes through core.NameAliases (core renames, v1 views only) or core.ModuleNameAliases (module renames, every view), so ending the transition is deleting them.
  6. Module renames keep their old names as aliases. Wherever the new rules name a module declaration differently than strcase did, the strcase spelling is a hidden alias: object and interface types, the constructor field, functions, fields and arguments, and enum members (ARM_64 for ARM64; input only, kept on EnumMemberTypeDef.LegacyName). They're accepted on every view, since a module's names follow its own version, not its caller's. Also:
    • CLI: enum flags and collection keys accept legacy member spellings (any case, then a unique match ignoring _/-) and send the canonical name.
    • Go codegen: in-repo cmd/codegen keeps a dependency's old Go identifiers as deprecated aliases (DaggerCli, DaggerCliOpts, VcsCommit next to VCSCommit, enum constants, also re-exported from internal/dagger), recovered by applying the legacy namer to the new schema names. Core output is unchanged.
  7. Core renames, on v1 views only: GitCommit.shortSHA and parentSHAs, Artifacts.filterURI and withoutURI, LLMContentBlock.callID, LLMContentBlockInput.callID, LLM.withToolResult(callID:), GitRepository.withRemote(pushURL:), Workspace.withSDK(asSDKName:), and FunctionCachePolicy's DEFAULT/PER_SESSION/NEVER. The old spellings stay as hidden aliases there; older views are unchanged, and both FunctionCachePolicy spellings decode to the same value (same IDs and cache keys). Each SDK generator keeps a small table of these renames, so it keeps the deprecated identifiers it had instead of deriving new ones. The CLI's workspace git log --json keys stay shortSha/parentShas, and the cloud artifact query keeps filterUri for older cloud engines.
  8. SDK client codegen for Go, TypeScript, Python, Rust, Elixir, PHP, Java and .NET (table below). Only SDK identifiers change: selections, argument names, input object keys, enum values and type names on the wire keep the schema's spelling.
  9. Module runtimes: the Python, PHP, Elixir and Java runtime modules are on engineVersion v1.0.0. Python and TypeScript resolve names for calls through a module's own interfaces with formatIdentifiers (including Python enum members) instead of predicting them.
  10. Design docs: the identifier casing design, plus a separate commit that moves three existing root design docs (migrate-settings-hints-tracking.md, single-query-workspace-module-loading.md, workspace-location-model.md) into hack/designs/.

SDK casing: "when in Rome"

Each SDK follows its language's own acronym convention rather than one house style:

SDK types methods / fields parameters enum values
Go PASCAL/UPPERCASE PASCAL/UPPERCASE (ParentSHAs) CAMEL/UPPERCASE (pushURL) PASCAL/UPPERCASE (NetworkProtocolTCP)
TypeScript schema name CAMEL/UPPERCASE (filterURI) CAMEL/UPPERCASE PASCAL/CAPITALIZED (Tcp, as before)
Python schema name SNAKE (prerequisite_shas) SNAKE SCREAMING_SNAKE (PER_SESSION, value: schema value)
Rust PASCAL/CAPITALIZED (JsonValue, as before) SNAKE SNAKE PASCAL/CAPITALIZED
Elixir PASCAL/UPPERCASE SNAKE SNAKE schema value (atoms)
PHP PASCAL/CAPITALIZED (Llm, JsonValue) CAMEL/CAPITALIZED (withGpu, filterUri) CAMEL/CAPITALIZED SCREAMING_SNAKE
Java PASCAL/CAPITALIZED (Llm, Json, Id) CAMEL/CAPITALIZED (asJson, withGpu) CAMEL/CAPITALIZED SCREAMING_SNAKE (PER_SESSION)
.NET PASCAL/CAPITALIZED (Llm, JsonValue) PASCAL/CAPITALIZED (WithMcpServer) CAMEL/CAPITALIZED (insecureSkipTlsVerify) PASCAL/CAPITALIZED (Tcp)

Type names stay as the schema has them where the runtime looks types up by name (TypeScript, Python). PHP, Java and .NET classes renamed from their GraphQL type carry the wire name (#[GraphQLType('LLM')], @GraphQLType("LLM"), literals in .NET), and enums whose members are renamed carry their schema values (Python ValueEnum, Java GraphQLEnum, .NET [GraphQLValue] with GraphQLEnumConverter<T>).

Compatibility

The gate. Module naming and SDK codegen key on the same API view, v1.0.0 (core.IdentifierNamingVersion is v1.0.0-0, so every prerelease counts):

  • Every module whose engineVersion selects a v1 view is named by engine/naming, including modules already published against v1.0.0 betas and manifest v2 entrypoint modules (served at the engine's own version): MyModHTTPClient, LLMMessage, Python com_url → comURL, enum ARM_64 → ARM64, CLI --e2e-test. Modules below v1.0.0 keep strcase naming byte for byte.
  • Schemas for views below it have no Query.formatIdentifiers, and every SDK generator (and Go module codegen) falls back to its old converter: older schemas regenerate byte-identical clients.
  • The Python and TypeScript runtimes gate on Query.formatIdentifiers in their session schema (served at the module's version).
  • The CLI names commands and flags by its own engine version and keeps accepting the legacy spellings, enum members included.

Transition aliases. Old bindings and queries keep working without regenerating: the old spellings of renamed module names (types, constructors, functions, fields, arguments, enum values; every view) and renamed core names (item 7; v1 views) are hidden aliases that make the same calls as the new names. Python dependency module enums keep their member values (ACTIVE still holds "ACTIVE value"); only core enums use ValueEnum.

Deprecated aliases. Renamed SDK names keep their old spelling, deprecated, wherever the language allows:

  • Go: ParentShas, Sha, ShortSha, Sdks, SshfsVolume, VcsGeneratedPaths, VcsIgnoredPaths (wrappers and opts aliases); enum constants NetworkProtocolTcp/Udp, RegistryProtocolHttp/Https, ImageMediaTypesOcimediaTypes/Oci, ImageLayerCompressionEstarGz. For dependency modules, the old Go identifiers of renamed names (DaggerCli, VcsCommit, ...), in in-repo codegen only.
  • TypeScript: methods filterUri, withoutUri, parentShas, shortSha, callId; Opts types ArtifactUriOpts, ClientHttpOpts, ClientSshfsVolumeOpts, WorkspaceWithSdkOpts, WorkspaceWithoutSdkOpts; opts keys pushUrl, asSdkName; LLMContentBlockInput's callId key (the engine takes it as callID).
  • Python, Rust: prerequisite_sh_as, experimental_with_all_gp_us. Elixir: prerequisite_sh_as. Python enum members keep their old names as aliases (FunctionCachePolicy.PerSession).
  • PHP: member renames are case-only (PHP names are case-insensitive); renamed classes still load under their old spelling through a deprecation-reporting autoloader (Dagger\Service\LegacyClassNames); legacy enum cases stay as deprecated constants (FunctionCachePolicy::PerSession); LLMContentBlockInput keeps its callId property, sent as callID.
  • Java: renamed methods keep deprecated forwarders; renamed enum constants keep deprecated static aliases (FunctionCachePolicy.PerSession).
  • .NET: WithVcsgeneratedPaths, WithVcsignoredPaths, WithMcpserver as [Obsolete] forwarders; renamed enum members as [Obsolete] aliases.

Hard breaks (no alias possible):

  • PHP and .NET named-argument callers: insecureSkipTLSVerify → insecureSkipTlsVerify on Container.from / publish (.NET From / PublishAsync), and expectedRemoteSHA → expectedRemoteSha on GitRef.push.
  • Java and .NET type renames: Java's 17 (ID → Id, JSON → Json, JSONValue → JsonValue, the 11 LLM*, SdkConfig, HttpState, WorkspaceSdk) can't sit next to a case-only alias on case-insensitive file systems; .NET's 16 can't be aliased across assemblies.
  • Python enums: .name (and listing members) now gives PER_SESSION, not PerSession.
  • __typename always returns the new name: the server can't know which spelling a client expects. Old Go bindings' Concrete() fails with "unknown … implementation" for a renamed implementation until they're regenerated.
  • Recorded call IDs that use old names (saved before a rename) don't load: only queries and input decoders go through the aliases.
  • Dang type annotations naming an old type don't typecheck: Dang's schema JSON has no type aliases (a copy of a type is a different type to Dang).
  • Enum type names have no aliases: a query that declares a variable of a renamed enum type fails.
  • Regenerated bindings of renamed modules: SDK identifiers derived from the new names change, and only in-repo Go codegen keeps the old ones. E.g. the in-repo SDK runtime modules are now PythonSDK, PhpSDK, ..., which extension SDKs built on them see; dagger-module.toml Go modules regenerated by the external go-sdk get DaggerCLI where callers say DaggerCli, until the go-sdk port.

Migration Plan

Kept up to date as work lands. Each external repo has an identifier-casing branch reserved for its port.

The SDKs are moving out of this repository (github.com/dagger/{go,python,typescript,php,java,dang}-sdk, see core/sdk/sdkmeta/sdks.json). This PR completes the change against the in-repo code, which is the reference those repositories port from. Old spellings of renamed module and core names stay accepted by the engine as hidden transition aliases (design: "Transition aliases"), so unported SDKs and already-generated bindings keep working while each repo ports at its own pace.

Phase 1: dagger/dagger (this PR)

  • engine/naming, Query.formatIdentifiers, engine module naming, CLI naming
  • In-repo SDK codegen and runtimes (Go, TypeScript, Python, Rust, Elixir, PHP, Java, .NET)
  • dagql hidden transition aliases: fields, arguments, types, input object fields and enum values. Core aliases apply on v1 views only, module aliases on every view. Dang's schema JSON includes them.
  • Module renames declare their legacy spellings as aliases; every v1 module (including manifest v2 entrypoint modules) gets the new naming; drop the +legacy-naming views
  • Module enum value renames get hidden input-only aliases
  • Go bindings keep compiling for renamed dependency modules (legacy wrappers)
  • Rename the non-canonical core names (callId, pushUrl, shortSha, parentShas, filterUri, withoutUri, asSdkName, FunctionCachePolicy values) with the old spellings as aliases
  • CI green (stale checks and remaining triage: @vito)

Phase 2: engine release. Needed before any external port: the ports call Query.formatIdentifiers, which only exists in an engine that has this PR.

Phase 3: external SDK repos (after Phase 2, in any order; each regenerates against the released engine and bumps its pinned engine version):

  • dagger/go-sdk (identifier-casing): port cmd/codegen/generator/go naming (formatted names, legacy wrappers, enum aliases, CoreConstructorName with legacy names) into its fork cmd/dagger-go-sdk-codegen, and module_naming.go for module codegen. That includes the deprecated Go wrappers for renamed dependency names. Without them, regenerating a dagger-module.toml Go module against the new engine renames dag.DaggerCli → dag.DaggerCLI. In this repo, engine-dev, docs-dev and the release module would need caller updates (DaggerCli, CliDev*) when their bindings are regenerated, and they can only be regenerated once CI's engine has this PR. Also update its own call sites of renamed names (e.g. legacyJson → legacyJSON).
  • dagger/sdk-helpers (identifier-casing): update call sites of renamed names (legacyJson → legacyJSON, ...) and regenerate.
  • dagger/typescript-sdk (identifier-casing): re-vendor sdk/typescript (library and runtime naming, introspection_json.ts note) and port cmd/codegen/generator/typescript naming into helpers/codegen.
  • dagger/python-sdk (identifier-casing): port sdk/python/codegen (names file, enum members, aliases) into its sdk/codegen, and ValueEnum plus the interface-call naming into its library.
  • dagger/php-sdk (identifier-casing): port the PHP generator, #[GraphQLType] handling and the LegacyClassNames autoloader.
  • dagger/java-sdk (identifier-casing): port the codegen plugin (three name formats, @GraphQLType, GraphQLEnum) and the annotation processor changes.
  • dagger/dang-sdk (identifier-casing): regenerate entrypoints; check Dang code that uses old spellings (accepted via aliases, except old type names in annotations).
  • dagger/elixir-sdk (identifier-casing, extraction in progress): port sdk/elixir codegen if extraction lands first.
  • Rust and .NET have no external repository yet; their changes here are complete.

Phase 4: dagger/dagger follow-up. Bump the SDK pins in core/sdk/sdkmeta/sdks.json to the ported releases.

Phase 5: end of the transition (after 1.0). Delete core.NameAliases, core.ModuleNameAliases and their callers, plus the deprecated SDK-side aliases.

How to review

It's large, but grouped by layer, and each SDK is self-contained (formatter or engine names → codegen → regenerate). Regenerated files (sdk/*/generated, client.gen.ts, sdk/go/core/core.gen.go, the API reference) can be skimmed using the commit messages, which list every rename. The history keeps two earlier designs that later commits replace: identifier words in the schema JSON (replaced by engine-formatted names), and a full-version gate with +legacy-naming views and legacy-named entrypoint modules (replaced by the v1-view gate and transition aliases, 1281ecc). Reviewing the final diff per file is easier than replaying it.

  1. Design: hack/designs/identifier-casing.md (e4ec0ee, then updated throughout); 98be708 is a pure move.
  2. engine/naming: 826c699, a403a4f, fcb6c75, 0c929ed.
  3. Core API: c04889a, e9bbfc8, 2874419, 8526450; dagql list rendering 9104da3.
  4. Engine, CLI, Go module codegen: d7288fe (core/gqlformat.go, core/module.go, core/typedef.go), 5873008, 140e585, ae418f7, d083dc7, e50874a; the v1-view gate 1281ecc (undoing 92aeeb7's full-version gate); tests 9a6d2e2, cf245e1, ab2a3ce (updated by 3578f5c); c56bdbb restores a builder name main still calls.
  5. Entrypoint modules: named like any v1 module since 1281ecc, with aliases (3578f5c, test 92ff23d). 944e8c8 and c6cb1f9 (legacy naming) and 980f027 (dagql view hook) are undone by 92aeeb7 and 1281ecc; 065be55 (Dang naming views via core.IsNamingField) and c863d00 (design: pinning an entrypoint's naming) stand.
  6. Transition aliases:
  7. Core renames: 6f28e9c, 87f041b; schema d4efe71; SDKs 00875b3 (TypeScript), 07a07f7 (Python), 518a021 (Rust), 010930e (Elixir), 7d3cbd7 (PHP), 8f30428 (Java), b61db65 (.NET), b59368c (Go); tests 0e85761; design 3bf80a3.
  8. Codegen through the engine: b74d37e, b560513, dabc9a4, 8021fd1 (and its self binding, 3eb1561), b338e5d.
  9. SDK clients (final shape; earlier per-SDK "identifier word formatter" commits are superseded):
  10. Module runtimes: 730a7ff, 4301cc5, c6b7f3e, 4c00f63 (Python); ca916b5 (TypeScript); 5d4f2ca, c30a4b3 (PHP); 8237e94, 2630a27 (Elixir); f943991, a25fdec (Java); 26f0e10 removes the temporary __formatIdentifiers.

Testing

  • Unit and generator tests ran locally: engine/naming (vectors, guarantees, core schema names), core / core/schema / core/sdk/... / dagql tests, cmd/codegen, the runtime modules' Go tests, Python unit tests and lint, PHPStan and CodeSniffer, java-client codegen tests and lint, the .NET source generator tests, and the staleness checks of every regenerated client.
  • New unit tests for the aliases: dagql/aliases_test.go, enum_aliases_test.go, input_aliases_test.go; TestNameAliasesView, TestModuleNameAliases, TestModuleEnumLegacyMemberAliases, TestSchemaJSONAliases, TestCoreRenamedNames (and PreV1); Go codegen's legacy_names_test.go.
  • New integration tests: TestIdentifier, ModuleNamingSuite (module naming by version, v1 prereleases, legacy enum member literals, CLI flags), and TestModuleEntrypointLegacyNameAliases.
  • CI before the last rebase (becb6d2) passed except TestModuleEntrypointLegacyNameAliases (fixed in 92ff23d) and go-sdk/generate/stale (likely the missing self binding fixed in 3eb1561; unconfirmed).
  • Deliberately left for CI: the integration tests and engine-backed SDK tests (php-client/test, java-client/test, dotnet-client/test). The Java and .NET enum converters and the PHP legacy-class autoloader run against an engine there for the first time. The in-repo modules' committed dagger.gen.go files weren't regenerated for the core renames (their old names work through the aliases), so their staleness checks are expected to flag them.

Follow-ups and open questions

  • Entrypoint naming pin: no longer blocking, since entrypoint modules use v1 naming with aliases. A pinned naming version (a namingVersion-style key, Load modules through manifest v2 entrypoints #14038) only matters before the first dictionary addition; see the design's "Module entrypoints".
  • TypeScript's convention is ambiguous (XMLHttpRequest, innerHTML): members follow the schema's UPPERCASE, enum members keep the generator's Tcp style. Worth a call with the TypeScript maintainers.
  • Deprecated aliases at 1.0: proposed to keep them, and the engine's transition aliases, through 1.0 as a transition aid.
  • Input object field names: existing bugs in Rust and Elixir, where input object fields are sent by the SDK's name; worked around here (Send input object fields by schema name #14636 fixes them separately).
  • Remaining strcase: the legacy Namer path, the ConfigureAcronym calls in core/llm.go / core/json.go, and withFinalTypeName stay while modules below the gate exist.
  • CLI naming follows the CLI's engine version, not each module's.
  • Alias gaps: @cache(policy:) introspection still shows the internal PerSession values; alias names can show up in validation's "Did you mean …" suggestions.
  • Stale PHP generated files that predate this PR (ContainerId.php, LLMId.php, ...) are left in sdk/php/generated/.

Refs #13668

API changes

go -C hack/sdl-diff run . ce10b54a63bfdea982af4b64c52d48fb70490cba:docs/docs-graphql/schema.graphqls 87f041b18f3b5efe69108032ec7a47d6ab2e18b5:docs/docs-graphql/schema.graphqls

# Added
"""
How acronyms and terms are written where a word starts with a capital.
"""
enum AcronymStyle {
  """
  HTTPClient, IPv6Address, GitHubRepo
  """
  UPPERCASE
  """
  HttpClient, Ipv6Address, GitHubRepo
  """
  CAPITALIZED
}

extend type Artifacts {
  # Added
  """
  Remove artifacts selected by a DAG address.
  """
  withoutURI(uri: String!): Artifacts!
  # Added
  """
  Apply a DAG address as one filter: the chain of path, type, and dimension-key filters it encodes.

  The scheme is optional. The path may be a pattern; an empty path selects all artifacts.
  """
  filterURI(
    """
    A DAG address: [dag[+<type>]://][<path>][?<dimension>=<key>&...]
    """
    uri: String!
  ): Artifacts!
  # Description changed
  """
  The DAG address that selects this whole selection: filterURI(uri) selects the same set.
  """
  uri: String!
  # Removed: withoutUri(uri: String!): Artifacts!
  # Removed: filterUri(uri: String!): Artifacts!
}

# Added
"""
A convention for joining words into an identifier.
"""
enum Casing {
  """
  HTTPClient
  """
  PASCAL
  """
  httpClient
  """
  CAMEL
  """
  http_client
  """
  SNAKE
  """
  HTTP_CLIENT
  """
  SCREAMING_SNAKE
  """
  http-client
  """
  KEBAB
  """
  httpclient (output only: drops word boundaries)
  """
  FLAT
}

extend enum FunctionCachePolicy {
  # Added
  DEFAULT
  # Added
  PER_SESSION
  # Added
  NEVER
  # Removed: Default
  # Removed: PerSession
  # Removed: Never
}

extend type GitCommit {
  # Added
  """
  The abbreviated commit SHA.
  """
  shortSHA: String!
  # Added
  """
  Parent commit SHAs.
  """
  parentSHAs: [String!]!
  # Removed: shortSha: String!
  # Removed: parentShas: [String!]!
}

extend type GitRepository {
  # Changed: previously withRemote(name: String!, url: String!, pushUrl: String = ""): GitRepository!
  """
  Register a named remote on this repository, replacing any registered remote of the same name.

  Registered remotes are recorded in checkouts materialized from this repository
  (GitRef.tree, Workspace.git.directory), so remote-aware tooling like gh can
  resolve and fetch from them. The origin remote also routes push when no
  explicit destination is passed: its push URL, or its URL, becomes the default
  destination.

  Routing metadata only, never a credential grant: pushes still authenticate
  with the caller's own credentials and require approval as usual.
  """
  withRemote(
    """
    The remote's name, e.g. "origin" or "upstream".
    """
    name: String!

    """
    The remote's fetch URL.
    """
    url: String!

    """
    Push destination, when pushes go somewhere other than url. Empty uses url.
    """
    pushURL: String = ""
  ): GitRepository!
}

# Added
"""
A name parsed into words, which can be formatted in any casing.
"""
type Identifier implements Node {
  """
  A unique identifier for this Identifier.
  """
  id: ID!
  """
  Format the identifier in a casing.
  """
  format(
    """
    The casing to format the identifier in.
    """
    casing: Casing!

    """
    How to write acronyms and terms where a word starts with a capital.
    """
    acronyms: AcronymStyle = UPPERCASE
  ): String!
  """
  The name as given.
  """
  name: String!
  """
  The words that make up the name, in order.
  """
  words: [IdentifierWord!]!
}

# Added
"""
One word of an identifier.
"""
type IdentifierWord implements Node {
  """
  A unique identifier for this IdentifierWord.
  """
  id: ID!
  """
  The dictionary entry this word matched, if any.
  """
  term: NamingTerm
  """
  Standard spelling: "client" (WORD), "HTTP" (ACRONYM), "GitHub" (TERM).
  """
  text: String!
  """
  A plural "s" and/or trailing digits: SHA+"s", OAuth+"2".
  """
  suffix: String!
  """
  The kind of word.
  """
  kind: IdentifierWordKind!
}

# Added
"""
The kind of a word in an identifier.
"""
enum IdentifierWordKind {
  """
  An ordinary word.
  """
  WORD
  """
  An acronym, from the dictionary or a run of capitals.
  """
  ACRONYM
  """
  A dictionary term with a fixed mixed-case spelling (GitHub, IPv6).
  """
  TERM
}

extend type LLM {
  # Description changed
  """
  Discover every artifact this conversation can address, as one selection, without evaluating their values.

  Tool objects bound with withTools contribute their modules' artifacts, rooted
  at their current values: evaluating one reads the live state of the bound
  tools, not a fresh construction. If a module's main object is bound, only its
  tree is included; otherwise each bound object of that module contributes its
  own tree. Addresses start with the module name. These artifacts have no
  workspace of their own: they evaluate in the LLM's bound workspace, if any,
  whoever evaluates them.

  The workspace part is the artifacts of the workspace bound with withWorkspace,
  as returned by Workspace.artifacts; an LLM with no bound workspace has none. A
  workspace module with the same name as a module with bound tool objects is
  omitted: the bound tools shadow it. Unless they are only a plain construction
  of the module, which has no state of its own: then the workspace module's
  artifacts are kept instead.

  Tool arguments that take an address resolve it here: a DAG address to one
  object, or, for Artifacts and Artifact arguments, a selection filtered like
  filterURI.
  """
  artifacts(
    """
    Only include artifacts matching these path patterns, as with
    Workspace.artifacts. A path selects that path and its children.
    """
    include: [String!]
  ): Artifacts! @experimental(reason: "Agent APIs are likely to change.")
  # Changed: previously withToolResult(callId: String!, content: String!, errored: Boolean!, blocks: [LLMContentBlockInput!] = []): LLM!
  """
  Append the result of a tool call to the message history.
  """
  withToolResult(
    """
    The ID of the tool call this result responds to
    """
    callID: String!

    """
    Text returned by the tool, placed before blocks
    """
    content: String!

    """
    Whether the tool call resulted in an error
    """
    errored: Boolean!

    """
    Ordered text and media returned by the tool
    """
    blocks: [LLMContentBlockInput!] = []
  ): LLM!
}

extend type LLMContentBlock {
  # Added
  """
  The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
  """
  callID: String!
  # Removed: callId: String!
}

extend input LLMContentBlockInput {
  # Added
  """
  The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
  """
  callID: String = ""
  # Removed: callId: String = ""
}

# Added
"""
An entry in the naming dictionary.
"""
type NamingTerm implements Node {
  """
  A unique identifier for this NamingTerm.
  """
  id: ID!
  """
  Standard spelling: "HTTP", "IPv6", "GitHub", "iOS".
  """
  spelling: String!
  """
  Spelling in the CAPITALIZED style: "Http", "Ipv6", "GitHub", "Ios".
  """
  capitalized: String!
}

extend type Query {
  # Added
  """
  Parse a name in any casing into words.

  Known acronyms and terms come from the naming dictionary; everything else
  falls back to the case heuristic. Errors on non-ASCII input or input with no
  letters or digits.
  """
  identifier(
    """
    The name to parse.
    """
    name: String!
  ): Identifier! @experimental(reason: "Identifier casing APIs are likely to change.")
  # Added
  """
  Format many names at once, for codegen. Returns them in input order.
  """
  formatIdentifiers(
    """
    The names to format, in any casing.
    """
    names: [String!]!

    """
    The casing to format the names in.
    """
    casing: Casing!

    """
    How to write acronyms and terms where a word starts with a capital.
    """
    acronyms: AcronymStyle = UPPERCASE

    """
    The engine version whose naming dictionary to parse the names with, e.g. the
    __schemaVersion of a schema being generated. Defaults to the caller's engine
    version.
    """
    version: String
  ): [String!]! @experimental(reason: "Identifier casing APIs are likely to change.")
  # Added
  """
  The acronyms and terms used to parse and format identifiers.
  """
  namingDictionary: [NamingTerm!]! @experimental(reason: "Identifier casing APIs are likely to change.")
}

extend type Workspace {
  # Description changed
  """
  Resolve an address in this workspace.

  A DAG address (dag://<path>) selects exactly one workspace artifact:
  artifacts.filterURI(value).one(). Its typed loaders use that artifact and
  never fall back to external resolution.

  A value without the dag:// scheme keeps its external meaning, such as a container image reference.

  The Address retains this workspace across module calls and ID reloads.
  """
  resolve(
    """
    A DAG address, or an external reference.
    """
    value: String!
  ): Address!
  # Changed: previously withSDK(ref: String!, name: String = "", here: Boolean = false, asSdkName: String = ""): Workspace!
  """
  Return this workspace with an SDK installed in its config.
  """
  withSDK(
    """
    SDK module reference to install.
    """
    ref: String!

    """
    Override name for the installed SDK entry.
    """
    name: String = ""

    """
    Write to the workspace config directory at the workspace cwd.
    """
    here: Boolean = false

    """
    Optional override for the SDK name conventionally derived from the installed module name.
    """
    asSDKName: String = ""
  ): Workspace!
}
Detailed diff
+"""
+How acronyms and terms are written where a word starts with a capital.
+"""
+enum AcronymStyle {
+  """
+  HttpClient, Ipv6Address, GitHubRepo
+  """
+  CAPITALIZED
+  """
+  HTTPClient, IPv6Address, GitHubRepo
+  """
+  UPPERCASE
+}

 extend type Artifacts {
   """
   Apply a DAG address as one filter: the chain of path, type, and dimension-key filters it encodes.
   
   The scheme is optional. The path may be a pattern; an empty path selects all artifacts.
   """
-  filterUri(
+  filterURI(
     """
     A DAG address: [dag[+<type>]://][<path>][?<dimension>=<key>&...]
     """
     uri: String!
   ): Artifacts!
   """
-  The DAG address that selects this whole selection: filterUri(uri) selects the same set.
+  The DAG address that selects this whole selection: filterURI(uri) selects the same set.
   """
   uri: String!
   """
   Remove artifacts selected by a DAG address.
   """
-  withoutUri(uri: String!): Artifacts!
+  withoutURI(uri: String!): Artifacts!
 }

+"""
+A convention for joining words into an identifier.
+"""
+enum Casing {
+  """
+  httpClient
+  """
+  CAMEL
+  """
+  httpclient (output only: drops word boundaries)
+  """
+  FLAT
+  """
+  http-client
+  """
+  KEBAB
+  """
+  HTTPClient
+  """
+  PASCAL
+  """
+  HTTP_CLIENT
+  """
+  SCREAMING_SNAKE
+  """
+  http_client
+  """
+  SNAKE
+}

 extend enum FunctionCachePolicy {
-  Default
-  Never
-  PerSession
+  DEFAULT
+  NEVER
+  PER_SESSION
 }

 extend type GitCommit {
   """
   Parent commit SHAs.
   """
-  parentShas: [String!]!
+  parentSHAs: [String!]!
   """
   The abbreviated commit SHA.
   """
-  shortSha: String!
+  shortSHA: String!
 }

 extend type GitRepository {
   """
   Register a named remote on this repository, replacing any registered remote of the same name.
   
   Registered remotes are recorded in checkouts materialized from this repository
   (GitRef.tree, Workspace.git.directory), so remote-aware tooling like gh can
   resolve and fetch from them. The origin remote also routes push when no
   explicit destination is passed: its push URL, or its URL, becomes the default
   destination.
   
   Routing metadata only, never a credential grant: pushes still authenticate
   with the caller's own credentials and require approval as usual.
   """
   withRemote(
     """
     The remote's name, e.g. "origin" or "upstream".
     """
     name: String!
 
     """
     Push destination, when pushes go somewhere other than url. Empty uses url.
     """
-    pushUrl: String = ""
+    pushURL: String = ""
 
     """
     The remote's fetch URL.
     """
     url: String!
   ): GitRepository!
 }

+"""
+A name parsed into words, which can be formatted in any casing.
+"""
+type Identifier implements Node {
+  """
+  Format the identifier in a casing.
+  """
+  format(
+    """
+    How to write acronyms and terms where a word starts with a capital.
+    """
+    acronyms: AcronymStyle = UPPERCASE
+
+    """
+    The casing to format the identifier in.
+    """
+    casing: Casing!
+  ): String!
+  """
+  A unique identifier for this Identifier.
+  """
+  id: ID!
+  """
+  The name as given.
+  """
+  name: String!
+  """
+  The words that make up the name, in order.
+  """
+  words: [IdentifierWord!]!
+}

+"""
+One word of an identifier.
+"""
+type IdentifierWord implements Node {
+  """
+  A unique identifier for this IdentifierWord.
+  """
+  id: ID!
+  """
+  The kind of word.
+  """
+  kind: IdentifierWordKind!
+  """
+  A plural "s" and/or trailing digits: SHA+"s", OAuth+"2".
+  """
+  suffix: String!
+  """
+  The dictionary entry this word matched, if any.
+  """
+  term: NamingTerm
+  """
+  Standard spelling: "client" (WORD), "HTTP" (ACRONYM), "GitHub" (TERM).
+  """
+  text: String!
+}

+"""
+The kind of a word in an identifier.
+"""
+enum IdentifierWordKind {
+  """
+  An acronym, from the dictionary or a run of capitals.
+  """
+  ACRONYM
+  """
+  A dictionary term with a fixed mixed-case spelling (GitHub, IPv6).
+  """
+  TERM
+  """
+  An ordinary word.
+  """
+  WORD
+}

 extend type LLM {
   """
   Discover every artifact this conversation can address, as one selection, without evaluating their values.
   
   Tool objects bound with withTools contribute their modules' artifacts, rooted
   at their current values: evaluating one reads the live state of the bound
   tools, not a fresh construction. If a module's main object is bound, only its
   tree is included; otherwise each bound object of that module contributes its
   own tree. Addresses start with the module name. These artifacts have no
   workspace of their own: they evaluate in the LLM's bound workspace, if any,
   whoever evaluates them.
   
   The workspace part is the artifacts of the workspace bound with withWorkspace,
   as returned by Workspace.artifacts; an LLM with no bound workspace has none. A
   workspace module with the same name as a module with bound tool objects is
   omitted: the bound tools shadow it. Unless they are only a plain construction
   of the module, which has no state of its own: then the workspace module's
   artifacts are kept instead.
   
   Tool arguments that take an address resolve it here: a DAG address to one
   object, or, for Artifacts and Artifact arguments, a selection filtered like
-  filterUri.
+  filterURI.
   """
   artifacts(
     """
     Only include artifacts matching these path patterns, as with
     Workspace.artifacts. A path selects that path and its children.
     """
     include: [String!]
   ): Artifacts! @experimental(reason: "Agent APIs are likely to change.")
   """
   Append the result of a tool call to the message history.
   """
   withToolResult(
     """
     Ordered text and media returned by the tool
     """
     blocks: [LLMContentBlockInput!] = []
 
     """
     The ID of the tool call this result responds to
     """
-    callId: String!
+    callID: String!
 
     """
     Text returned by the tool, placed before blocks
     """
     content: String!
 
     """
     Whether the tool call resulted in an error
     """
     errored: Boolean!
   ): LLM!
 }

 extend type LLMContentBlock {
   """
   The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
   """
-  callId: String!
+  callID: String!
 }

 extend input LLMContentBlockInput {
   """
   The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).
   """
-  callId: String = ""
+  callID: String = ""
 }

+"""
+An entry in the naming dictionary.
+"""
+type NamingTerm implements Node {
+  """
+  Spelling in the CAPITALIZED style: "Http", "Ipv6", "GitHub", "Ios".
+  """
+  capitalized: String!
+  """
+  A unique identifier for this NamingTerm.
+  """
+  id: ID!
+  """
+  Standard spelling: "HTTP", "IPv6", "GitHub", "iOS".
+  """
+  spelling: String!
+}

 extend type Query {
+  """
+  Format many names at once, for codegen. Returns them in input order.
+  """
+  formatIdentifiers(
+    """
+    How to write acronyms and terms where a word starts with a capital.
+    """
+    acronyms: AcronymStyle = UPPERCASE
+
+    """
+    The casing to format the names in.
+    """
+    casing: Casing!
+
+    """
+    The names to format, in any casing.
+    """
+    names: [String!]!
+
+    """
+    The engine version whose naming dictionary to parse the names with, e.g. the
+    __schemaVersion of a schema being generated. Defaults to the caller's engine
+    version.
+    """
+    version: String
+  ): [String!]! @experimental(reason: "Identifier casing APIs are likely to change.")
+  """
+  Parse a name in any casing into words.
+  
+  Known acronyms and terms come from the naming dictionary; everything else
+  falls back to the case heuristic. Errors on non-ASCII input or input with no
+  letters or digits.
+  """
+  identifier(
+    """
+    The name to parse.
+    """
+    name: String!
+  ): Identifier! @experimental(reason: "Identifier casing APIs are likely to change.")
+  """
+  The acronyms and terms used to parse and format identifiers.
+  """
+  namingDictionary: [NamingTerm!]! @experimental(reason: "Identifier casing APIs are likely to change.")
 }

 extend type Workspace {
   """
   Resolve an address in this workspace.
   
   A DAG address (dag://<path>) selects exactly one workspace artifact:
-  artifacts.filterUri(value).one(). Its typed loaders use that artifact and
+  artifacts.filterURI(value).one(). Its typed loaders use that artifact and
   never fall back to external resolution.
   
   A value without the dag:// scheme keeps its external meaning, such as a container image reference.
   
   The Address retains this workspace across module calls and ID reloads.
   """
   resolve(
     """
     A DAG address, or an external reference.
     """
     value: String!
   ): Address!
   """
   Return this workspace with an SDK installed in its config.
   """
   withSDK(
     """
     Optional override for the SDK name conventionally derived from the installed module name.
     """
-    asSdkName: String = ""
+    asSDKName: String = ""
 
     """
     Write to the workspace config directory at the workspace cwd.
     """
     here: Boolean = false
 
     """
     Override name for the installed SDK entry.
     """
     name: String = ""
 
     """
     SDK module reference to install.
     """
     ref: String!
   ): Workspace!
 }

vito added 7 commits October 5, 2026 18:48
Centralize case conversion in the engine behind a core API: parse names
into words using a versioned dictionary of acronyms and terms, falling
back to a case heuristic, then format them in any casing and acronym
style. Replaces strcase in the engine and the per-SDK converters, which
disagree today (e.g. prerequisite_sh_as, JsonValue vs JSONValue).

Refs dagger#13668

Signed-off-by: Alex Suraci <[email protected]>
Keep design docs in one place alongside the rest.

Signed-off-by: Alex Suraci <[email protected]>
Add engine/naming, the single implementation of identifier case conversion
described in hack/designs/identifier-casing.md: parse a name in any casing
into WORD/ACRONYM/TERM words using a dictionary of acronyms and terms with a
case heuristic as fallback, and format them as PASCAL, CAMEL, SNAKE,
SCREAMING_SNAKE, KEBAB or FLAT in UPPERCASE or CAPITALIZED acronym style.

The initial dictionary is a fixed value so later engine versions can add
terms in a new dictionary without renaming anything for older modules.

Tests cover the design's test vectors, its guarantees, and the canonical-name
measurements against the core schema.

Signed-off-by: Alex Suraci <[email protected]>
Expose engine/naming through Query.identifier, Query.formatIdentifiers and
Query.namingDictionary, with the Identifier, IdentifierWord, NamingTerm,
IdentifierWordKind, Casing and AcronymStyle types from the identifier casing
design. The API is experimental and only visible to v1.0.0+ clients.

formatIdentifiers returns plain strings so SDK codegen can format thousands of
names in one round trip instead of loading an Identifier per name.

Identifiers persist their words rather than re-parsing, so a cached value keeps
formatting the same way if the dictionary changes.

Signed-off-by: Alex Suraci <[email protected]>
Regenerate the schema snapshot, API reference pages, and the Go, Python,
TypeScript, Elixir, PHP and Rust clients for the identifier casing API.

Signed-off-by: Alex Suraci <[email protected]>
Update the design to match engine/naming where the spec was ambiguous or
contradicted its test vectors:

- digit gluing appends to an ordinary word's text rather than a suffix, as
  the vectors show (base64, v1, s3)
- a fourth segmentation tiebreak keeps digits in heuristic words
- the guarantees exclude names made only of acronyms in PASCAL/UPPERCASE
  (htmlURL -> HTMLURL), which parse caseless; E2EAPI -> e2eapi rules out
  splitting them
- the field/argument counts measured on main are 696 of 703
- record the capitalized forms of the initial terms and API notes

Signed-off-by: Alex Suraci <[email protected]>
Input with no lowercase letters was caseless and never split, so a Go type
like JSONAPI became Jsonapi, and htmlURL in PASCAL (HTMLURL) didn't come back
unchanged. Each chunk of all-caps input is now eligible for the same full
dictionary cover as a caps piece: JSONAPI is JSON · API, while HTTP_CLIENT
and HTTPX_CLIENT stay as they were because CLIENT and HTTPX can't be covered.
All-lowercase input still never splits.

The asymmetry means a lowercase word spelled like a run of entries changes in
SCREAMING_SNAKE. The core schema's only case is sshfsVolume, so SSHFS joins
the initial dictionary.

The design doc's parsing steps, guarantees, known limitations, test vectors
and open question 4 are updated to match.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito requested review from a team as code owners October 5, 2026 20:00
vito added 16 commits October 7, 2026 04:25
testdata/vectors.json gives SDK formatters in other languages the words
(kind, text, suffix, capitalized) and every casing for each non-error input
in the package's tests, plus names from the core schema. It is generated
with `go test ./engine/naming -run TestSharedVectors -update`;
TestSharedVectors fails when it is stale, and
TestSharedVectorsFormatFromWords checks that the words alone reproduce
Format, as an SDK without a dictionary would.

Signed-off-by: Alex Suraci <[email protected]>
Schema JSON from v1.0.0 engines carries a top-level "__identifiers" map
from each schema name to its parsed words, so offline codegen can format
names without the naming dictionary. Response now (un)marshals that key
to/from Schema.Identifiers, which Include/Exclude carry along, and
(*Schema).Identifier rebuilds a naming.Identifier from the words so Go
codegen can reuse naming.Format. Identifiers.AddSchema builds the map for
the engine. Generator output is unchanged.

A test checks the words against engine/naming/testdata/vectors.json and
that rebuilt identifiers format exactly like parsed ones.

Signed-off-by: Alex Suraci <[email protected]>
codegen.naming formats the words the engine parses schema names into
(PASCAL, CAMEL, SNAKE, SCREAMING_SNAKE, with UPPERCASE or CAPITALIZED
acronyms), mirroring engine/naming. Tests run it against the engine's
shared vectors.

Signed-off-by: Alex Suraci <[email protected]>
When the schema JSON carries __identifiers (engine views v1.0.0-0 and
later), method, argument and input field names are the engine's words in
SNAKE, then escaped for keywords and builtins as before. That fixes
names like prerequisite_sh_as (now prerequisite_shas) where the old
converter guessed at acronyms. Without __identifiers, or for a name it
doesn't cover, the old converter still runs, so older schemas generate
the same code.

A method whose name changed keeps its old one as a deprecated alias.

Class and enum member names stay the schema's own: the runtime selects
types by class name and sends enum members by name, and the engine's
names are already PASCAL and SCREAMING_SNAKE (except for legacy enum
values, which have SCREAMING_SNAKE aliases).

Signed-off-by: Alex Suraci <[email protected]>
Live introspection (introspection.Introspect, and `codegen introspect`,
which writes the JSON the Python, PHP and Rust client builds read) uses the
GraphQL introspection query, which can't carry "__identifiers". When the
engine's schema has Query.identifier (v1.0.0 views), FetchIdentifiers now
asks it for the words of every name, in batches of aliased queries, so the
result matches the engine's schema JSON and uses its version-selected
dictionary. Older engines leave Identifiers nil.

Signed-off-by: Alex Suraci <[email protected]>
Schema JSON handed to SDK codegen now carries a top-level "__identifiers"
map from every type, field, argument, input field and enum value name to
its parsed words (kind, text, suffix, capitalized), so codegen that runs
offline from the JSON can format names in any casing without the
dictionary. It is emitted for views at v1.0.0-0 or later, the identifier
API's gate, with the dictionary namingDictionaryFor selects; older views
leave it out and SDKs keep their own converters.

This covers __schemaJSONFile (and so module and client introspection JSON),
Schema.merge, which parses the names a merge adds, and cmd/introspect.
__schemaJSONFile results are already cached per view, so the gate keeps
them distinct; a test interleaves both views on one cache.

Signed-off-by: Alex Suraci <[email protected]>
Add a "Schema JSON words" subsection under SDK Integration with the
__identifiers contract, how SDKs format the words, the v1.0.0 gate and the
fallback, and mark Open Question 3 (offline codegen) resolved.

Signed-off-by: Alex Suraci <[email protected]>
The Python codegen tests check its identifier formatter against the
engine's shared test vectors, engine/naming/testdata/vectors.json. Mount
that one file in the dev container and point DAGGER_NAMING_VECTORS at it,
since pytest runs the SDK from a copy without the rest of the repository.

Signed-off-by: Alex Suraci <[email protected]>
Two methods change name, keeping the old ones as deprecated aliases:

- Container.experimental_with_all_gp_us -> experimental_with_all_gpus
- GitBundle.prerequisite_sh_as -> prerequisite_shas

Signed-off-by: Alex Suraci <[email protected]>
When the schema JSON carries identifier words (engine views v1.0.0-0 and
later), Go client codegen formats names from them instead of guessing
acronyms with golint's initialism list, which lacks SHA, VCS, SSHFS and
GPU:

- types and methods: PASCAL/UPPERCASE (ParentShas -> ParentSHAs)
- parameters: CAMEL/UPPERCASE, then keyword escaping (pushUrl -> pushURL)
- enum value constants: PASCAL/CAPITALIZED, the closest casing to the
  strcase.ToCamel they had, so TCP stays Tcp; only boundaries strcase got
  wrong change (OCIMediaTypes: OcimediaTypes -> OciMediaTypes)

Names without words keep the legacy conversion, so older schemas generate
byte-identical code. Wire strings (selections, argument names, enum values,
GraphQL type names) and the private field caches are unchanged.

Renamed methods keep their old name as a deprecated wrapper, and renamed
option structs and enum constants as deprecated aliases, so regenerating a
client against a v1 engine doesn't break callers.

Signed-off-by: Alex Suraci <[email protected]>
cmd/codegen/introspection now imports engine/naming, so generating the Go
SDK client failed to build codegen without it.

Signed-off-by: Alex Suraci <[email protected]>
Move tests off the deprecated wrappers (Sha, ShortSha, ParentShas,
SshfsVolume, ImageLayerCompressionEstarGz, ImageMediaTypesOcimediaTypes),
which staticcheck flags.

Signed-off-by: Alex Suraci <[email protected]>
When the schema carries the engine's identifier words, TypeScript client
codegen formats names from them instead of guessing with toPascalCase:

- methods, args and opts keys: CAMEL / UPPERCASE
- Opts types and enum converter prefixes: PASCAL / UPPERCASE
- enum members: PASCAL / CAPITALIZED, the closest match to what the
  generator has always written (Tcp, ObjectKind)

Only TypeScript identifiers change. Field names in select, arg keys,
input object fields and enum values stay as the schema has them:
required args are keyed by their schema name, and renamed opts keys are
mapped back to it before the call. Type names are left alone, since the
runtime looks generated classes up by GraphQL type name; in views with
words they are canonical already, which a test checks.

Renamed methods, Opts types and opts keys keep their old names as
deprecated aliases. Without words, every name falls back to the legacy
converters, so older schemas generate byte-identical code.

Signed-off-by: Alex Suraci <[email protected]>
Modules at engine version v1.0.0 and up get their type, field, function,
argument and enum member names normalized by engine/naming instead of
strcase; older modules keep the strcase rules byte for byte. This is the
fix for module types that reference core types starting with an acronym
(LLMMessage, JSONValue), which strcase respelled (Llmmessage) so they
resolved to a namespaced copy, and for mangled module names
(MyModHttpclient becomes MyModHTTPClient).

The rules are a core.Namer, selected by engine version:

- Typedef constructors take it from the view of their call. They now
  record the caller's view (View(AllVersion)), so a module's runtime,
  which calls at the view of its engineVersion, gets its own rules, and
  the cache keeps the results apart. Public constructors pass the view on
  to the internal ones they delegate to. The in-engine Dang runtime stamps
  its module's view on those selectors itself.
- Module assembly (namespacing, which now compares word lists, lookups,
  the constructor field name) uses Module.Namer, from the module source's
  engineVersion.
- CLI paths of checks, generators and artifacts are spelled by the rules
  of the module that defines them; patterns, addresses and pre-load
  module matching accept the spellings of both rules.

References to a dependency's types that only miss because the two
modules name by different rules fall back to the dependency type with the
same normalized name. Engine calls into SDK modules spell the interface
arguments (introspectionJson) by the SDK module's rules.

The strcase acronym workarounds in llm.go and json.go and the
withFinalTypeName re-application stay, documented, for as long as the
legacy rules exist.

Signed-off-by: Alex Suraci <[email protected]>
The CLI derives command, flag and type names from schema names. It now
spells them by the naming rules of the engine version it ships with
(e2eTest is --e2e-test, not --e-2-e-test): the typedefs it loads don't
say which engine version each module declares, so a per-module choice
isn't available, and a client follows the version it connects with.

What users type still resolves by the legacy rules too: legacy flag
spellings are normalized to the current ones, legacy command spellings
are aliases, and module constructors and type names match either
spelling.

Signed-off-by: Alex Suraci <[email protected]>
Renamed in the core client, each keeping its old name as a deprecated
alias:

- methods: Artifacts.filterUri -> filterURI, Artifacts.withoutUri ->
  withoutURI, GitCommit.parentShas -> parentSHAs, GitCommit.shortSha ->
  shortSHA, LLMContentBlock.callId -> callID
- Opts types: ArtifactUriOpts -> ArtifactURIOpts, ClientHttpOpts ->
  ClientHTTPOpts, ClientSshfsVolumeOpts -> ClientSSHFSVolumeOpts,
  WorkspaceWithSdkOpts -> WorkspaceWithSDKOpts, WorkspaceWithoutSdkOpts ->
  WorkspaceWithoutSDKOpts
- opts keys: GitRepositoryWithRemoteOpts.pushUrl -> pushURL,
  WorkspaceWithSDKOpts.asSdkName -> asSDKName

The LLM.withToolResult parameter callId becomes callID. Types, enum
members and everything sent over the wire are unchanged.

Signed-off-by: Alex Suraci <[email protected]>
vito added 9 commits October 13, 2026 20:12
Elixir derived a function's deprecated alias from its schema name, which
would now give parentSHAs a parent_sh_as alias that never existed: its
old name, parentShas, gave parent_shas, as the new one does. Codegen now
derives the alias from the old schema name of a renamed core field, from
a small table of them. None of the renamed names changes an Elixir name,
so no alias is needed.

Regenerated: shortSha -> shortSHA, parentShas -> parentSHAs, filterUri ->
filterURI, withoutUri -> withoutURI, callId -> callID, pushUrl ->
pushURL, asSdkName -> asSDKName on the wire, and FunctionCachePolicy's
values :DEFAULT, :PER_SESSION and :NEVER (functions unchanged).

Signed-off-by: Alex Suraci <[email protected]>
PHP kept FunctionCachePolicy's legacy values as deprecated constants
next to their SCREAMING_SNAKE cases. With the values renamed, codegen
finds the old names in a small table of renamed core names and keeps
Default, PerSession and Never as deprecated constants of the new cases.

LLMContentBlockInput's callID field keeps its old property, callId, so
named arguments still work: input objects now map a property named
otherwise to its schema name (FIELD_NAMES) when they're sent.

Regenerated: shortSha -> shortSHA, parentShas -> parentSHAs, filterUri ->
filterURI, withoutUri -> withoutURI, callId -> callID, pushUrl ->
pushURL, asSdkName -> asSDKName on the wire, and FunctionCachePolicy's
values DEFAULT, PER_SESSION and NEVER. Method and parameter names don't
change.

Signed-off-by: Alex Suraci <[email protected]>
Java derived deprecated aliases from schema names: with the renamed core
names, that would add aliases that never existed (shortSHA(),
withPushURL(), getCallID()) and drop FunctionCachePolicy's Default,
PerSession and Never constants. Codegen now takes the old schema names of
renamed core names from a small table: methods, setters and accessors
keep the names they had (shortSha(), withPushUrl(), getCallId()), and the
old values stay as deprecated constants.

Renamed on the wire: shortSha -> shortSHA, parentShas -> parentSHAs,
filterUri -> filterURI, withoutUri -> withoutURI, callId -> callID,
pushUrl -> pushURL, asSdkName -> asSDKName, and FunctionCachePolicy's
values DEFAULT, PER_SESSION and NEVER.

Signed-off-by: Alex Suraci <[email protected]>
The source generator named obsolete forwarders, input properties and
enum aliases after schema names: with the renamed core names, it would
add ones that never existed (ShortSHAAsync, CallID, a DEFAULT member).
It now takes the old schema names of renamed core names from a small
table, so the generated names stay as they were (ShortShaAsync, CallId,
FunctionCachePolicy.Default), with no alias needed.

Regenerated the core schema fixtures. Renamed on the wire: shortSha ->
shortSHA, parentShas -> parentSHAs, filterUri -> filterURI, withoutUri ->
withoutURI, callId -> callID, pushUrl -> pushURL, asSdkName -> asSDKName,
and FunctionCachePolicy's values DEFAULT, PER_SESSION and NEVER.

Signed-off-by: Alex Suraci <[email protected]>
Queries use the new names: filterUri -> filterURI, withoutUri ->
withoutURI, callId -> callID, pushUrl -> pushURL.

Signed-off-by: Alex Suraci <[email protected]>
Go derived the deprecated aliases of core fields and arguments from
their schema names, which no longer have the old spelling. Codegen now
takes the old schema names of renamed core names from introspection's
table, so GitCommit keeps its deprecated ParentShas and ShortSha
wrappers.

Regenerated: shortSha -> shortSHA, parentShas -> parentSHAs, filterUri ->
filterURI, withoutUri -> withoutURI, callId -> callID, pushUrl ->
pushURL, asSdkName -> asSDKName on the wire, and FunctionCachePolicy's
values DEFAULT, PER_SESSION and NEVER (constants unchanged).

Signed-off-by: Alex Suraci <[email protected]>
The 7 non-canonical core field and argument names, and
FunctionCachePolicy's values, are renamed on the views with the new
rules, their old spellings kept as hidden aliases: shortSha -> shortSHA,
parentShas -> parentSHAs, filterUri -> filterURI, withoutUri ->
withoutURI, callId -> callID, pushUrl -> pushURL, asSdkName ->
asSDKName, Default/PerSession/Never -> DEFAULT/PER_SESSION/NEVER.

Describe that, the aliases it took (input object fields, struct-tag
fields, renamed enum values), what the SDKs keep, and close the open
question.

Signed-off-by: Alex Suraci <[email protected]>
Arguments and input object fields get their alias copies the same way:
one generic helper builds both, as dupl asked.

Signed-off-by: Alex Suraci <[email protected]>
gqlparser.LoadQuery is deprecated (staticcheck SA1019): the renamed
names test validates queries with LoadQueryWithRules and the default
rules instead.

Signed-off-by: Alex Suraci <[email protected]>
@vito

vito commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Hand-off: splitting #14501 into stacked PRs

The final state is vito/dagger:identifier-casing at 87f041b, rebased on main ce10b54. The decision log is #14501 (comment). The PR description's "Migration Plan" lists the external repo steps.

Rebuild from the final tree, not the history

The 153 commits include three designs that later commits undo:

  • Identifier words in schema JSON (a9b97ce…b74d37e, plus each SDK's "identifier word formatter" commits). Replaced by formatIdentifiers.
  • __formatIdentifiers (e9bbfc8…26f0e10).
  • The full-version gate, +legacy-naming views, the dagql selection-view hook, and entrypoint legacy naming (980f027, 944e8c8, 92aeeb7…e50874a). Replaced by 1281ecc (v1 views) plus aliases.

Cherry-picking would replay all of that. It's easier to build each PR branch from main with git checkout 87f041b -- <paths>, trim, and regenerate. The #### PR headings below give the paths.

Ordering constraints

  1. Aliases before renames. Nothing renames a name the engine serves (module naming, core renames) until hidden aliases ship in the same engine release or earlier. Every v1 prerelease module gets renamed (IdentifierNamingVersion = v1.0.0-0), and the aliases are what keep beta-era bindings working.
  2. SDK runtimes with or after engine module naming, never before. The Python and TypeScript runtimes ask formatIdentifiers what the engine calls a module's names. On an engine that has the API but still uses legacy module naming, they'd predict new names that don't exist yet. The reverse order is fine: the old spellings still resolve through aliases.
  3. SDK client codegen only needs formatIdentifiers. Each generator falls back to its old converter on schemas without it, so those PRs are independent of each other and of engine naming.

Suggested stack

PR 1: engine/naming (no behaviour change)

  • Paths: engine/naming/** (parser, formatter, versioned dictionary DictionaryFor, test vectors, core-schema test); the design doc hack/designs/identifier-casing.md.
  • The design doc describes the end state; either trim it to this PR or land it as "the plan". Commit 98be708 (moving the root design docs into hack/designs) is unrelated and can go separately.

PR 2: additive API, the one to ship in an engine release first

  • API: Query.identifier, Query.formatIdentifiers(names, casing, acronyms, version) (uncached), Query.namingDictionary, and their types (@experimental, v1 views).
  • dagql perf: leaf list rendering (9104da3); without it a ~1000-name call takes ~780 ms instead of ~11 ms.
  • Regenerated output: the schema/docs, plus every SDK client's core bindings (pure additions).
  • Unlocks: after an engine release with this, the external SDK ports can begin.

PR 3: dagql hidden transition aliases (additive, unused until PR 4/5)

  • Aliases for: fields, arguments, types (fragment conditions incl. node(id:) { ... on Old }), input object fields, struct-tag fields, enum values, and per-view enum renames.
  • Plumbing: SchemaWithAliasesForView, rewriting at parse time, the dagger.io/dag.alias span event, core.NameAliases / core.ModuleNameAliases, and the Dang __schemaJSONFile(includeAliases).
  • Paths: dagql/aliases*.go, dagql/{server,objects,interfaces,enums,inputs}.go, engine/telemetryattrs, the core alias helpers, and the Dang call sites in core/sdk/dang.
  • Release: should ship in the same engine release as PR 2.

PR 4: engine module naming, the behaviour change for modules

  • Core: core.Namer (gate: v1 views), module type/function/arg/enum-member renames with legacy-spelling aliases, entrypoint modules on v1 naming. core/gqlformat.go, core/module*.go, core/typedef.go, core/object.go, core/interface.go, core/enum.go, core/schema/modulesource.go.
  • CLI: naming for commands/flags, the legacy function-name fallback in shell/call, loose matching of legacy enum spellings.
  • Go module codegen: module_naming.go mirroring core.Namer, plus deprecated Go aliases for renamed dependency names (c3b7b25).
  • Python: keep dependency enum values (f28c41e).
  • Integration tests: ModuleNamingSuite, TestGoAcronyms, TestModuleEntrypointLegacyNameAliases, the enum literal tests.
  • Watch for: the defaultSchemaBuilderForEngineVersion wrapper (c56bdbb), which exists only because main started calling the old name.

PRs 5a–5h: in-repo SDK codegen, one per SDK (parallel siblings on PR 2; runtimes per ordering constraint 2)

  • Order: Go + TypeScript share cmd/codegen (land together or Go first), then Python, Rust, Elixir, PHP, Java, .NET.
  • Each contains: names from formatIdentifiers (or the names file written by codegen introspect --names-out), the old-converter fallback on schemas without the API, deprecated SDK-side aliases, the regenerated client, and the runtime bump to engineVersion v1.0.0 with runtime-side name formatting.
  • Per-SDK pieces:
    • PHP: PSR-1 class names, #[GraphQLType] and the LegacyClassNames autoloader.
    • Java: @GraphQLType, GraphQLEnum, /names.json in the runtime.
    • .NET: [GraphQLValue], GraphQLEnumConverter<T>.
    • Python: ValueEnum for core enums.
  • Reference: these PRs are what the external dagger/*-sdk ports copy from.
  • Breaking changes per SDK: the Java/.NET type renames and Python's enum .name are hard breaks. Each SDK's PR is the natural place to decide on them with its maintainers.

PR 6: core renames (last)

  • Renames: callID, pushURL, shortSHA, parentSHAs, filterURI, withoutURI, asSDKName, FunctionCachePolicy DEFAULT/PER_SESSION/NEVER, on v1 views with aliases. This is 74b0b0a…87f041b minus the dagql parts that move to PR 3.
  • Codegen: each SDK generator's "old schema names" table (cmd/codegen/introspection/renamed.go and per-SDK equivalents). Without it, deprecated aliases are dropped or invented.
  • Two deliberate exceptions: workspace git log --json keeps shortSha/parentShas keys, and the cloud artifact query keeps filterUri.

External repos

  • Branches: dagger/{go,typescript,python,php,java,dang,elixir}-sdk and dagger/sdk-helpers each have an identifier-casing branch at their default branch head. They're untouched, and push/force-push to them was approved.
  • go-sdk: needs the dependency-name Go aliases from c3b7b25 in its forked codegen. Without them, regenerating engine-dev/docs-dev/release bindings turns DaggerCli into DaggerCLI.
  • sdk-helpers and go-sdk: call legacyJson. It keeps working through aliases, but they should move to legacyJSON.

Open items for you

  • CI: stale checks (go-sdk/typescript-sdk/dang-sdk generate/stale; the in-repo modules' dagger.gen.go weren't regenerated for the core renames) and the remaining triage. Locally, the TestDaggerCMD agent/session tests and TestInitConsoleShowsCommands fail in the sandbox on unrelated commits too.
  • Decisions to confirm:
    • 17: module aliases on every view.
    • 19: enum value aliases are input-only.
    • 20: loose CLI enum matching.
    • 24: core renames on v1 only.
    • The TypeScript enum member style (Tcp).
    • How long deprecated SDK aliases live (proposed: through 1.0).
  • Known gaps:
    • Recorded call IDs with old names don't load.
    • __typename always returns the new name, which breaks old Go Concrete() for renamed implementations.
    • Dang annotations can't use old type names.
    • Enum type names have no aliases.
    • Aliases can show up in "Did you mean" suggestions.
    • Before the first dictionary addition after 1.0, entrypoint modules need a pinned naming version; they currently use the engine's.

vito added a commit that referenced this pull request Oct 14, 2026
Add engine/naming, the single implementation of identifier case conversion
described in hack/designs/identifier-casing.md: parse a name in any casing
into WORD/ACRONYM/TERM words using a versioned dictionary of acronyms and
terms with a case heuristic as fallback, and format them as PASCAL, CAMEL,
SNAKE, SCREAMING_SNAKE, KEBAB or FLAT in UPPERCASE or CAPITALIZED acronym
style.

Nothing uses it yet. The design doc describes the end state of the whole
stack split out of #14501.

Refs #13668

Signed-off-by: Alex Suraci <[email protected]>
@vito

vito commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of the split PRs above.

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