Skip to content

Add bounded catalog CSV proposal parser (supersedes #1013) - #1213

Merged
sidneyswift merged 1 commit into
mainfrom
codex/context-catalog-csv
Nov 2, 2026
Merged

sidneyswift merged 1 commit into
mainfrom
codex/context-catalog-csv

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds a pure decoded-text CSV parser that returns proposed catalog rows with source row/line/column pointers, raw cells, identifier states, fingerprints, malformed-row records and duplicate signals. It does not establish identity or rights, accept assertions, persist data, or expose an HTTP/MCP operation.

Supersedes the bounded 16-file parser source from #1013 (c7b91add960bfcdd97c28a74d81b6989b0a09e13) on current main c4ca79f570a262716d07aeb7ccab6adce1d60b92, without bringing over its parent history. The original branch and PR are preserved. This is a source-only slice toward Context #2140, not completion of the import workflow.

The successor caps decoded input at 1,048,576 UTF-16 code units, keeps pending blank lines in constant-size bookkeeping, validates tighter tokenizer limits, and preserves invalid identifier whitespace and non-ASCII characters instead of repairing them. Limits and the malformed unterminated-tail exception are documented in the module README.

Validation: 61 focused tokenizer/proposal/bounds/provenance/identifier tests pass; strict scoped TypeScript, repository lint, scoped lint and TypeScript formatting pass. Independent source review passes after two identifier findings were fixed with red/green regressions. Exactly 16 files under lib/context/imports; no dependency changes.

Current API has no equivalent text proposal parser. Skills' catalog import script handles file-based CSV/XLSX and identity/interest candidates with a different contract, and remains unchanged. Fixtures are synthetic; real-export calibration, original-byte retention, storage, review/acceptance, transport registration and authenticated end-to-end behavior remain follow-up work. No build, listener, provider or live customer operation was run.


Summary by cubic

Adds a bounded pure CSV parser that turns generic catalog export text into proposed rows with source pointers, raw cells, identifier states, fingerprints, malformed-row records, and duplicate signals. It does not establish identity or rights, accept assertions, persist data, or expose an HTTP/MCP operation—every proposal is literally status: "proposed". Supersedes the bounded 16-file parser source from #1013 on current main without its parent history; the original branch is preserved.

Bounded input handling

  • Caps decoded input at 1,048,576 UTF-16 code units before scanning, plus 10,000 data rows, 1,000 columns, and 10,000 cell length; whole-input failures throw ContextImportError with a code and never return a partial result.
  • Trailing blank lines use constant-size bookkeeping, so a long blank suffix cannot allocate unbounded records; interior blank lines are only materialized once a later record proves they are not trailing.

Parser behavior

  • Malformed rows (empty_row, column_count_mismatch, unterminated_quote, text_after_closing_quote) are reported with pointers beside proposals, never dropped or repaired; a cell with text after its closing quote keeps its literal source text.
  • Identifiers are shape-checked only: ISRC (2 letters, 3 alphanumerics, 7 digits) and UPC/EAN/GTIN (12–14 digits) after stripping ASCII hyphens and spaces and upper-casing ASCII letters. Tabs, line breaks, non-ASCII characters, and edge whitespace stay malformed rather than being repaired; empty cells are unknown; a missing column is uncollected.
  • Duplicates are signals, not deletions: same_isrc and same_row_content list rows ordered by first row; a shared UPC within one release is not flagged.
  • Validated by 61 focused tests plus strict scoped TypeScript, repository lint, scoped lint, and TS formatting; no dependency changes and exactly 16 new files under lib/context/imports.

Fixtures are synthetic; real-export calibration, storage, review/acceptance, transport registration, and authenticated end-to-end behavior remain follow-up work.

Written for commit 1395539. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Nov 2, 2026 10:19am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch was successfully deployed

1 active deployment
Preview — 13955394 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant