# Data contract

The CSV feature adapter accepts one header row followed by:

```text
id,kind,nominal,lower,upper,datum
```

`lower` and `upper` are offsets from nominal. For example, `nominal=10`, `lower=-0.1`, and `upper=0.1` describe the inclusive interval `[9.9, 10.1]`.

Supported `kind` values are `hole`, `shaft`, `plane`, `slot`, `circle`, `cylinder`, and `datum`. Boolean `datum` values are `true` or `false`. The strict diagnostic parser reports row number, field, code, and message for malformed numbers, unknown kinds, reversed tolerances, empty IDs, and invalid booleans. Quoted fields may contain commas and escaped quotes.

Observation records use `feature_id,value,sample_count`. A non-positive sample count is invalid for quality summaries; missing observations remain explicit and classify as `Unmeasured`.

`Device.id` is the boundary key for a later CMM, laser, vision, or shop-floor adapter. `MeasurementStep` is the portable plan record and contains the selected device, strategy, direction, and uncertainty. The core package does not attach vendor-specific machine commands to it.

For report exchange, `AuditTrace` preserves plan entries and verdicts, `MeasurementProtocol` preserves operational preconditions and acceptance checks, and `ReportManifest` records schema/version/count/coverage metadata. These records are suitable for deterministic text or CSV export.
