Skip to content

core: add ModuleSource.naming for SDK codegen - #14996

Merged
vito merged 27 commits into
naming/client-version-argfrom
naming/module-source-naming
Nov 5, 2026
Merged

vito merged 27 commits into
naming/client-version-argfrom
naming/module-source-naming

Conversation

@vito

@vito vito commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #13668

SDK codegen must know a module's schema names before loading it: the entrypoint that registers its declarations has not been generated yet. This adds engine-owned naming APIs so SDKs can use the same rules as module loading instead of maintaining client-side copies of core.Namer.

The casing cut is v1.0.0-beta.26. Module declaration names follow the module's effective engine version, not the caller's core API view. SDK adoption requires an engine containing these APIs.

The API

extend type Query {
  """Defaults to the caller's version. Normalized as a module's declared version is: capped at the engine's own."""
  naming(version: String): Naming! @experimental(reason: "Identifier casing APIs are likely to change.")
}

type Naming {
  version: String!                     # the normalized version these rules answer for
  identifier(name: String!): Identifier!
  formatIdentifiers(names: [String!]!, casing: Casing!, acronyms: AcronymStyle = UPPERCASE): [String!]!
  dictionary: [NamingTerm!]!
  module(name: String!, originalName: String): ModuleNaming!   # originalName defaults to name
}

extend type ModuleSource {
  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
}

extend type CurrentModule {
  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
}

type ModuleNaming {
  version: String!
  name: String!
  originalName: String!
  typeNames(names: [String!]!): [String!]!
  fieldNames(names: [String!]!): [String!]!
  enumMemberNames(names: [String!]!): [String!]!
  mainObject(candidates: [String!]!): String
}

Naming normalizes the requested version with engine.ModuleAPIViewVersion, including capping a future version at the engine's own. For a loadable module source, passing its reported version, name and originalName to naming(...).module(...) reproduces its ModuleNaming. This does not bypass source loading's minimum-engine check: a dagger.json requiring a newer engine is still rejected before its naming can be queried.

identifier, formatIdentifiers and dictionary use naming.DictionaryFor(version). Module declaration naming uses the corresponding Namer, including legacy strcase before the cut.

module takes an optional originalName because namespacing needs it (Namer.NamespaceObject(name, moduleName, moduleOriginalName)). A module loaded under a dependency alias namespaces its types under the alias, but strips a type's prefix by its original name and finds its main object by it too. For example, SharedThing in shared loaded as alias-one is AliasOneThing, but AliasOneSharedThing if the original name were the alias. Without the argument, originalName defaults to name, which is right for every module that isn't aliased.

ModuleSource.naming and CurrentModule.naming are bound to the module as before.

Compatibility

The experimental root fields Query.identifier, Query.formatIdentifiers and Query.namingDictionary (shipped in beta.20) are removed on every view, without aliases. Their replacements are naming { identifier(name:) }, naming(version:) { formatIdentifiers(names:, casing:, acronyms:) } and naming { dictionary }.

Primitive identifier parsing/formatting uses the version's naming dictionary, including before the cut. ModuleNaming, separately, reproduces legacy strcase declaration names for pre-cut modules.

Module declaration names

Lists preserve input order. The implementation shares Namer with module loading:

  • typeNames namespaces objects, interfaces and enums using the final and original module names.
  • fieldNames names functions, interface functions, object fields and arguments.
  • enumMemberNames names enum members, preserving names already in GraphQL enum-member style.
  • mainObject returns the first normalized or exact schema-name match. Under the new rules, it can also select a unique flattened-name match; absent or ambiguous matches return null. Both module loading and this API use Namer.DeclaredNameIndex.

The source API needs only its name, original name and effective engine version—not asModule or a generated entrypoint. It is available on every v1 view so pre-cut SDK modules can call it for newer modules.

CurrentModule.naming

Module runtimes can query their own declaration names without carrying a ModuleSource (for example, to construct an interface inline fragment).

CurrentModule is implementation-scoped and can be shared by two dependency aliases. Its naming field therefore records the caller's actual module source as an internal argument, keeping both answers and cache identity alias-specific. TestCurrentModuleNamingAliases exercises two aliases in one session.

Breaking fix: pre-cut interface members normalize once

Interfaces previously normalized already-normalized function and argument names a second time. Legacy strcase is not idempotent: e2eTest becomes e2ETest, then e2Etest. Objects normalized once, so a module's own object could fail to implement its interface.

