VicroCode
Make Code Create Value
VicroCode is a lightweight online platform for publishing, running, sharing, and monetizing code projects. Launch HTML, Python, SQLite, AI agents, management tools, games, and more without server setup.
Please wait while VicroCode loads. You can also explore the AI programming guide
Loading...

AI MARKET GUIDE

Owning the Reference: A Self-Hostable CSV Conformance Harness

A builder's take on turning a 36-case CSV dialect script into a hosted round-trip test you run against your own exporter, built on Python, HTML, and SQLite.

There's a small moment in every export feature where you stop knowing what's true. You hit "Download CSV", open the file, and the first row looks fine. But did the field with an embedded comma survive? The one with a quote inside a quote?

A newline in a notes column? Em dash, emoji, a stray empty string that your code quietly turned into the text `None`?

You scroll, it looks okay, you ship it. That's not verification. That's a vibe.

I've been staring at a cluster of signals from independent builders lately, and two of them rhyme in a way worth pulling on.

Two signals that point the same direction

The first is the quiet demand for data portability. A cat weight tracker called Purrfit lists, right alongside its UI polish, one-click CSV import and export framed as "data freedom, not locked to the platform". That's a feature users notice. When export is a selling point, export correctness stops being a nice-to-have and becomes part of the contract.

The second is a verification anxiety showing up among people shipping AI-generated code. One developer building a game engine put it bluntly: AI now writes code faster than he can read it, and when he hands review to another AI, he's stuck on an uncomfortable question — if he doesn't trust the first AI, why would he trust the second one's sign-off?

His conclusion is that the future of the job leans toward reviewing behavior and test coverage, not every line, and that we need something "more reliable than the AI said it's fine".

Put those together and you get a concrete need: a cheap, deterministic way to prove a specific behavior, instead of eyeballing output or trusting an assertion. Export is a perfect candidate because it's deceptively simple and genuinely full of edge cases.

The reusable idea, lifted out of the REA post

The seed comes from a post by someone maintaining an independent REA (Reverse Engineer Anything) starter guide. Buried under the setup instructions is the actually durable artifact: a standalone CSV export investigation checklist, and a companion standard-library Python script that, per the post, emits 36 combinations of commas, quotes, newlines, Unicode, and empty strings. The author is careful to say it's an explicit reference CSV dialect, not the measured output of any commercial app, and that the checklist deliberately separates "a call exists in the code" from "that branch actually executed".

That distinction is the whole game. The tempting use of that script is to reverse-engineer somebody else's exporter. The better use, the one that keeps paying off, is to own a deterministic reference and run it against your own exporter. You're not guessing what another product does. You're proving that a field you control survives escaping, instead of assuming it does.

That reframing turns a one-off script into a round-trip conformance test: generate known-adversarial rows, push them through your exporter, read them back, and compare against the reference byte for byte. Any drift is a bug with a name.

What you can actually build with VicroCode

Here's where it gets executable, and I'll stay honest about the boundaries. The REA guide and Purrfit both happen to run on Cloudflare Workers; that's their deployment choice, and it's outside what I'd reach for here. What VicroCode gives you maps cleanly onto the three pieces of a conformance harness without any of that.

First, the generator and the comparator. You can run Python online to port that standard-library approach into a small service that emits the adversarial dialect cases, and because it's plain stdlib `csv`, there are no dependencies to fight. Wrap it as a hosted endpoint so your exporter, or a CI step, can POST a produced file and get back a structured diff: which cases round-tripped, which mangled a quote, which dropped a trailing empty string. The logic is deterministic, which is the point — same input, same verdict, every run.

Second, the results board. A table of green and red cells is worth more than a log dump, especially when you're triaging fast. You can run HTML online to host a lightweight board that renders each of the cases — comma-in-field, quote-in-quote, embedded newline, Unicode, empty string — as a row, with the expected bytes next to what your exporter actually produced. No framework needed; a static page with a bit of browser interaction is enough to make a failure obvious at a glance.

Third, the reference itself. The dialect shouldn't live only in a script where tweaking it means a redeploy. Keep the canonical cases and their expected round-trip output in a database you can open and amend directly. The SQLite editor lets you add a case the day you discover a new edge — say, a CRLF inside a quoted field that broke one specific client — and that new row becomes a permanent regression check. Your reference grows with your scars.

Why this holds up

The column-order, escaping, and encoding checklist from the REA post is really a list of claims you keep making implicitly: columns come out in this order, this character gets escaped that way, the file is UTF-8 all the way through. A harness turns each claim into a test that either passes or doesn't. That's the difference the game-engine developer was circling: not "the tool says it's fine", but an independent reference saying the behavior is fine.

I'd be straight about scope. This proves round-trip fidelity against a dialect you define; it does not certify compatibility with every spreadsheet app's quirks, and the reference is only as good as the cases you put in it. The 36 combinations are a starting dialect, not a universe. Treat any claim that it catches "all" CSV bugs as unverified — it catches the ones you encoded.

But that's also why it's worth owning rather than borrowing. Every time an export breaks in a way you didn't anticipate, you add the case, and the harness gets a little harder to fool. For something a user is relying on to get their data out cleanly — their cat's weight history, their notes, whatever it is — proving the field survived beats hoping it did.