Run artifact

workspace/targets/CsvStat/blueprint/FEATURE-CsvReading.md

FEATURE: CSV Reading

FieldValue
Version20261025 V1
DescriptionRead UTF-8 RFC 4180 CSV with the first record as the header, recording each record's source line.
Depends OnARCHITECTURE.md
Providescsvdata.Read
ConsumesNone

Purpose

internal/csvdata turns an input stream into a header and data records. Trimming, null recognition, and rejection of malformed input are separate stories that build on this reader.

Behavior

counts are judged by the rejection story, and LazyQuotes off.

on which the record starts, and Fields []string.

with no trimming.

yields the same records.

Records and no error; the input-rejection story turns that into a rejection.

with errors.As and *csv.ParseError.

Tests For The Project Suite

The builder writes these internal/csvdata tests, named exactly as listed:

quoted field that spans lines.

Programmatic Acceptance

=== AC read-header-and-records ===
Intent: The first record is the header and later records are data records.
Requires: executable=go; scope=test

import sys from drydock_go import run_test

result = run_test("./internal/csvdata", "TestReadHeaderAndRecords") print(result.stdout) print(result.stderr, file=sys.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC read-header-and-records ===

=== AC read-quoted-comma ===
Intent: A quoted field containing a comma parses as one value.
Requires: executable=go; scope=test

import sys from drydock_go import run_test

result = run_test("./internal/csvdata", "TestReadQuotedComma") print(result.stdout) print(result.stderr, file=sys.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC read-quoted-comma ===

=== AC read-trailing-newline ===
Intent: A line ending after the last record does not create an extra data record.
Requires: executable=go; scope=test

import sys from drydock_go import run_test

result = run_test("./internal/csvdata", "TestReadTrailingNewline") print(result.stdout) print(result.stderr, file=sys.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC read-trailing-newline ===

=== AC read-line-numbers ===
Intent: Each record carries the source line on which it starts.
Requires: executable=go; scope=test

import sys from drydock_go import run_test

result = run_test("./internal/csvdata", "TestReadRecordLineNumbers") print(result.stdout) print(result.stderr, file=sys.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC read-line-numbers ===

=== AC read-header-only-and-empty ===
Intent: A header-only input has zero records and an input with no record has no header.
Requires: executable=go; scope=test

import sys from drydock_go import run_test

for name in ("TestReadHeaderOnly", "TestReadNoRecords"): result = run_test("./internal/csvdata", name) print(name, result.status) print(result.stdout) print(result.stderr, file=sys.stderr) assert result.passed, (name, result.status, result.stdout, result.stderr) === END AC read-header-only-and-empty ===

User Acceptance

Guardrails