Interfaces now install their typedef names unchanged, matching objects and fieldNames. This changes affected pre-cut interface spellings; an object matching only the former, doubly-normalized spelling no longer implements that interface. Post-cut names are unchanged. TestInterfaceNameNormalization checks both sides of the cut.

Fixed: pre-cut main objects spelled as their schema name

For k8s-tools, legacy typeNames returns K8STools. Normalizing that again produced K8Stools, so main-object lookup rejected the API's own answer and namespacing could duplicate the prefix.

The shared lookup now accepts an exact schema-name declaration as well as existing normalized matches. Legacy namespacing gives it the module's final name. Post-cut behavior is unchanged. TestMainTypeSchemaName loads real modules with these declarations before and at the cut.

This does not change the in-repo Go SDK codegen's separate, legacy main-struct selection.

Scope limit: external name overrides

ModuleSource.naming uses the source's name and original name. An external override supplied only when loading it with asModule is not visible to the source. Generated code that fixes names at generation time cannot automatically adapt to every later workspace rename.

Dependency aliases are covered separately by originalName and the caller-specific source used by CurrentModule.naming. End-to-end behavior of code-generated SDK modules under workspace-only renames remains unverified here; this PR does not claim to solve it.

Validation

Conventional core/integration coverage:

  • TestNamingBeforeEntrypoint: real sources without an SDK or generated entrypoint, queried by pre-/post-cut callers; source/primitive equivalence, default original name, empty lists, main-object results and validation. Future-version manifests are rejected at source loading rather than silently capped.
  • TestModuleSourceNamingMatchesSchema: compares API answers with real registered object/interface/enum/member names, then queries both source and current-module naming inside the module, before and at the cut.
  • TestCurrentModuleNamingAliases: two aliases in one session retain distinct namespaces and original-name handling. CurrentModule.naming now propagates caller/source lookup errors rather than silently using the implementation-scoped receiver's source.
  • TestNamingDangToml: effective version from dang.toml controls naming.
  • TestInterfaceNameNormalization and TestMainTypeSchemaName: real legacy interface and main-object behavior on both sides of the cut.
  • TestIdentifier: primitive parsing/formatting/dictionary/version behavior and API availability. TestModuleIdentity distinguishes omitted from explicitly empty originalName and checks public node(id:) round trips.

At cleanup commit 4ecc216:

  • Focused source-built-engine integration selection: 30 passed, 9.220s package runtime (20-minute outer limit).
  • Focused ./core and ./core/schema naming tests: passed with -vet=off, 10-minute test timeout.
  • go vet -lostcancel=false ./core ./core/schema: passed; the pre-existing lostcancel warnings remain excluded.
  • Two-finder review of the cleanup: nothing to fix.

Removed redundant TestModuleNamingRules, TestModuleSourceNamingResolves, TestCurrentModuleNaming and TestNamingModuleMatchesModuleSource. Retained distinct algorithm, ordering, ambiguity, namespacing, typedef-equivalence, error, persistence, identity-normalization, schema-availability/shape and nullable-version-input coverage. No full-suite or released-SDK smoke claim.

API changes

go -C hack/sdl-diff run . c7dd6e602e731e793522f5c977d168715f8614aa:docs/docs-graphql/schema.graphqls 4ecc2168ed5efba06dbf9ef58b23bf45de83dc61:docs/docs-graphql/schema.graphqls

extend type CurrentModule {
  # Added
  """
  The names the engine gives this module's own declarations: the same as its
  source's ModuleSource.naming, for module runtimes, which have no ModuleSource.

  It answers for the module under its own name (ModuleSource.moduleName), by the
  naming rules of the version the module is named by. A workspace or toolchain
  that loads the module under another name namespaces its types under that name
  instead, which this doesn't reflect.
  """
  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
}

