pa-02 — Verification
One command
cd pa-02-api-design && bash scripts/verify.sh
What the tests prove
| Test | Invariant |
|---|---|
TestCompatAddOptionalIsSafe | adding an optional field is compatible |
TestCompatAddRequiredIsBreaking | adding a required field breaks old producers |
TestCompatRemoveFieldIsWarning | removal warns (reserve the tag) |
TestCompatTypeChangeIsBreaking | changing a tag's type is wire-breaking |
TestCompatOptionalToRequiredIsBreaking | tightening to required is breaking |
TestCompatRenameIsWarningNotBreaking | a rename (same tag/type) is wire-OK |
TestIdempotencyReplay | same key runs the side effect once; retries return cached |
TestIdempotencyDoesNotCacheFailures | failures stay retryable |
TestCursorRoundTrip | cursors encode/decode losslessly; empty = offset 0 |
TestCursorTamperRejected | tampered/garbage cursors are rejected |
All under -race.
What "green" does NOT guarantee
- No reserved-tag history. Tag reuse (the worst change) needs a registry to detect (exercise) — a two-schema diff can't.
- CRC, not HMAC. Cursors resist accidents, not a determined attacker (use HMAC in production).
- In-memory idempotency. A real key store is a replicated TTL'd KV on the write path.