fix(db): reconcile prod-orphaned migrations blocking Supabase branching (#942)

* fix(db): reconcile prod-orphaned migrations blocking Supabase branching

Prod's schema_migrations carries three versions with no committed file on
main, leaving the default Supabase branch in MIGRATIONS_FAILED and stopping
preview branches from being created:

  20260707113729  add_transactions_enrichment    (adopted from #927)
  20260708120000  ledger_stats_committed_at_lag  (adopted from #935)
  20260708130000  ledger_deep_context            (adopted from #935)

Adopt the byte-identical SQL under the exact apply-time versions, plus the
matching pg-tests and fixtures for the two RPCs so pg-real stays green:
20260708120000 switches get_ledger_usage_stats' median_booking_lag_days to
committed_at, so the existing test now asserts the new behavior. Idempotent
(ADD COLUMN IF NOT EXISTS / CREATE OR REPLACE FUNCTION): no-op on prod,
clean on fresh replays, no-op on #927/#935's next rebase. The knowledge-page
UI/lib/i18n stay in #935.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(deps): pin @anthropic-ai/bedrock-sdk to 0.29.1

0.32.0 (grouped dependabot bump #884) broke Bedrock streaming in prod: empty stream / "request ended without sending any chunks", taking down the in-app AI assistant and invoice OCR. Local dev ran the stale 0.29.1 in node_modules, so it only failed on deploys built fresh from the lockfile. Revert to the six-week-stable 0.29.1; creds/region were never the cause (proven AKIA key + eu-west-1).

Guard against an accidental re-bump three ways: exact pin (no caret), a dependabot ignore, and a pinned-dep check in scripts/checks/no-new-antipatterns.mjs (check:guards). Unpin only once 0.32.x streaming is verified against Bedrock. See DECISIONS.md.
This commit is contained in:
Mattsson
2026-07-08 23:54:49 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent c068638d24
commit 8dde46ad96
11 changed files with 752 additions and 7 deletions
+9
View File
@@ -49,3 +49,12 @@ updates:
update-types:
- minor
- patch
ignore:
# @anthropic-ai/bedrock-sdk is PINNED to an exact version in package.json.
# 0.32.0 arrived inside a grouped minor-and-patch bump (#884) and broke
# Bedrock streaming in prod: the SDK returned an empty stream ("request
# ended without sending any chunks"), taking down the in-app AI assistant
# and invoice OCR. Do NOT let dependabot bump it until 0.32.x streaming is
# verified against Bedrock. Enforced by scripts/checks/no-new-antipatterns.mjs
# (pinned-dep). See DECISIONS.md (2026-07-08).
- dependency-name: "@anthropic-ai/bedrock-sdk"