# Wire-format coverage

| Component | Supported behavior and boundaries |
| --- | --- |
| Steim-1 (10) | Four signed 8-bit, two signed 16-bit or one signed 32-bit difference per data word. Integration uses the full signed 32-bit sample domain. The first frame contains the forward and reverse integration constants. The declared sample count delimits trailing padding. |
| Steim-2 (11) | All seven layouts, from seven signed 4-bit differences up to one signed 30-bit difference. Encoding ends a record before a difference outside −536,870,912 through 536,870,911. The next record starts at the new absolute amplitude. |
| Frame packing | The encoder chooses the longest prefix that fits the frame budget and writes only the required frames. Each record starts with an independent first difference. A decoder ignores that first inter-record difference and checks the final sample against Xn. Reserved selectors in consumed words and impossible sample counts are errors. |
| miniSEED 2.4 | Reads data records with quality D, R, Q or M and blockette 1000. Header and sample word order may differ. Blockette 100 supplies an actual sample rate. Blockette 1001 supplies timing quality, signed microseconds and a frame count. Timing corrections are applied once. The reader translates the network, station, location and channel fields to a source ID. |
| miniSEED 3 | Checks length, calendar fields, UTF-8 JSON extra headers, source ID and CRC-32C. Reads and writes raw payloads through the record API. Header-only records have zero samples, rate, encoding and payload length. Raw access preserves records whose payload format is outside the waveform decoder. |
| Samples | The waveform API reads both Steim encodings and signed PCM encodings 1 and 3. It writes Steim-1 or Steim-2. Other encodings can be inspected at record level. Unfiltered decoding concatenates available samples in input order. Use an exact source ID to extract one channel from a mixed archive. |
| Conversion | Repack writes each source record independently. A single output record preserves its extra-header text. When the frame budget or a large jump forces a split, FDSN.Sequence stays on the first fragment. DataQuality and Time.Quality follow each fragment. Extra fields with unknown scope and duplicate JSON keys cause an explicit error when a split is required. Unsupported legacy blockettes also stop repacking. |
| Timing | Positive rates express samples per second. Negative on-wire rates express seconds per sample. Splits use the original start and cumulative sample index. Fractional rates are evaluated from their binary64 representation and rounded once to the nearest nanosecond (ties upward). Civil-time arithmetic covers years 0001 through 9999. A supplied second 60 survives subsecond arithmetic. Add elapsed time across an unmarked civil date on an ordinary 86,400-second day. |
| Limits | Individual input records are limited to 16 MiB. A raw codec decode accepts up to 16,777,216 samples per call, subject to frame capacity. The CLI frame budget is 1 through 65,536. A whole archive can be streamed as many consecutive records. Unsupported legacy blockette IDs remain available through Record.unmapped_blockettes. |

The header reader validates record structure and version 3 checksums. Waveform decoding additionally validates compressed data and the reverse integration constant. Unknown or compressed payloads whose sample count is unspecified are available through the record API for inspection.

## Source selection and time coverage

`inspect`, `decode`, `repack` and `timeline` accept a repeatable `--sid`. Selection uses the complete, case-sensitive source identifier and keeps the original order. All input records pass structural checks and applicable CRCs before selection. A well-formed unrelated payload may use another encoding. An unmatched selector gives empty output or a zero-record timeline summary.

`@timeline.Tracker` compares the next start for each source with the furthest exclusive end previously covered. For example, a 20 Hz record with 400 samples covers 20 seconds, so the next record can start exactly 20 seconds later. A contained duplicate produces an overlap while preserving that end. When record starts and ends advance together, the tracker keeps one endpoint per source. Overlapping records with different starting minutes can leave several possible endpoints when a subsequent record may reveal a leap second. The tracker retains those endpoints and updates coverage when it sees the label.

Records are evaluated as they arrive. A gap reported before a later backfill stays in the report. For an inventory of final gaps, supply each source in chronological order and resolve duplicate or overlapping coverage as appropriate.

The CLI reports the arriving record's UTC start and byte offset. A gap or overlap also carries the signed difference in nanoseconds as a decimal string. A rate change compares consecutive known rates for that source, including equivalent positive hertz and negative period representations. An unknown sample count or rate, or an end outside the supported calendar, produces `unassessed` and clears that source's cursor. A header-only record leaves coverage untouched. The tracker remembers each explicitly labelled leap minute once per source, including when records arrive out of order. For intervals without such labels, civil days have 86,400 seconds.

## Native archive checks

`steimcheck` reads one record at a time from a file, redirected stdin or a named pipe. Default mode validates integer sample layout and integrates Steim differences through Xn without storing a decoded array. `--headers-only` accepts other waveform encodings, checks miniSEED 3 CRCs and reports the sum of the header sample counts. miniSEED 2 does not carry a record CRC. On success both modes write one JSON summary. A failure writes a diagnostic with the record offset to stderr and exits nonzero.

The Steim word layouts are defined in Appendix B of the SEED 2.4 manual. FDSN defines the miniSEED 3 fixed header and the byte order of each payload encoding. [SEED reference manual](https://www.fdsn.org/pdf/SEEDManual_V2.4.pdf) · [miniSEED 3 record definition](https://docs.fdsn.org/projects/miniseed3/en/latest/definition.html) · [FDSN data encodings](https://docs.fdsn.org/projects/miniseed3/en/latest/data-encodings.html)
