ShapeNode
A leaf of the scene graph: a CGA shape carrying the concrete style it renders with, plus optional tags.
Every leaf class subclasses the shape it decorates — a LineNode is a Line — so a leaf reads and operates as its shape: properties are inherited, and every operation typed against the shape accepts the leaf as-is. The shape-preserving operations (*, the coerce pair, canonical) return through the leaf's copy override, so they come back as the leaf class with style and tags riding along; every other operation returns plain shapes — the decoration drops by contract. style and tags are mutable: restyling or retagging a leaf is an assignment, not a rebuild. Identity is exact-class and style-inclusive: a leaf never equals the plain shape with the same geometry, and two leaves compare by rounded geometry, style, and tags.
Every leaf is either a PrimitiveNode — decorating a CGA element — or a CompositeNode — decorating a shape built from primitives. ShapeNode itself is not sealed, so a when over it is never exhaustive; the two families are, so exhaustive dispatch splits on them and nests a when over each.