Write a method or function to parse a structured input like a CSV file and transform it into a validated internal data structure.
Implement parse_csv(csv_text, required_fields). The first row is the header. Return {\"records\": [...], \"errors\": [...]}, preserving valid rows as dictionaries and reporting schema, parsing, row-width, and required-field errors without stopping at the first invalid row.
Input values should be trimmed, quoted commas must be supported, and completely blank rows may be ignored.
def parse_csv(csv_text, required_fields):