Skip to main content
← Back to list
01Issue
BugOpenSwamp Club
AssigneesNone

ModelType.normalize replaces all dots with slashes, corrupting dotted type names

Opened by swampadmin · 11/25/2025

Description

In src/domain/models/model_type.ts (line 76), normalize() replaces ALL dots with slashes via .replace(/\./g, "/"). While this correctly handles Azure-style types like Microsoft.Resources, it corrupts user namespace types that legitimately contain dots, such as @docker/host.v2@docker/host/v2 (a different type entirely).

Steps to Reproduce

  1. Create or reference a model type with dots in the name: @mycompany/api.client
  2. The normalize function converts it to @mycompany/api/client
  3. This resolves to a different type directory and fails to find the definition

Expected Behavior

Dots within user namespace types (after @) should be preserved, or there should be an escaping mechanism for literal dots.

Actual Behavior

All dots are unconditionally replaced with slashes, making it impossible to have type names containing dots in user namespaces.

Summary

This affects model type normalization. The fix would involve being more selective about dot replacement — perhaps only replacing dots that are not within @-prefixed namespaces, or documenting that dots are not allowed in type names and validating against them at creation time.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

11/25/2025, 5:48:32 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.