Workspace/Coding labs
Loading progress

Validate a bounded UI snapshot

Intermediate65 min

Validate a complete snapshot for an intentionally tiny **local catalog**, not the entire A2UI standard catalog. Allowed exact properties are Text {id,component,text}, Column {id,component,children}, and Button {id,component,child,action} with action approve or reject. Require unique nonempty string IDs, root, valid property types, all references present, no cycles, and all declarations reachable from root. Reject unknown properties and excess nodes with ValueError. Return IDs in depth-first postorder. Progressive protocol updates may temporarily contain missing references; this exercise deliberately validates complete checkpoints.

Your task

  1. Complete the starter function using the contract above.
  2. Use the examples and visible tests to check normal inputs, boundaries, and rejected inputs.
  3. Run tests to record your result, then compare with the explained reference solution.

Examples

EXAMPLE 1

Inputroot Column -> x Text

Output['x', 'root']

Postorder places a child before the parent.
EXAMPLE 2

Inputroot references root

OutputValueError

Cycles cannot be recursively rendered.
solution.pyPython 3.12