```python
def chain_of_command(root: dict, person: str) -> list:
    """Walks the org chart from root to find the path to the given person."""
    if not isinstance(person, str) or len(person) == 0:
        raise ValueError("person must be a non-empty string")
    
    # Validate root structure
    if not isinstance(root, dict):
        raise ValueError("root must be a dict")
    if not isinstance(root.get("name"), str) or len(root.get("name", "")) == 0:
        raise ValueError("root node name must be a non-empty string")
    
    # BFS to find the person and track the path
    # Queue items: (current_node, path_so_far)
    queue = [(root, [root["name"]])]
    visited_names = {root["name"]}
    
    while queue:
        current_node, path = queue.pop(0)
        current_name = current_node["name"]
        
        if current_name == person:
            return path
        
        reports = current_node.get("reports", [])
        if not isinstance(reports, list):
            raise ValueError("reports must be a list")
            
        for report in reports:
            if not isinstance(report, dict):
                raise ValueError("report must be a dict")
            
            report_name = report.get("name")
            if not isinstance(report_name, str) or len(report_name) == 0:
                raise ValueError("report node name must be a non-empty string")
            
            if report_name in visited_names:
                raise ValueError(f"Person '{report_name}' found more than once")
            
            visited_names.add(report_name)
            queue.append((report, path + [report_name]))
            
    raise ValueError(f"Person '{person}' not found in the chart")


def headcount(root: dict) -> int:
    """Returns the total number of people in the organisation chart."""
    if not isinstance(root, dict):
        raise ValueError("root must be a dict")
    if not isinstance(root.get("name"), str) or len(root.get("name", "")) == 0:
        raise ValueError("root node name must be a non-empty string")
    
    count = 1
    queue = [root]
    
    while queue:
        current_node = queue.pop(0)
        reports = current_node.get("reports", [])
        if not isinstance(reports, list):
            raise ValueError("reports must be a list")
            
        for report in reports:
            if not isinstance(report, dict):
                raise ValueError("report must be a dict")
            if not isinstance(report.get("name"), str) or len(report.get("name", "")) == 0:
                raise ValueError("report node name must be a non-empty string")
            count += 1
            queue.append(report)
            
    return count


def widest_team(root: dict) -> int:
    """Returns the largest count of direct reports any single person has."""
    if not isinstance(root, dict):
        raise ValueError("root must be a dict")
    if not isinstance(root.get("name"), str) or len(root.get("name", "")) == 0:
        raise ValueError("root node name must be a non-empty string")
        
    max_reports = 0
    queue = [root]
    
    while queue:
        current_node = queue.pop(0)
        reports = current_node.get("reports", [])
        if not isinstance(reports, list):
            raise