Why:
The dev runtime switched to the PostgreSQL tier and every conversation
endpoint started returning 500. Migrations define
conversations.pinned/archived/allow_cross_read/cross_private and
users.must_change_password/is_admin as BOOLEAN on PostgreSQL but
INTEGER on SQLite, while the store layer compared them with 0/1
literals, scanned them into int, and wrote them via boolInt().
Under pgx these fail with 42883 (operator does not exist: boolean =
integer), bool encode errors, or 42804 (column is of type boolean but
expression is of type integer).
Evidence:
- parent-repo main 4fd03ee with AGENT_PG_TEST_DSN:
TestConversationFlagsAndTaskList and TestAdminAccountsAndSessions
fail with the errors above; live GET /api/conversations returned
"operator does not exist: boolean = integer (SQLSTATE 42883)".
- this branch: full ./internal/store suite green on the PostgreSQL
tier (AGENT_PG_TEST_DSN against a scratch database), pgbus green,
make test-backend green on the SQLite tier.
- scan into *bool and Go bool parameters are cross-dialect: pgx encodes
bool natively; database/sql converts bool<->0/1 for SQLite.
- pre-existing and out of scope: ./internal/runmgr PG integration tests
fail on main too (gin_trgm_ops invisible inside the search_path
isolation schema, 42704).
Impact:
Conversations list/detail/flags and user auth-state reads/writes now
work identically on both storage tiers; SQLite behavior is unchanged.
Refs: Dev task .task/fix-pg-boolean-columns.md