# Split only at top-level commas

> ML Prep screening item.

- Stable ID: `prog-cf-split-top-level`
- Collection: screening
- Area: Programming
- Topic: Control Flow
- Origin: original
- Difficulty: hard
- Expected time: 14 minutes
- Skills: conditionals, loops, strings
- Item JSON: https://mlprep.iwase.dev/item/prog-cf-split-top-level.json

## Problem

Implement `split_top_level(text)`. Split at commas whose parenthesis
depth is zero, trim surrounding whitespace in each field, preserve empty
fields, and raise `ValueError` for unbalanced parentheses. Parentheses may
be nested; quotes and escapes are outside the input contract.


## Answer policy

The human page contains a collapsed answer. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `prog-cf-split-top-level`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
