# CSVTool CSV Repair Corpus v1

This directory is a versioned, machine-readable corpus for testing deterministic
CSV validation and repair. Every fixture is synthetic: it was written solely for
this corpus, contains no customer or personal data, and is dedicated to the
public domain under CC0 1.0.

The stable entry point is [`manifest.json`](./manifest.json). It records the
published file SHA-256, decoded SHA-256 where a transport encoding is used,
expected findings and repair actions, allowed repairs, and non-loss invariants.
Consumers should reject a fixture when its digest does not match the manifest.

## File and encoding conventions

- UTF-8 text fixtures are published directly as `.csv`, `.tsv`, or `.txt`.
- `utf8-bom.csv` begins with the three-byte UTF-8 BOM (`EF BB BF`).
- `latin1.csv.base64.txt` is an ASCII-safe Base64 transport of an ISO-8859-1
  CSV. Decode Base64 first, verify `decodedSha256`, then decode bytes as
  ISO-8859-1. This keeps the non-UTF-8 fixture byte-exact through source hosts,
  package managers, and browsers.
- Fixture files are marked `-text` in `.gitattributes` so Git does not rewrite
  line endings and invalidate their digests.

## Repair contract

The corpus distinguishes automatic structural repairs from optional content
changes. Default repair must preserve the ordered multiset of every non-empty
data cell. Empty-cell padding and header extension are allowed; silent removal
or replacement of non-empty values is not. Ambiguous malformed quoting must
remain an explicit parser error.

Formula-like values are preserved by default. The formula fixture also defines
an opt-in verification run in which each risky export value is prefixed with a
single apostrophe. That behavior is documented as spreadsheet export hardening,
not as a claim that the original value was invalid.

## Versioning

`schemaVersion` describes the manifest shape and `corpusVersion` describes this
fixture set. Existing v1 files and expectations are immutable. Corrections or
new semantics require a new versioned directory rather than changing v1 in
place.

## License and provenance

See [`LICENSE.txt`](./LICENSE.txt). SPDX identifier: `CC0-1.0`.