# Added
"""
The names the engine gives a module's own declarations, by the naming rules of the version the module is named by.

Every list-taking field answers in input order.
"""
type ModuleNaming implements Node {
  """
  A unique identifier for this ModuleNaming.
  """
  id: ID!
  """
  The normalized engine version whose naming rules name the module.
  """
  version: String!
  """
  The module's name, which namespaces its types.
  """
  name: String!
  """
  The module's original name, which its main object and namespaced type names
  are spelled after. It differs from name when the module is loaded under
  another name, as a dependency alias.
  """
  originalName: String!
  """
  The schema names of objects, interfaces and enums this module declares, as the
  engine installs them: namespaced under the module's name, in input order.
  
  A name is prefixed with the module's name unless it already starts with the
  module's name on a word boundary. With the engine's identifier naming rules:
  HttpClient in module my-mod is MyModHTTPClient; Postman in module post is
  PostPostman, while PostMan stays PostMan; K8STools in module k8s-tools is
  K8sTools, the module's own name. With the legacy strcase rules, HttpClient in
  module my-mod is MyModHttpClient.
  
  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
  or digits, or over 256 bytes). The legacy rules name anything.
  """
  typeNames(
    """
    The type names as the module's source declares them.
    """
    names: [String!]!
  ): [String!]!
  """
  The schema names of functions, object fields and function arguments this
  module declares, including interface functions and their arguments, in input
  order.
  
  With the engine's identifier naming rules, acronyms are written like words:
  getURL is getUrl, baseURL is baseUrl, HTTPClient is httpClient. With the
  legacy strcase rules, HTTPClient is httpclient and e2eTest is e2ETest.
  
  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
  or digits, or over 256 bytes). The legacy rules name anything.
  """
  fieldNames(
    """
    The function, field and argument names as the module's source declares them.
    """
    names: [String!]!
  ): [String!]!
  """
  The schema names of enum members this module declares, in input order: SCREAMING_SNAKE_CASE.
  
  A name already written in GraphQL's enum member convention (HTTP2, P_256) is
  kept as it is. With the engine's identifier naming rules, Arm64 is ARM64 and
  GitHub is GITHUB; with the legacy strcase rules, Arm64 is ARM_64.
  
  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
  or digits, or over 256 bytes). The legacy rules name anything.
  """
  enumMemberNames(
    """
    The enum member names as the module's source declares them.
    """
    names: [String!]!
  ): [String!]!
  """
  Which of the candidates, the names of objects this module declares, the engine
  takes as the module's main object; null if none.
  
  The engine finds the main object by the module's name, in any casing: the
  first candidate, in input order, whose name normalizes to the same type name
  as the module's, or is spelled as that type name already (K8STools for module
  k8s-tools, by either rules: strcase spells k8s-tools K8STools, though it would
  normalize K8STools again to K8Stools). Failing that, with the engine's
  identifier naming rules only, the only candidate spelled the same once
  lowercased without word boundaries (Sha256Sum for module sha256sum); several
  such candidates are ambiguous, and give null.
  
  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
  or digits, or over 256 bytes). The legacy rules name anything.
  """
  mainObject(
    """
    The object names as the module's source declares them.
    """
    candidates: [String!]!
  ): String
}

extend type ModuleSource {
  # Added
  """
  The names the engine gives this module's own declarations, by the naming rules
  of the version the module is named by: its engine version, capped at the
  engine's own.

  Modules declaring a version before the identifier casing cut get the legacy
  strcase names; later ones get the engine's identifier naming rules.

  For SDK codegen, which must reproduce these names before the module is loaded:
  this reads only the source's name, original name and engine version, so it
  answers before the module's entrypoint is generated.

  It answers for the module under its own name (moduleName). A workspace or
  toolchain that loads the module under another name namespaces its types under
  that name instead, which this doesn't reflect.
  """
  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
}

