Skip to content

Add Coinbase compliance report artifacts and synthetic tests - #511

Merged
abrignoni merged 3 commits into
abrignoni:mainfrom
CyberMike81:feat/coinbase-compliance-report
Sep 25, 2026
Merged

abrignoni merged 3 commits into
abrignoni:mainfrom
CyberMike81:feat/coinbase-compliance-report

Conversation

@CyberMike81

@CyberMike81 CyberMike81 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds 14 RLEAPP artifacts for Coinbase IdvComplianceReport legal-process returns (*compliance_report*.csv), with synthetic fixtures and expected results. Source File and CSV Record retain record context; derived UTC timestamps have adjacent source timestamps and time-basis columns.

Review revisions

  • Report detection now checks the first cell of the first nonempty parsed CSV row. Fully quoted CSVs produce the same artifact rows as unquoted CSVs. Every unreadable or non-report matched file is logged by filename and skip reason.
  • Notes describe layout scope without the unreferenceable testing claim or the parenthetical about a particular duplicate copy. Duplicate input copies still produce separate source observations.
  • After blank lines, exact repeated headers and the known PAN sub-table start new tables. A changed uppercase header-like row with at least two known column labels also starts a new table; values are mapped using that header's own order. Header-like blocks with insufficient known labels, and their continuation blocks, are preserved in Other Sections without assigning values under earlier headers. Ordinary data blocks continue the current table. This remains a documented heuristic, not a guarantee for every future layout.
  • The fixture now includes a fully quoted report, reordered transaction columns, an uncertain block, and PST timestamps in the converted Transactions and Events columns. The non-PAN sub-table examples are synthetic regression coverage, not a claim of validation against additional production layouts.

Validation

  • All 14 artifact baseline comparisons pass. The five updated snapshots reflect the additional transaction, retained raw rows, timestamp-basis changes, and downstream CSV record-number changes.
  • 377 regression tests ran successfully, with 8 skips. Targeted regressions compare quoted versus unquoted output across all 14 artifacts, check logging for skipped files, and verify reordered columns, unknown-block retention and fixed-offset timestamp conversion.
  • Changed-files lint reports zero warnings. Claim, description, HTML-safety, source-path and report-local-path checks pass for this submission; existing limitations on unrelated dynamic artifact metadata remain.
  • A full RLEAPP run with the Coinbase profile produces all 14 artifacts, with no machine-local paths in exported TSV rows.

Scope

Layouts are those of synthetic returns and one 2025 production; other production years and layouts may differ. Values retain the documented whitespace normalization; source copies are not silently deduplicated. No real return data is included. This is a self-contained RLEAPP artifact module, independent of the Robinhood submission.

CyberMike81 and others added 2 commits September 23, 2026 16:18
New module for Coinbase's compliance_report.csv law enforcement return
(IdvComplianceReport). The existing coinbaseArchive module reads a
different export (coinbase_data.json), so this is a separate module.

The report is one CSV of '***'-titled sections. Named sections get their
own artifact (subscriber details, ID verification, phones, previous
emails, billing addresses, bank accounts, other payment methods, crypto
addresses, totals, transactions, exchange activity, account events,
manual reviews). Every other section is reported cell for cell under
Other Sections, so no section is dropped.

Values are reported as produced, with the provider's column names.
Timestamps are converted to UTC only when the value states an offset or
a zone abbreviation, next to the value as produced and a Time Basis
column. Columns a later production adds are kept in Other Columns.

Tested against a synthetic return (generator included) and one real
2025 production holding two reports; other years are untested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017LbbHja96FzwdwqWVug21P
caseSYNTH001 is generated by admin/test/scripts/gen_coinbase_compliance_synth.py
with fabricated values only. It covers two reports plus a byte-identical
nested copy, offset, Z, zone-abbreviation and zone-less timestamps, a
multi-line cell, a table split by a blank row, the two-table legacy card
section, an unnamed extra column, unmapped, header-only and empty
sections, and a decoy CSV that matches the path pattern.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017LbbHja96FzwdwqWVug21P

@abrignoni abrignoni left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Mike. This one is in really good shape. The module is tight, nothing in a report gets dropped (unnamed sections go to Other Sections and unknown columns are kept as JSON), and the fixture covers two different users, a duplicate copy of a report, a CSV that is not a report, and timestamps with no zone. The committed test cases all match, the repo checks and the changed-files lint pass, and a full RLEAPP run on the fixture produced all 14 artifacts with no local paths in the output. Good stuff.

A few things before it goes in.

Needs a fix

  1. A report with quoted cells is skipped silently. _read_report decides whether a file is a report by checking the raw first text line for USER ATTRIBUTES ***, not the first parsed CSV cell. I rewrote the fixture report with every cell quoted, so the first line reads "USER ATTRIBUTES ***", and _read_report returned None. That means all 14 artifacts report nothing for that file and nothing is logged. Please check the first cell of the first parsed CSV row instead, and add a logfunc line for any matched file that is not read as a report, so the examiner can see it was skipped.

  2. Notes wording. Every notes field ends with "Tested against synthetic returns and against one real 2025 production holding two reports", and the duplicate-copy sentence says "(the tested one did)". Since the production cannot be referenced, nobody reading the report can check either one. I'd describe the scope without the testing claim, for example "Layouts are those of synthetic returns and one 2025 production; other production years and layouts may differ", and "A production can hold the same report more than once, and each copy is reported."

Question

  1. Second header rows inside a section. _tables treats a block after a blank line as a new table only when its first cell is PAN. Any other second header in a section is read as a data row under the first table's column names, with the rows after it following along. For the named-column artifacts that puts values under the wrong headers. Have you seen other sections carry a second table in real reports? If so, it would be safer to start a new table whenever a block's first row looks like a header, or to send those blocks to Other Sections.

Suggestion

  1. The notes say values with a zone abbreviation (PST and so on) are converted as fixed offsets, but the only abbreviated value in the fixture is the CREATED field in USER ATTRIBUTES, which is not converted. Adding one abbreviated timestamp to a section with a Timestamp (UTC) column (transactions or events) would put that path under test.

Happy to take another look once these are in.

Detect reports using parsed CSV cells and log skipped matches. Recognize repeated or changed known headers and preserve uncertain header-like blocks in Other Sections. Document layout limits and exercise fixed-offset zone abbreviations in converted columns. All 14 artifact baselines pass; 377 regression tests run successfully with eight skips.
@abrignoni
abrignoni merged commit 9072e8d into abrignoni:main Sep 25, 2026
11 checks passed
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.

2 participants