refactor(csv): scan for csv in-tree, dropping vincentlaucsb-csv-parser - #664
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07f6ef134d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
andiwand
force-pushed
the
feat/html-no-cache-path
branch
from
August 8, 2026 18:03
d51778f to
c485e8f
Compare
andiwand
force-pushed
the
refactor/csv-in-tree
branch
2 times, most recently
from
August 8, 2026 18:09
cd490a2 to
0e40b6c
Compare
andiwand
force-pushed
the
feat/html-no-cache-path
branch
from
August 8, 2026 18:26
c485e8f to
f0edaed
Compare
The dependency existed for one function. `csv::check_csv_file` answers a single question — does this text parse as a csv with a consistent field count above one — and `CsvFile` is a plain `abstract::TextFile` with `is_decodable()` false, so a `.csv` renders through the text service either way. Nothing else in the library ever called into the parser. It also spawned a thread to do it. `CSVReader::begin()` and `initial_read()` each construct a `std::thread` and immediately join it, which buys nothing and cannot be turned off: there is no compile-time switch and no non-threaded entry point. So every time `open_strategy` probed an otherwise unrecognised text file, on every platform, it spawned and joined a thread for a column count. The format asked for was the default `CSVFormat` — comma delimiter, no delimiter guessing, `"` quotes, no trim characters — which is plain RFC 4180 and about forty lines. `read_record` is exposed alongside `check_csv_file` because the test helper needs real field values out of `index.csv`, and one scanner shared beats a second one copied into the tests. Reaching EOF inside a quoted field throws rather than emitting the partial field as a record. The probe is a classifier, so accepting an unterminated quote widens it: `a,b\n1,"2,3` otherwise reads as two consistent two-field records, and any prose with an odd number of quotes and an even comma count would have been named a csv. Behaviour is unchanged where it is pinned: the corpus the suite enumerates from `index.csv` is identical, and `csv_file_test` keeps its existing assertions and gains coverage for quoting, crlf, short and long rows, and the unterminated quote. `csv_test.cpp` is deleted — it tested the parser, not us. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BjFJ66sma1ye9ZnhM3tNeH
andiwand
force-pushed
the
refactor/csv-in-tree
branch
from
August 8, 2026 18:41
0e40b6c to
c9a9b42
Compare
andiwand
enabled auto-merge (squash)
August 8, 2026 18:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Split out of #661 — no wasm in here. Stacked on #663.
The
vincentlaucsb-csv-parserdependency existed for one function.csv::check_csv_fileanswers a single question — does this text parse as a csvwith a consistent field count above one — and
CsvFileis a plainabstract::TextFilewithis_decodable()false, so a.csvrenders throughthe text service either way. Nothing else in the library ever called into the
parser.
It also spawned a thread to do it.
CSVReader::begin()andinitial_read()each construct a
std::threadand immediately join it, which buys nothing andcannot be turned off — no compile-time switch, no non-threaded entry point. So
every time
open_strategyprobed an otherwise unrecognised text file, on everyplatform, it spawned and joined a thread for a column count.
The format asked for was the default
CSVFormat— comma delimiter, no delimiterguessing,
"quotes, no trim characters — which is plain RFC 4180 and aboutforty lines.
read_recordis exposed alongsidecheck_csv_filebecause the testhelper needs real field values out of
index.csv, and one scanner shared beats asecond one copied into the tests.
Reaching EOF inside a quoted field throws rather than emitting the partial field
as a record. The probe is a classifier, so accepting an unterminated quote widens
it:
a,b\n1,"2,3otherwise reads as two consistent two-field records, and anyprose with an odd number of quotes and an even comma count would have been named
a csv.
Behaviour is unchanged where it is pinned: the corpus the suite enumerates from
index.csvis identical, andcsv_file_testkeeps its existing assertions andgains coverage for quoting, crlf, short and long rows, and the unterminated
quote.
csv_test.cppis deleted — it tested the parser, not us.Full suite green.