<s><|im_start|>user
根据所附 decisions.md 的最新批准要求，给出 before/exporter.py 的完整替换内容。保留 export_rows(rows) 接口，只用 Python 标准库，只修改这一个文件。输入已有效。输出应可由 csv.DictReader 正确读回，覆盖空列表、数量和顺序、名称中的逗号/引号/中文/换行。最终只输出一个 Python 代码块，不要声称已经运行测试。

<file name="decisions.md">
# Fictional decision history / 虚构决定记录

These records were written for this teaching example. Dates are fictional project events, not a product release history.
以下记录为教学而编写，日期是虚构项目内的事件，不是实际产品发布记录。

## 2026-09-01 — Original decision / 旧决定
Export the list as JSON, preserving `name`, integer `quantity` and order.
清单导出为 JSON，保留 `name`、整数 `quantity` 以及原有顺序。

## 2026-09-04 — Approved change, not implemented / 已决定，未落实
Replace the JSON output with CSV so the list can be read as rows and columns.
使用 CSV 替代 JSON，让清单可以按行列读取。

Requirements / 要求：
- Header / 表头：`name,quantity`.
- Preserve names, quantities and row order / 保留名称、数量与顺序。
- Preserve commas, quotes, Chinese text and line breaks inside names / 名称内的逗号、引号、中文、换行均须保留。
- An empty input still produces the header / 空输入仍有表头。
- Input is already a list of valid records with string names and nonnegative integer quantities. Input validation, spreadsheet-specific behavior and large-file performance are outside this exercise / 输入已是有效记录列表，名称为字符串，数量为非负整数。本题不包含输入校验、特定表格软件的行为与大文件性能。

This replaces the output-format decision only. It is not a completion record.
这只替代原来的输出格式决定，不是实现完成记录。

</file>

<file name="before/exporter.py">
"""Fictional unfinished exporter: the approved CSV change is not implemented."""
import json


def export_rows(rows):
    return json.dumps(rows, ensure_ascii=False)


if __name__ == "__main__":
    print(export_rows([{"name": "笔记本, A5", "quantity": 2}, {"name": '卡片 "蓝色"', "quantity": 1}]))

</file><|im_end|>
<|im_start|>assistant
<think>
