Skip to content

Fix op checkpoint JSONB binding#2293

Open
uncfreak1255-code wants to merge 4 commits into
garrytan:masterfrom
uncfreak1255-code:codex/upstream-op-checkpoint-jsonb-direct-fix
Open

Fix op checkpoint JSONB binding#2293
uncfreak1255-code wants to merge 4 commits into
garrytan:masterfrom
uncfreak1255-code:codex/upstream-op-checkpoint-jsonb-direct-fix

Conversation

@uncfreak1255-code

@uncfreak1255-code uncfreak1255-code commented Jun 18, 2026

Copy link
Copy Markdown

Summary

  • Fix recordCompleted so op_checkpoints.completed_keys is written as a real JSONB array on Postgres, not a JSON string scalar.
  • Add focused PGLite coverage plus a real Postgres E2E regression for the postgres.js direct binding path.
  • Narrow the JSONB pattern guard to this checkpoint regression and fix the admin build check so local verify does not hang behind the Bun wrapper.

Upstream comparison

Compared against #2288: same root cause, but this branch binds a wrapper object and extracts completed_keys server-side via ($3::jsonb)->'completed_keys'. That keeps the existing direct-pool write path while avoiding JSON.stringify(sorted) double-encoding.

The first PR I opened from this machine (#2292) was closed because it was based on the fork master lineage and included unrelated history. This is the rebuilt upstream-based PR.

Proof receipts

  • bun run verify -> [verify-parallel] elapsed=95s | pass=30 fail=0 | all checks green
  • bun test test/op-checkpoint.test.ts -> 31 pass, 0 fail
  • scripts/check-jsonb-pattern.sh -> all three JSONB/max_stalled checks OK
  • Fresh pgvector/pgvector:pg16 Postgres E2E: DATABASE_URL=postgresql://postgres:postgres@localhost:5435/gbrain_test bun test test/e2e/op-checkpoint-jsonb-postgres.test.ts -> 1 pass, 0 fail
  • Direct Postgres readback: SELECT jsonb_typeof(completed_keys), completed_keys->>0, jsonb_array_length(completed_keys) ... -> array|chunk-a|2

@uncfreak1255-code uncfreak1255-code changed the title Fix checkpoint JSONB completed-key binding Fix op checkpoint JSONB binding Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant