Resolve an actionable semantic target
Implement resolve_target(tree, role, name) for an abstract UI tree. Each node has id, role, name, optional hidden/disabled booleans, and optional children. In this teaching model, hidden or disabled state on any ancestor excludes the entire subtree. Find the unique eligible exact role/name match, return its id, return None for no match, and raise ValueError for multiple matches. Trees are finite and acyclic. This inheritance model is intentionally simplified and does not claim full DOM or ARIA semantics.
Your task
- Complete the starter function using the contract above.
- Use the examples and visible tests to check normal inputs, boundaries, and rejected inputs.
- Run tests to record your result, then compare with the explained reference solution.
Examples
InputA visible region with one enabled Save button
OutputThe button id
InputA hidden region containing a visible Save button
OutputNone
Implement the function, then run the tests.
Ctrl / ⌘ + Enter to test · Shift + Tab leaves editor