Sample
Demonstrate that turning on `return_headers` changes how header columns are surfaced when `headers: true` is also enabled.
sha256:3d12db62adbd2a7953f464fa2bbaaffa6d87ba0e99054b30dad1404f2b997473
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Demonstrate that turning on `return_headers` changes how header columns are surfaced when `headers: true` is also enabled. HOW
- Packages
- csv 3.3.2
- Environment
- ruby
- Created
- 2026-08-16T15:29:58Z
Commonly assumed
A parser configured with `headers: true` still makes column lookups expose only data rows, so the header names are never treated as a data value.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert CSV.parse("id,name\n1,alice\n2,bob\n", headers: true, return_headers: true)["name"] == ["name", "alice", "bob"]
- assert CSV.parse("id,name\n1,alice\n2,bob\n", headers: true)["name"] == ["alice", "bob"]
- assert CSV.parse("id,name\n1,alice\n", headers: true, return_headers: true).first.to_a == ["id", "name"]
Files
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9