Fix PostgreSQL-tier boolean columns breaking all conversations endpoints #185

Merged
weichen merged 9 commits from fix/pg-boolean-columns into main 2026-10-05 05:07:16 +00:00
9 Commits
Author SHA1 Message Date
weichen f3940e409b Record the backend merge and post-sync acceptance on the task card
ci / test (pull_request) Successful in 1m53s
Why: Backend PR #62 dependency is now merged and the Dev branch is
synced with main; the card needs the closing evidence trail.
Evidence: backend 29 packages ok; make test all green at 8a91cded.
Impact: task card only.
Refs: PR #185
2026-10-05 05:06:59 +00:00
weichen 9bac35d198 Record the sync checkpoint 2026-10-05 05:04:33 +00:00
weichen 8a91cded36 Merge remote-tracking branch 'origin/main' into fix/pg-boolean-columns 2026-10-05 05:04:33 +00:00
weichen 686c41a046 Pin backend main after merging fix/pg-boolean-columns
Why: Backend PR #62 merged as 3f438b9 (superseded by #64/#65); task card
requires re-pinning the gitlink to the backend merge commit before the
Dev PR can merge.
Evidence: backend go vet + go test ./... -count=1 all ok (29 packages);
merged tree content-identical to backend main.
Impact: modules/backend 685bd0d -> 3f438b9.
Refs: .task/fix-pg-boolean-columns.md
2026-10-05 05:03:58 +00:00
weichen 8864596467 Record PR links and live re-verification evidence in the task card
ci / test (pull_request) Successful in 2m17s
Why: close the evidence loop for review.
Evidence: live endpoints returned 200 after redeploy; probe artifacts cleaned up.
Impact: task-card only.
2026-10-04 14:59:02 +00:00
weichen 8c0efa2459 Record the sync checkpoint
ci / test (pull_request) Successful in 2m3s
2026-10-04 14:52:46 +00:00
weichen 891a84f835 Pin backend fix/pg-boolean-columns for cross-tier boolean columns
Why: advance the backend gitlink to the boolean-column fix so the dev
runtime's PostgreSQL tier stops failing every conversations endpoint.

Evidence: backend branch pushed (685bd0d); make test run recorded in
the task card.

Impact: gitlink-only change in Dev; combined verification via make test.

Refs: .task/fix-pg-boolean-columns.md
2026-10-04 14:51:55 +00:00
weichen dbdb47ed09 Make boolean column reads and writes work on both storage tiers
Why:
The dev runtime switched to the PostgreSQL tier today 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:
- 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
(same tests green). Boolean columns that are INTEGER in both dialects
(hitl_cards.resolved, profiles.builtin, activity_cards.pinned) keep
boolInt().

Refs: task card .task/fix-pg-boolean-columns.md
2026-10-04 14:51:28 +00:00
weichen 8c434aaa71 Record the task card for fix-pg-boolean-columns 2026-10-04 14:46:19 +00:00