Repository navigation
Description
Problem
A tabular CSV is a grid to the reader and raw text to the assistant. The preview parses it with parseCsv and renders it in the same SheetGrid a workbook gets, column letters included (ui-packages/web/src/features/reader/csv-reader.tsx:47-51, routed at document-tabs.tsx:66; letters at ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:78-80) — so the reader can point at B3. The assistant gets none of that: a CSV's preview kind is text (ui-packages/web/src/core/files.ts:63), so open falls through to openTextSource's raw, comma-joined lines (ui-packages/web/src/features/assistant/document-access.ts:48-54), and even pointing the sheet tools at one fails — createXlsxRuntime refuses anything but preview kind xlsx with "This file is not a spreadsheet." (ui-packages/web/src/features/assistant/xlsx/runtime.ts:24-27). The spreadsheet skill is announced as XLSX-only, and its SKILL.md names CSV solely as a writable alternative (ui-packages/web/src/features/assistant/create-reader-agent.ts:43-47).
This breaks the contract the sheet layer states for itself: "Column letters and row numbers match what the preview shows, so a question about 'B3' means the same cell to the reader and to the agent" (ui-packages/web/src/formats/xlsx.ts:93-94). For a CSV, B3 means nothing to the assistant: it must count commas to find a column, and a quoted comma (Ada,"hello, world") — handled correctly by the preview's own parseCsv (ui-packages/web/src/formats/csv.ts:22) — can silently misalign every cell after it. Wide CSVs have no columnar access at all, where sheet_read would give "C:C" in one call.
Proposal
- Route a stored CSV that parses as tabular (the preview's own
isTabulartest,ui-packages/web/src/formats/csv.ts:58) to the xlsx runtime as a one-sheet workbook: its rows are already the string gridWorksheetholds, andparseRange,selectCellsandsheetTextserve them unchanged. sheet_infoandsheet_readthen answer for a CSV with the same A1 coordinates the reader's grid shows;readandsearchsee the sheet's text view, not comma-joined lines.- A non-tabular CSV (one column throughout — the preview itself shows prose or a list) keeps today's text path.
- The spreadsheet skill's description and SKILL.md stop implying sheet reading is XLSX-only.
Goal
After this, a question about "B3" of a tabular CSV returns the cell the reader's grid shows, sheet_info/sheet_read work on CSVs exactly as on workbooks, and a quoted comma can no longer misalign a cell the reader asked about.
Verification
pnpm --filter @gamma-reader/web test src/features/assistant
grep -rn 'csv' ui-packages/web/src/features/assistant/document-access.ts
pnpm checkRefs
- ui-packages/web/src/features/assistant/document-access.ts:48-54 — the xlsx-only routing that leaves CSVs to raw text
- ui-packages/web/src/features/assistant/xlsx/runtime.ts:24-27 — "This file is not a spreadsheet." for anything but an .xlsx
- ui-packages/web/src/features/reader/csv-reader.tsx:47-51 and document-tabs.tsx:66 — the reader's grid view of the same file; sheet-grid.tsx:78-80 its column letters
- ui-packages/web/src/formats/xlsx.ts:93-94 — the coordinates contract, false for CSVs today; ui-packages/web/src/formats/csv.ts:22,58 — the parser and tabular test the fix reuses
- ui-packages/web/src/features/assistant/create-reader-agent.ts:43-47 — the spreadsheet skill announced as XLSX-only
- Open CSV in the spreadsheet grid the product already has, not as raw text #41 — the reader-side mirror, closed as done: the product's own stance is that a CSV opens in the grid the product already has; this issue extends that stance to the assistant
- Show spreadsheet numbers as the sheet states them — a percent cell reads 0.153 where Excel says 15.3%, for reader and assistant alike #161, Show spreadsheet cells that hold an error or an unsolved formula — today both render blank to reader and assistant #157 — the format-parity family for sheets, reader and assistant together; CSV is the format where the two sides still diverge
- Let readers find a value in a sheet — the grid renders only the rows on screen, so Ctrl+F finds nothing #69 — the reader cannot Ctrl+F a grid; this is the assistant-side coordinate gap of the same grid
Activity
bencode commentedon Oct 27, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@dbf9cb6d.Evidence audit: every anchor exact —
files.ts:63(csvintextExtensions→ kindtext),csv-reader.tsx:47-51(parseCsv +isTabular→ the same grid),document-tabs.tsx:66routing,sheet-grid.tsx:78-80column letters,xlsx.ts:93-94coordinates contract,csv.ts:22/58RFC 4180 parser + tabular test,create-reader-agent.ts:43-47XLSX-only skill text,xlsx/runtime.ts:25exact refusal,document-access.ts:48-54xlsx-only routing. The contract-vs-reality argument is sound: the sheet layer promises B3 parity and the CSV path breaks it.Duplicate check: clean across open + closed; #41 (closed, done) is the reader-side mirror this extends, #69 a different act on the same grid.
Sensor: lint ✓; verify ✗ (
grep csv document-access.tsfails today — the anchor discriminates).Verdict: valid, keep open. Sharpening:
xlsx.openDocument(document-access.ts:50) still hitscreateXlsxRuntime's own gate —previewKind !== 'xlsx'throws "This file is not a spreadsheet." (runtime.ts:25) — andreadSpreadsheetwould re-parse the blob as a workbook zip. Say explicitly that the CSV path wrapsparseCsvrows into theWorksheetshape and how the runtime gate opens for it, else an access-layer-only change ends in the same refusal.sheet_read 'B3'returns the cell the grid shows, a quoted comma (Ada,"hello, world") lands in one column, and a non-tabular CSV stays on the text path. That is thexlsx.ts:93-94contract made testable.bencode commentedon Oct 29, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Previous review ran against
main@dbf9cb6; this beat re-audited againstmain@d05b6b6(HEAD unchanged since).git diff dbf9cb6..d05b6b6over every cited file — includingcreate-reader-agent.ts, which the plugins feature also leaves untouched here — is empty.files.ts:63(csvintextExtensions→ kindtext),document-access.ts:48-55(xlsx-only routing intoopenTextSource),xlsx/runtime.ts:27("This file is not a spreadsheet." for anything but kindxlsx),create-reader-agent.ts:43-47(spreadsheet skill announced as "Read XLSX workbooks"). Thexlsx.ts:93-94B3-parity contract vs. the CSV text path remains the load-bearing gap.grep csv document-access.tsfinds nothing;src/features/assistantsuite 103/103 green.createXlsxRuntime's kind gate atruntime.ts:27plusreadSpreadsheet's workbook-zip re-parse) must be named in the plan, and the outcome anchor should be a runtime test — tabular CSV loads,sheet_read 'B3'returns the grid's cell, a quoted comma stays one column, non-tabular CSV keeps the text path.bencode commentedon Nov 1, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit at d05b6b6 — valid, stays open (HEAD unchanged since the last review; this pass adds the gate-health check the 10-31 → 11-01 round gave the other issues).
files.ts:63still listscsvamongtextExtensions(kindtext);document-access.ts:48-55still routes onlypreviewKind === 'xlsx'to the sheet runtime, everything else toopenTextSource;xlsx/runtime.ts:27still throws "This file is not a spreadsheet." for any other kind (the second lock the first review named);create-reader-agent.ts:43-47still announces the skill as "Read XLSX workbooks"; thexlsx.ts:93-94B3-parity contract andcsv.ts:58isTabularstand unchanged.csvappears nowhere indocument-access.ts.src/features/assistantsuite 14 files/103 tests green (counts identical to the last review: no contract drift), failure is thegrep 'csv' document-access.ts. Correctly red.-tpattern (no vitest-5 vacuous exit-0) and no--silent(no Let a large workbook open without freezing the reader — today the whole sheet parses on the main thread before the first rows can show, and every row stays in memory though the grid draws a window #275-style crash). Same caveat as its siblings: a presence grep — routing code mentioningcsvfor an unrelated reason would green it. The standing sharpening remains the real anchor and is unaddressed: a runtime test with a tabular CSV blob assertingsheet_read 'B3'returns the grid's cell, a quoted comma (Ada,"hello, world") stays one column, and a non-tabular CSV keeps the text path — that makes thexlsx.ts:93-94contract testable instead of greppable.bencode commentedon Nov 6, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Renewal @ 2026-11-07, HEAD still d05b6b6 — valid, stays open. No commits since the 11-01 re-audit; checks re-run, not assumed.
files.ts:63(csv amongtextExtensions),document-access.ts:48-55(onlypreviewKind === 'xlsx'reaches the sheet runtime),xlsx/runtime.ts:27("This file is not a spreadsheet.");csvstill appears nowhere indocument-access.ts.csvgrep. Correctly red.sheet_read 'B3'returns the grid's cell (quoted comma stays one column; non-tabular keeps the text path) — that makes thexlsx.ts:93-94contract testable instead of greppable.bencode commentedon Nov 10, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Renewal @ 2026-11-11, HEAD still d05b6b6 — valid, stays open. Checks re-run rather than assumed.
files.ts:63(csv amongtextExtensions),document-access.ts:49(onlypreviewKind === 'xlsx'reaches the sheet runtime),xlsx/runtime.ts:27("This file is not a spreadsheet." verbatim);csvstill appears nowhere indocument-access.ts.csvgrep. Correctly red.sheet_read B3returns the grid's cell (quoted comma stays one column; non-tabular keeps the text path) — that makes thexlsx.ts:93-94coordinates contract testable instead of greppable.bencode commentedon Nov 13, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Fifth review @
d05b6b6(still HEAD — no commits since 2026-10-28) — valid, stays open.csvstill sits intextExtensions(files.ts:63); the xlsx-only routing is verbatim atdocument-access.ts:48-54(onlypreviewKind === 'xlsx'reaches the sheet runtime, everything else toopenTextSource);createXlsxRuntimestill refuses with "This file is not a spreadsheet." (xlsx/runtime.ts:24-27, throw at:27); the reader's side confirmed —CsvReaderparses and gates onisTabular(csv-reader.tsx:47-51), routed atdocument-tabs.tsx:66; the coordinates contract still atformats/xlsx.ts:93-94,parseCsvatcsv.ts:22,isTabularat:58; the spreadsheet skill still announced "Read XLSX workbooks…" (create-reader-agent.ts:43-47).csvstill appears nowhere indocument-access.ts.src/features/assistantsuite passes (103 tests) but thecsvgrep gate aborts the block (set -e) on unfixed main, as designed. (This pass double-checked the exit code directly; an earlierverifyreading in this loop's transcript was a shell pipe artifact, not a sensor change.)grep -rn 'csv' document-access.tsgate would pass on an incidental comment. A behavior-bearing anchor: a grep for the tabular routing itself (e.g.isTabularorcsvin the xlsx runtime/open path), or a unit test assertingopenon a tabular CSV yields the sheet runtime — so green means the routing changed, not the word appearing.