Add ui profile package resolution engine - #9
Merged
Conversation
New Cratis.Scene.Engine C# project, sibling to Model - resolution and other runtime/design-time engine logic belongs here rather than in Model's assembly, whose shape is tracked by a strict parity manifest (scene-model-shape.json) that has no room for behavioral types. Mirrors the existing TypeScript model/engine package split.
PackageResolver.Resolve() implements #3: a bare name walks a ui profile's package list from highest to lowest priority (core always the lowest-priority fallback); a package-qualified name (last dot splits package from name) resolves directly against its named package, bypassing priority order and shadow tracking entirely. Every active package that also declares a bare name's resolved value is kept as Shadows rather than discarded, answering the issue's own "why did this resolve to X and not Y" question directly in the result.
resolveComponentName() is the runtime twin of the C# PackageResolver, run in the browser whenever a ui profile is applied - same algorithm, same shadow-tracking result shape.
package-resolution-fixtures.json is asserted independently by both Cratis.Scene.Engine.Specs (C#) and @cratis/scene.engine's own Vitest suite, so the two implementations of the resolution algorithm cannot drift apart - the same pattern scene-model-shape.json already establishes for Model's shape. Caught a real bug before either spec was trusted: the first PackageResolver draft appended "core" to the END of the priority list, which made it the highest-priority match (walked first) instead of the intended lowest-priority fallback.
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
PackageResolver.Resolve()(C#,Cratis.Scene.Engine) andresolveComponentName()(TypeScript,@cratis/scene.engine) - resolve a bare or package-qualified component name against aui profile's package list. A bare name walks the package list from highest to lowest priority (corealways the lowest-priority fallback); a package-qualified name (e.g.Internal.Widgets.TrendChart) resolves directly against its named package, bypassing priority order entirely. (ui profilepackage resolution engine #3)ui profilepackage resolution engine #3)package-resolution-fixtures.json) asserted independently by both the C# and TypeScript specs, so the two implementations of the algorithm cannot drift apart - the same patternscene-model-shape.jsonalready establishes forScene.Model's shape.Cratis.Scene.EngineC# project, sibling toScene.Model, mirroring the existing TypeScriptmodel/enginepackage split - keepsScene.Model's strict shape-parity manifest free of behavioral types.Notes
Wiring this resolver into
SceneElementView/ComponentRegistry's actual rendering path (resolving an entire element tree's component names before it renders) is left to Stage#39 and StudioIssues#160, which this issue explicitly lists as downstream consumers - not attempted here.