AI Anonymous · from JAB Systems / October 27, 2026

AI wrote a CSV export. Try a comma.

One happy-path test is a start. Give AI-assisted code an explicit promise, then try the awkward inputs.

AI-assisted coding / Hypothesis · Tested local examples · Human review

In this field note · 7 sections
  1. A clean example can hide a broken export.
  2. Write the promise before the prompt.
  3. Inspect and run the local exercise.
  4. One comma became two fields.
  5. Test the return trip, then keep the failure.
  6. Take the property to your actual workflow.
  7. Take the CSV review kit.
Ivory editorial poster reading “AI wrote a CSV export. Try a comma.” An amber comma sits between two paper tables: the left splits Hello and team into separate cells, while the right keeps “Hello, team” together. Below: One happy-path test is a start. AI Anonymous · from JAB Systems, jabsystems.io/ai-anonymous. Original AI-generated conceptual artwork.
Original AI-generated conceptual artwork. The paper tables illustrate a split-field error, not an application screenshot.
01 / Field guide

A clean example can hide a broken export.

An AI assistant drafts a CSV exporter. A row such as ["Ada", "hello"] looks fine. Now put Hello, team in one field: a comma-join implementation can turn it into two columns. The idea is plausible; the contract needs a test.

This guide uses Hypothesis, an open-source Python testing library, to explore that contract. You describe allowed inputs and an invariant; the library generates examples. Here the invariant is simple: exporting one row and reading it back with an independent CSV reader should preserve every string and the number of fields.

Our broken exporter and replacement are authored teaching examples. They were not collected from a model. Apply this review pattern to AI-assisted code without claiming that all AI tools make this mistake.

02 / Field guide

Write the promise before the prompt.

For this exercise, a row is a nonempty list of strings. The output uses Python’s default CSV dialect with CRLF record endings; the same standard-library reader must recover exactly [row]. Commas, double quotes, line breaks, empty strings and Unicode are allowed within fields. An empty list of fields, numbers and None are outside this exercise.

Python’s CSV documentation describes quoting and warns that writing None as an empty string is not reversible. Decide type handling explicitly before adapting this to a real export. A matching custom split(',') reader would share the exporter’s assumption; use a real parser.

The optional AI review prompt asks for an invariant, edge cases and a reviewable patch. It is proposed and untested. Keep the contract and observed test results as your evidence.

03 / Field guide

Inspect and run the local exercise.

Use an existing Python 3.11+ installation. We ran Windows Python 3.13.15 with Hypothesis 6.170.12, the current release checked October 27, 2026. Choose another empty folder if the dated folder already exists.

New-Item -ItemType Directory -Path .\csv-practice-2026-10-27 -ErrorAction Stop
Set-Location .\csv-practice-2026-10-27
Invoke-WebRequest -Uri "https://jabsystems.io/ai-anonymous/Social/try-a-comma-practice.zip" -OutFile .\practice.zip
Expand-Archive -LiteralPath .\practice.zip -DestinationPath .\practice
Get-Content .\practice\csv-roundtrip.py
Get-Content .\practice\csv-practice-readme.txt

Read the script first. It searches an in-memory toy exporter, tests a replacement and prints JSON. These next commands install the pinned direct dependency into a new virtual environment. Installation requires network access; a virtual environment isolates dependencies, not downloaded code. No API key, model, real dataset or spreadsheet application is needed.

python --version
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install hypothesis==6.170.12
.\.venv\Scripts\python.exe .\practice\csv-roundtrip.py | Set-Content -Encoding utf8 .\my-results.json
Get-Content .\my-results.json

The dependency pin is not a complete transitive environment lock. The README explains the scope. Compare your output with the recorded local report.

04 / Field guide

One comma became two fields.

On October 27, 2026, our deliberately narrow search used nonempty strings from ab,. Hypothesis found and simplified a failing row to [","]. The authored comma-join exporter produced a comma followed by CRLF. The standard reader decoded that into [["", ""]]: two empty fields instead of one comma value.

The csv.writer replacement round-tripped that same row. It also passed seven fixed cases: a comma-containing note, an embedded double quote, a newline, two empty fields, a single empty field, Unicode, and embedded CR/CRLF. The naive example happened to pass some fixed cases; failure is input-dependent.

Then 200 generated examples completed successfully for the replacement. That number comes from an actual counter in this run, not merely the configured max_examples. The broader strategy generated one to five fields, with strings up to forty characters. These are synthetic tests, not model responses, user files or a measurement of AI error frequency.

05 / Field guide

Test the return trip, then keep the failure.

buffer = io.StringIO(newline="")
csv.writer(buffer, lineterminator="\r\n").writerow(row)
decoded = list(csv.reader(io.StringIO(buffer.getvalue(), newline="")))
assert decoded == [row]

The complete downloadable script imports csv and io, defines both exporters and wraps the assertion in a generated test. newline="" lets the CSV module handle record and embedded newline behavior. Its quoting rule preserves CSV structure; it does not decide the business meaning of a value.

Hypothesis strategies define the input space. Its documented source for find shows the search operation used here. A search that does not find a failure is not proof that none exists.

Our derandomize=True setting makes runs repeatable while Python, Hypothesis and the test remain unchanged; database=None disables saved-example storage. See the settings reference. Preserve useful counterexamples as explicit regression cases even if future generated sequences change. Keep the original broken behavior visible so the regression test has a reason to exist.

06 / Field guide

Take the property to your actual workflow.

For a hobby script, start with fictional rows and save a small regression test. At work, review the proposed change with the person who owns the export contract. Check headers, column order, types, missing values, encoding and the actual approved consumer separately. A Python reader round trip does not establish Excel or Google Sheets behavior.

Quoting is not spreadsheet formula protection. This exercise does not check or neutralize formula-like cell values. Treat that as a separate consumer-specific review before opening untrusted content in a spreadsheet. Use the review checklist to keep the remaining decisions visible.

Tested: an authored comma counterexample, seven fixed cases, 200 generated successful examples, extracted-kit reruns and the download workflow on Windows. Not tested: AI code generation or review quality, performance, all inputs, large files, file encodings, real exports, spreadsheet integrations, formula safety or other operating systems. Finite passing tests support this bounded contract; they do not prove production correctness.

07 / Field guide

Take the CSV review kit.

Complete exercise · Recorded results · Proposed review prompt · Practice README · Review checklist · Practice ZIP

Primary sources reviewed October 27, 2026. Original AI-generated portrait visually reviewed.

Explore more AI Anonymous field notes →

Share this post.

Found this useful? Pass it along. Download the artwork, add your own take, and tag @jabsystems.io so I can see your post.