Jim and I looked through this and we believe there is a problem with the way in which the model is being built. When the module component (mc) is registered, the builder visits the model recursively descending into all child elements. However, when it recurses, it does not update the intended parent context and hence components in nested elements get registered at the top level rather than under their parent.
There is a quick fix we can do for this if we are prepared to assume that we only have a single level of composition. In that case, we can register the module component first with no implementation, then register and build it's implementation (the module element). However, although this is a quick fix in the builder, we will need to make more extensive changes to the loader APIs so that they return Module elements rather than ModuleComponent elements. I think this is worth doing as it will make subsystem assembly easier. In the longer term, the builder needs to understand recursion properly and push a new parent context onto a stack when it recurses into an aggregation. We will need this to support russian-doll but perhaps can hold off for now. We're going to noodle on this overnight and plan to start doing the first fix tomorrow unless someone objects or has a better idea. -- Jeremy
