Skip to content

Commit 81e8349

Browse files
committed
refactor(webapp): drop the dashboard agent's JSONB transcript column
The feature is unreleased and this branch is local, so there is no rolling deploy in which an old instance still selects `chats.messages` — the usual reason to keep a replaced column for one more release does not apply, and after release the drop would cost two deploys. So it goes now. With no data to preserve there is no backfill, and with no backfill there is no such thing as a stored message without an id: `message_id` is `NOT NULL` and the writers read `message.id` with no fallback, so a malformed message fails the insert instead of being given an invented identity by untested code. Removing the column from the drizzle schema is also the enforcement that nothing writes it — a surviving TypeScript reference stops compiling. The scan for raw SQL naming the column found nothing to guard, so there is no test for it. The four idempotency invariants each get their own test against a real table: a repeated message id creates no row and keeps its position; eight genuinely concurrent appends take eight distinct positions, with a raw insert past the query layer proving it is `UNIQUE (chat_id, position)` doing the work; a controlled update changes one body and leaves identity, position and every other row alone; and a mid-turn append survives the turn's write, landing where it happened rather than at the end. `dashboardAgentTranscriptMerge.test.ts` becomes `dashboardAgentTranscriptStore.test.ts`: it no longer tests a merge, and the ordering it asserted has deliberately changed.
1 parent 020dad2 commit 81e8349

10 files changed

Lines changed: 1657 additions & 269 deletions

apps/webapp/test/dashboardAgentInvestigationSweepCard.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { sweepDashboardAgentInvestigations } =
2525
* The transcript half of the sweep, without a container: settling the row is invisible
2626
* to the panel, which resolves a card from the chat's own `render_view` parts.
2727
*
28-
* The database half — that the closing card actually lands in `chats.messages` — is
28+
* The database half — that the closing card actually lands in `chat_messages` — is
2929
* covered by `dashboardAgentInvestigationSweep.test.ts`, which needs Postgres.
3030
*/
3131

apps/webapp/test/dashboardAgentTranscriptMerge.test.ts

Lines changed: 0 additions & 225 deletions
This file was deleted.

0 commit comments

Comments
 (0)