| name | level-assignment |
| description | Assign correct frame levels in YAML when nesting > 0. Use when creating or modifying a frame YAML that contains containers (items with children). Ensures siblings share the same visual class. |
| argument-hint | Path to the frame YAML file, or describe the nesting structure |
Level assignment
When to use
- Creating a new frame YAML with containers (any item that has
children:).
- Modifying an existing frame YAML where nesting depth changes (adding/removing children).
- Reviewing a diagram where siblings have inconsistent levels.
- Any time
level: values need to be set or corrected.
The rule
Level assignment is an authoring-time rule. It follows from the
deepest nesting among siblings, not from each item's own children.
By default, the engine requires explicit level: fields in YAML - it
does not guess levels from structure. This procedure tells you how to
choose the right value. Diagrams may opt into a typed meta.frame_roles
profile; those profiles synthesize explicit levels during compile before
style resolution and must be generic, not fixture-keyed.
Algorithm
Let D be the maximum structural child-nesting depth across a sibling
group.
-
D = 0 → child / leaf (level: 1). Items without children:
and without level: are leaves by default.
-
D = 1 → parent / panel (). When any item at a given
depth has structural children, promote
to - including those without children. A childless panel
uses Parent chrome; that's fine.