# Added
"""
The engine's identifier naming rules at an engine version.
"""
type Naming implements Node {
  """
  A unique identifier for this Naming.
  """
  id: ID!
  """
  The normalized engine version these rules answer for.
  """
  version: String!
  """
  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, input with no
  letters or digits, or input over 256 bytes.
  """
  identifier(
    """
    The name to parse.
    """
    name: String!
  ): Identifier!
  """
  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
  ): [String!]!
  """
  The acronyms and terms used to parse and format identifiers.
  """
  dictionary: [NamingTerm!]!
  """
  The names the engine gives the declarations of a module named by these rules.
  """
  module(
    """
    The module's name, which namespaces its types.
    """
    name: String!

    """
    The module's original name, when it's loaded under another (as a dependency
    alias): its main object and namespaced type names are spelled after it.
    Defaults to name.
    """
    originalName: String
  ): ModuleNaming!
}

extend type Query {
  # Added
  """
  The engine's identifier naming rules at an engine version.
  """
  naming(
    """
    The engine version to answer for, e.g. the engine version a module declares.
    Defaults to the caller's. Normalized as a module's is: a version past the
    engine's is capped at the engine's own.
    """
    version: String
  ): Naming! @experimental(reason: "Identifier casing APIs are likely to change.")
  # Removed: identifier(name: String!): Identifier! @experimental(reason: "Identifier casing APIs are likely to change.")
  # Removed: formatIdentifiers(names: [String!]!, casing: Casing!, acronyms: AcronymStyle = UPPERCASE, version: String): [String!]! @experimental(reason: "Identifier casing APIs are likely to change.")
  # Removed: namingDictionary: [NamingTerm!]! @experimental(reason: "Identifier casing APIs are likely to change.")
}
Detailed diff
 extend type CurrentModule {
+  """
+  The names the engine gives this module's own declarations: the same as its
+  source's ModuleSource.naming, for module runtimes, which have no ModuleSource.
+  
+  It answers for the module under its own name (ModuleSource.moduleName), by the
+  naming rules of the version the module is named by. A workspace or toolchain
+  that loads the module under another name namespaces its types under that name
+  instead, which this doesn't reflect.
+  """
+  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
 }

+"""
+The names the engine gives a module's own declarations, by the naming rules of the version the module is named by.
+
+Every list-taking field answers in input order.
+"""
+type ModuleNaming implements Node {
+  """
+  The schema names of enum members this module declares, in input order: SCREAMING_SNAKE_CASE.
+  
+  A name already written in GraphQL's enum member convention (HTTP2, P_256) is
+  kept as it is. With the engine's identifier naming rules, Arm64 is ARM64 and
+  GitHub is GITHUB; with the legacy strcase rules, Arm64 is ARM_64.
+  
+  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
+  or digits, or over 256 bytes). The legacy rules name anything.
+  """
+  enumMemberNames(
+    """
+    The enum member names as the module's source declares them.
+    """
+    names: [String!]!
+  ): [String!]!
+  """
+  The schema names of functions, object fields and function arguments this
+  module declares, including interface functions and their arguments, in input
+  order.
+  
+  With the engine's identifier naming rules, acronyms are written like words:
+  getURL is getUrl, baseURL is baseUrl, HTTPClient is httpClient. With the
+  legacy strcase rules, HTTPClient is httpclient and e2eTest is e2ETest.
+  
+  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
+  or digits, or over 256 bytes). The legacy rules name anything.
+  """
+  fieldNames(
+    """
+    The function, field and argument names as the module's source declares them.
+    """
+    names: [String!]!
+  ): [String!]!
+  """
+  A unique identifier for this ModuleNaming.
+  """
+  id: ID!
+  """
+  Which of the candidates, the names of objects this module declares, the engine
+  takes as the module's main object; null if none.
+  
+  The engine finds the main object by the module's name, in any casing: the
+  first candidate, in input order, whose name normalizes to the same type name
+  as the module's, or is spelled as that type name already (K8STools for module
+  k8s-tools, by either rules: strcase spells k8s-tools K8STools, though it would
+  normalize K8STools again to K8Stools). Failing that, with the engine's
+  identifier naming rules only, the only candidate spelled the same once
+  lowercased without word boundaries (Sha256Sum for module sha256sum); several
+  such candidates are ambiguous, and give null.
+  
+  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
+  or digits, or over 256 bytes). The legacy rules name anything.
+  """
+  mainObject(
+    """
+    The object names as the module's source declares them.
+    """
+    candidates: [String!]!
+  ): String
+  """
+  The module's name, which namespaces its types.
+  """
+  name: String!
+  """
+  The module's original name, which its main object and namespaced type names
+  are spelled after. It differs from name when the module is loaded under
+  another name, as a dependency alias.
+  """
+  originalName: String!
+  """
+  The schema names of objects, interfaces and enums this module declares, as the
+  engine installs them: namespaced under the module's name, in input order.
+  
+  A name is prefixed with the module's name unless it already starts with the
+  module's name on a word boundary. With the engine's identifier naming rules:
+  HttpClient in module my-mod is MyModHTTPClient; Postman in module post is
+  PostPostman, while PostMan stays PostMan; K8STools in module k8s-tools is
+  K8sTools, the module's own name. With the legacy strcase rules, HttpClient in
+  module my-mod is MyModHttpClient.
+  
+  Errors on a name the module's naming rules can't parse (non-ASCII, no letters
+  or digits, or over 256 bytes). The legacy rules name anything.
+  """
+  typeNames(
+    """
+    The type names as the module's source declares them.
+    """
+    names: [String!]!
+  ): [String!]!
+  """
+  The normalized engine version whose naming rules name the module.
+  """
+  version: String!
+}

 extend type ModuleSource {
+  """
+  The names the engine gives this module's own declarations, by the naming rules
+  of the version the module is named by: its engine version, capped at the
+  engine's own.
+  
+  Modules declaring a version before the identifier casing cut get the legacy
+  strcase names; later ones get the engine's identifier naming rules.
+  
+  For SDK codegen, which must reproduce these names before the module is loaded:
+  this reads only the source's name, original name and engine version, so it
+  answers before the module's entrypoint is generated.
+  
+  It answers for the module under its own name (moduleName). A workspace or
+  toolchain that loads the module under another name namespaces its types under
+  that name instead, which this doesn't reflect.
+  """
+  naming: ModuleNaming! @experimental(reason: "Identifier casing APIs are likely to change.")
 }

+"""
+The engine's identifier naming rules at an engine version.
+"""
+type Naming implements Node {
+  """
+  The acronyms and terms used to parse and format identifiers.
+  """
+  dictionary: [NamingTerm!]!
+  """
+  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!]!
+  ): [String!]!
+  """
+  A unique identifier for this Naming.
+  """
+  id: ID!
+  """
+  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, input with no
+  letters or digits, or input over 256 bytes.
+  """
+  identifier(
+    """
+    The name to parse.
+    """
+    name: String!
+  ): Identifier!
+  """
+  The names the engine gives the declarations of a module named by these rules.
+  """
+  module(
+    """
+    The module's name, which namespaces its types.
+    """
+    name: String!
+
+    """
+    The module's original name, when it's loaded under another (as a dependency
+    alias): its main object and namespaced type names are spelled after it.
+    Defaults to name.
+    """
+    originalName: String
+  ): ModuleNaming!
+  """
+  The normalized engine version these rules answer for.
+  """
+  version: String!
+}

 extend type Query {
   """
-  Format many names at once, for codegen. Returns them in input order.
+  The engine's identifier naming rules at an engine version.
   """
-  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!]!
-
+  naming(
     """
-    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.
+    The engine version to answer for, e.g. the engine version a module declares.
+    Defaults to the caller's. Normalized as a module's is: a version past the
+    engine's is capped at the engine's own.
     """
     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, input with no
-  letters or digits, or input over 256 bytes.
-  """
-  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.")
+  ): Naming! @experimental(reason: "Identifier casing APIs are likely to change.")
 }

vito added a commit that referenced this pull request Oct 30, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito added this pull request to stack #14901 October 30, 2026 20:27
vito added a commit to dagger/go-sdk that referenced this pull request Oct 30, 2026
The engine now answers the names it gives a module's own declarations:
ModuleSource.naming (dagger/dagger#14996). The interface bindings take the
schema names of the module's interfaces and their functions from typeNames
and fieldNames, and the dispatcher and Dang entrypoint take the main object
from mainObject, each asked with a direct, cached call when first needed. A
failed answer fails generation. The engine answers by the rules of the
version it names the module by, strcase before the cut, so the SDK no longer
predicts any of them: moduleNamer's strcase and word-prefix mirrors, the
Connector.ModuleNames gate and the --module-version plumbing are gone.

go-sdk.dang passes module-codegen the ID of the final entrypoint module
source in a file (--module-source-id-file), and module-codegen looks it up
with node(id:); the source answers before its entrypoint is generated. The
codegen execs no longer pass experimentalPrivilegedNesting: v1 views nest by
default.

The Connector refuses an engine before v1.0.0-beta.22, the release taken to
carry the API. A test validates every query the identifiers package sends
against #14996's schema (identifiers/testdata/engine.graphqls).

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/typescript-sdk that referenced this pull request Oct 30, 2026
The generated entrypoints call a module through its own interfaces, and
pick which object of an entrypoint module carries the constructor, by names
the engine assigns. They spelled those names in ways the engine doesn't,
which broke such modules on every engine:

- function and argument names were sent as declared, so a call through
  getURL selected a field the engine names getUrl;
- interfaces were namespaced as the scanner's PascalCase of the module's
  name followed by the interface's, which keeps an acronym run the engine
  may not and repeats a prefix it drops (PondHttpClient in module pond
  became PondPondHttpClient);
- the main object was matched pascalized against the scanner's name, so a
  class named like this SDK's templates name it (K8sTools for k8s-tools)
  got no constructor.

The generators now ask the engine instead of predicting:
ModuleSource.naming (dagger/dagger#14996) answers by the rules of the
version the engine names the module by, strcase before the
identifier-casing cut and its naming rules from it, so no rule is mirrored
here. The SDK writes the ID of the module source the engine loads to
/module-source.id and runs the generators as nested clients; they read the
names their typedef declares in one node(id:) query, ask directly for any
name they look up that wasn't in it, and fail generation on a failed
answer. When the engine takes no object for the main one, the object that
pascalizes like the scanner's module name keeps the constructor, as
before.

Asking from codegen rather than from dang keeps the typedef parsed in one
place: dang would need JSON.decode into Map, which no dang release has, and
a names file matching what the templates look up.

Generating a module therefore needs v1.0.0-beta.22, the release serving
the API. The output only changes where the old names were wrong; the
existing goldens are unchanged.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/go-sdk that referenced this pull request Oct 31, 2026
engine-e2e's default engine and engine-dev move from v1.0.0-beta.18 to
dagger/dagger naming/module-source-naming 017633c (dagger/dagger#14996),
the first engine that runs the SDK at its floor.

Two things it surfaced:

- The entrypoint contract checked the generated entrypoint against the
  bindings' schema, the targeted release's. The entrypoint is served at
  its own source's view, which can spell an enum's members differently
  (FunctionCachePolicy.Never before the cut, NEVER after). It's now checked
  against the entrypoint source's schema.
- dang-sdk at the nested lock's 207f22c doesn't load on this engine
  (cannot use JSON! as Dagger.JSON!); its main, 14ba9d3, does.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 2, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 2, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from 9e25570 to c8f0ab8 Compare November 2, 2026 15:58
vito added a commit that referenced this pull request Nov 2, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/go-sdk that referenced this pull request Nov 2, 2026
dagger/dagger#14996 replaced Query.formatIdentifiers(version:) with
Query.naming(version:), whose Naming formats the names.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 4, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 4, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from f921c4d to b38b965 Compare November 4, 2026 16:30
vito added a commit that referenced this pull request Nov 4, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/go-sdk that referenced this pull request Nov 4, 2026
The engine now answers the names it gives a module's own declarations:
ModuleSource.naming (dagger/dagger#14996). The interface bindings take the
schema names of the module's interfaces and their functions from typeNames
and fieldNames, and the dispatcher and Dang entrypoint take the main object
from mainObject, each asked with a direct, cached call when first needed. A
failed answer fails generation. The engine answers by the rules of the
version it names the module by, strcase before the cut, so the SDK no longer
predicts any of them: moduleNamer's strcase and word-prefix mirrors, the
Connector.ModuleNames gate and the --module-version plumbing are gone.

go-sdk.dang passes module-codegen the ID of the final entrypoint module
source in a file (--module-source-id-file), and module-codegen looks it up
with node(id:); the source answers before its entrypoint is generated. The
codegen execs no longer pass experimentalPrivilegedNesting: v1 views nest by
default.

The Connector refuses an engine before v1.0.0-beta.22, the release taken to
carry the API. A test validates every query the identifiers package sends
against #14996's schema (identifiers/testdata/engine.graphqls).

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/go-sdk that referenced this pull request Nov 4, 2026
engine-e2e's default engine and engine-dev move from v1.0.0-beta.18 to
dagger/dagger naming/module-source-naming 017633c (dagger/dagger#14996),
the first engine that runs the SDK at its floor.

Two things it surfaced:

- The entrypoint contract checked the generated entrypoint against the
  bindings' schema, the targeted release's. The entrypoint is served at
  its own source's view, which can spell an enum's members differently
  (FunctionCachePolicy.Never before the cut, NEVER after). It's now checked
  against the entrypoint source's schema.
- dang-sdk at the nested lock's 207f22c doesn't load on this engine
  (cannot use JSON! as Dagger.JSON!); its main, 14ba9d3, does.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit to dagger/go-sdk that referenced this pull request Nov 4, 2026
dagger/dagger#14996 replaced Query.formatIdentifiers(version:) with
Query.naming(version:), whose Naming formats the names.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 4, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from b38b965 to 8a88bee Compare November 4, 2026 18:59
vito added a commit that referenced this pull request Nov 4, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 4, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 4, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from 8a88bee to 6d5f9c8 Compare November 4, 2026 19:06
vito added 10 commits November 5, 2026 11:28
Describe mainObject's acceptance of the module's schema name, scope the
Fixed changelog entry to the SDKs it fixes (the in-repo Go codegen still
picks its main struct by the old comparison), note in the Breaking entry
that legacy objects spelled the doubly normalized way no longer
implement such interfaces, and name both exceptions where the design and
IdentifierNamingVersion promise legacy names byte for byte.

Signed-off-by: Alex Suraci <[email protected]>
Carry mainObject's note on main objects spelled as the module's schema
name into the API reference and the in-repo SDK clients.

Signed-off-by: Alex Suraci <[email protected]>
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
Replace Query.identifier, Query.formatIdentifiers and Query.namingDictionary
with Query.naming(version): Naming!, which answers for one engine version,
normalized as a module's declared version is (capped at the engine's own).
Naming has identifier, formatIdentifiers, dictionary and module(name,
originalName), which returns the ModuleNaming of a module that version names.

ModuleNaming now reports the version, name and original name it answers for,
so naming(version: m.version).module(name: m.name, originalName:
m.originalName) answers exactly as m does. The original name is needed: a
module loaded under an alias namespaces its types under the alias but strips
the prefix, and finds its main object, by its original name.

formatIdentifiers keeps its dictionary selection: dictionaries are
base-version granular and never newer than the engine, so normalizing the
version doesn't change which one a version gets.

Signed-off-by: Alex Suraci <[email protected]>
Regenerate the API reference schema and pages, and the in-repo SDK clients,
for Query.naming and Naming, and ModuleNaming's version, name and
originalName.

Signed-off-by: Alex Suraci <[email protected]>
Move the identifier tests to Query.naming, and check that Query.naming's
module answers like ModuleSource.naming for modules before and at the cut,
one versioned by its dang.toml, and CurrentModule.naming in a dependency
loaded under two aliases.

Signed-off-by: Alex Suraci <[email protected]>
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
Query.identifier, Query.formatIdentifiers and Query.namingDictionary shipped,
as experimental, in v1.0.0-beta.20, so their removal in favor of Query.naming
gets a Breaking fragment.

Signed-off-by: Alex Suraci <[email protected]>
Describe legacy naming exceptions against the new casing cut, since
beta.25 shipped without the stack.

Signed-off-by: Alex Suraci <[email protected]>
Replace synthetic ModuleSource and CurrentModule resolver tests with real
pre-entrypoint sources and runtime integrations. Preserve algorithm,
ordering, error, persistence and schema-shape coverage. Exercise explicit
empty original names and ID round trips, primitive version normalization,
and the distinction between future naming versions and unsupported module
source versions.

Require CurrentModule.naming to resolve the caller's source instead of
silently falling back to an implementation-scoped source on lookup errors;
that fallback can select another dependency alias. Keep the recorded source
argument for replay. Strengthen both alias assertions and the main-type
schema-name expectations.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from 4ecc216 to 4132c63 Compare November 5, 2026 16:28
vito added a commit that referenced this pull request Nov 5, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from 4132c63 to 59606c4 Compare November 5, 2026 17:38
vito added a commit that referenced this pull request Nov 5, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Fill in the PR number of the ModuleSource.naming and load<X>FromID
fragments.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the naming/module-source-naming branch from 59606c4 to 8d9c79a Compare November 5, 2026 20:09
vito added a commit that referenced this pull request Nov 5, 2026
Follow the identifier casing cut to v1.0.0-beta.25 in the #14996 changelog
fragments: the legacy naming fixes apply to modules before it.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Nov 5, 2026
Describe Query.naming and ModuleNaming's version, name and originalName in
the identifier casing design, and update the changelog fragments of #14891
and #14996 for the consolidated API.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito marked this pull request as ready for review November 5, 2026 20:09
@vito
vito requested review from a team as code owners November 5, 2026 20:09
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