PG JSONB normalizes key order (alphabetical), so json.Compact alone
wasn't sufficient — {"approved":true,"notes":"LGTM"} stored as
{"notes":"LGTM","approved":true}. Unmarshal+remarshal normalizes
both sides before comparison.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root causes:
- PG store CreateInstance/CreateAssignment set defaults in local vars
but didn't write them back to the struct, so callers saw empty
Status fields (violating CHECK constraints on subsequent updates)
- PG JSONB normalizes whitespace ({"key": "val"} vs {"key":"val"})
but tests compared exact strings
- ListSignoffs test used "nonexistent" as instance_id but PG
validates UUID format
Fixes:
- Write defaults directly to inst.Status / a.Status in PG store
(aligns with SQLite store which already did this)
- Add jsonEq() helper using json.Compact for whitespace-agnostic
JSON comparison across all stage_data/review_data assertions
- Use valid zero-UUID for non-existent instance in signoff test
All 35 tests pass on SQLite (28 store + 7 engine).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>