Postgres: sources writer status/claim crash with "JSON.stringify cannot serialize BigInt" after activation
Summary
On Postgres, after sources writer activate and a first committed managed write, every writer-administration read fails:
$ gbrain sources writer status --probe --json
JSON.stringify cannot serialize BigInt.
$ gbrain sources writer status
JSON.stringify cannot serialize BigInt.
$ gbrain sources writer claim <src> --path <root> --json
JSON.stringify cannot serialize BigInt.Before activation the same commands print their JSON correctly, so it is the post-activation payload (queue/effect/sequence counters read as int8, which postgres.js returns as BigInt) hitting JSON.stringify in runPersistenceAdminCli with no replacer. PGLite is unaffected.
Impact
sources writer status is the documented diagnostic for owner epochs, queue depth/age, capacity and blocked requests — the concurrent-writes guide points at it for every recovery decision. On Postgres it is unusable exactly when it matters: right after activation and during a cutover. Operators are pushed to read persistence_* tables directly.
Repro (0.51.0.0, Postgres 17 + pgvector)
Activate a brain, commit one remember through a resident stdio server (so effects and counters exist), then run any of the three commands above.
Note
This is the same class as the already-fixed BigInt serialization issues in the takes commands (#4658, #4634) and the CLI normalization fix (#2450); the persistence-admin path was not covered.
Source: garrytan/gbrain