You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: two TypeScript canonicalize copies that disagree on dotted names #624
engineIssues with the rust-based simulation enginefrontendInvolved the React-based Typescript frontendhygieneToil, but its useful to get get too behind on itjavascriptPull requests that update Javascript code
The TypeScript code has two implementations of identifier canonicalization, and only one matches the Rust engine's canonicalize in src/simlin-engine/src/common.rs. @simlin/core's canonicalize, used throughout the diagram editor, has no handling for dots or quoted parts. @simlin/engine carries its own complete copy, canonicalizeIdent, which is tested against the Rust output.
There should be one implementation, and it should match Rust.
Example
input
Rust and canonicalizeIdent
@simlin/corecanonicalize
model.variable
model·variable
model.variable
"a.b"
a․b (U+2024, the literal-period marker)
a.b
Why it matters
The two copies will drift, and the inputs that expose a difference (dotted or quoted names) are rare enough that drift would go unnoticed.
The diagram editor canonicalizes with the incomplete version, so a dotted or quoted name it computes may not match the engine's key for the same variable.
No failure has been observed; the difference is known from reading the code.
Fix
Move canonicalizeIdent (and its test corpus) into @simlin/core as the single canonicalize, and have @simlin/engine import it.
Before switching, audit the @simlin/core callers in src/diagram for code that relies on a dot surviving canonicalization (for example module-wiring.ts, which accepts a literal . as a module separator on read).
Pointers
src/core/canonicalize.ts
src/engine/src/internal/canonicalize.ts and src/engine/tests/canonicalize.test.ts
src/simlin-engine/src/common.rs: canonicalize, the reference behavior
changed the title [-]ts: two divergent canonicalize implementations (@simlin/core incomplete vs @simlin/engine Rust-faithful)[/-][+]core: two TypeScript canonicalize copies that disagree on dotted names[/+]on Oct 12, 2026
engineIssues with the rust-based simulation enginefrontendInvolved the React-based Typescript frontendhygieneToil, but its useful to get get too behind on itjavascriptPull requests that update Javascript code
Activity
[-]ts: two divergent canonicalize implementations (@simlin/core incomplete vs @simlin/engine Rust-faithful)[/-][+]core: two TypeScript canonicalize copies that disagree on dotted names[/+]