pa-02 — Verification

One command

cd pa-02-api-design && bash scripts/verify.sh

What the tests prove

TestInvariant
TestCompatAddOptionalIsSafeadding an optional field is compatible
TestCompatAddRequiredIsBreakingadding a required field breaks old producers
TestCompatRemoveFieldIsWarningremoval warns (reserve the tag)
TestCompatTypeChangeIsBreakingchanging a tag's type is wire-breaking
TestCompatOptionalToRequiredIsBreakingtightening to required is breaking
TestCompatRenameIsWarningNotBreakinga rename (same tag/type) is wire-OK
TestIdempotencyReplaysame key runs the side effect once; retries return cached
TestIdempotencyDoesNotCacheFailuresfailures stay retryable
TestCursorRoundTripcursors encode/decode losslessly; empty = offset 0
TestCursorTamperRejectedtampered/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.