# Reproduce the register histories

These are constructed event histories, not device measurements or a general
linearizability checker. The model covers one write and one sequential reader.

Download these files into the same directory:

- register-contracts.mjs
- register-contracts.test.mjs
- register-pending.test.mjs

Use Node.js 22.22.3 or a newer supported release; no npm install is needed.

```sh
node --test register-contracts.test.mjs register-pending.test.mjs
node --input-type=module -e 'import { examples } from "./register-contracts.mjs"; console.table(examples())'
```

## Interpret the results

The nine rows enumerate two reads from the declared domain, not outcome
probabilities. Event positions specify order, not latency. The helper treats
touching intervals as non-overlapping: a response at position t precedes an
invocation at t. Do not feed rounded production timestamps into that convention
without resolving their event order.

`classify` requires a completed write. `classifyPendingWrite` requires
`write.end: null`, meaning no response in the observed history. An omitted
write and a hypothetically completed write are alternative explanations, not
claims about delivery, acknowledgment or crash durability. A timeout response
must be interpreted using the actual API contract.

The tests include explicit allowed outcomes, malformed inputs, same-value
writes, new-old inversion and independent finite event-order oracles. A passing
finite enumeration does not prove an arbitrary implementation correct.

Primary sources and the worked explanation:
https://hesela.com/analyses/storage-consistency-ordering/#register-contracts
