CompositionValidator
Checks a surface's component tree against the composition constraints its catalog declares.
This is a separate pass from the property checker because JSON Schema cannot express it. A surface is a flat adjacency list of id references, so the schema for a Menu can say that its children are component ids but not that each of those ids names a MenuItem — the evolution guide gives that as the reason the two keywords exist at all. The constraint is only decidable once the tree is assembled, which is here.
The two keywords are checked independently and both must hold: a catalog may state the rule from the container's side, from the child's side, or from both, and the examples in the specification do each of the three.
The reserved Surface.COMPONENT container is the parent of the component at Surface.ROOT_ID. That is what makes "allowedParents": ["Surface"] mean "only as the top level of a surface", which is the specification's first worked example.
Note that a component may have more than one parent — the adjacency list is a graph — so a component can be reported under one parent and allowed under another. Both are true at once.
Functions
Every forbidden pairing in surface.