airi/apps/server/drizzle/meta
RainbowBird f8d1fa7a64
Some checks failed
CI / Build Test (stage-tamagotchi) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Build Test (stage-tamagotchi-godot) (push) Waiting to run
CI / Build Test (stage-web) (push) Waiting to run
CI / Build Test (ui-loading-screens) (push) Waiting to run
CI / Build Test (ui-transitions) (push) Waiting to run
CI / Type Check (push) Waiting to run
CI / Check Provenance (push) Waiting to run
Cloudflare Workers / Deploy - stage-web (push) Waiting to run
Update Nix assets Hash / update (push) Has been cancelled
Update Nix pnpmDeps Hash / update (push) Has been cancelled
refactor(server): drop redis stream + worker role (#1792)
The Redis Stream `billing-events` + `worker` Railway role +
advisory-lock poller layered together didn't actually buy us reliability
— `debitFlux` swallowed XADD failures, leaving the door open to "balance
updated, ledger row never written". Collapse the whole thing back to:
`creditFlux` and `debitFlux` write `flux_transaction` ledger rows inline
within the same DB transaction that mutates `user_flux`, and `(user_id,
request_id)` remains the partial unique index that keeps retries safe.

Concrete changes:
- Inline ledger inserts in `BillingService.{debitFlux, creditFlux,
creditFluxFromStripeCheckout, creditFluxFromInvoice}`; drop `billingMq`
and `publishEvent` plumbing entirely.
- `routes/openai/v1` writes `llm_request_log` synchronously via the
existing `requestLogService`; the duplicate `llm-request-log.ts` service
module is removed.
- `bin/run-worker.ts`, `libs/mq/*`,
`services/billing/billing-events.ts`,
`services/billing/billing-consumer-handler.ts`, and matching tests are
deleted. CLI now exposes only `api`.
- `BILLING_EVENTS_*` env vars and the `DEFAULT_BILLING_EVENTS_STREAM`
helper are dropped; `docker-compose.yml` no longer ships a worker
service.
- `docs/ai-context/{workers-and-runtime, billing-architecture,
redis-boundaries-and-pubsub, data-model-and-state,
architecture-overview, README}.md`, `CLAUDE.md`, and the existing
verification docs are updated to describe the single-process synchronous
pipeline.

Tests: 29 files / 247 cases pass. Production deployments need to drop
the worker Railway service after this lands.
2026-05-08 21:14:01 +08:00
..
0000_snapshot.json refactor(server): squash drizzle migration files 2026-03-04 18:41:21 +08:00
0001_snapshot.json feat(server): stripe integration and credits system (#1024) 2026-03-28 02:25:44 +08:00
0002_snapshot.json feat(server): stripe service, more stripe table 2026-03-28 02:25:44 +08:00
0003_snapshot.json feat(server): official provider router (#1117) 2026-03-28 02:25:44 +08:00
0004_snapshot.json feat(server): flux aduit (#1482) 2026-03-28 02:25:44 +08:00
0005_snapshot.json feat(server): reimplement message queue, drop outbox 2026-03-28 02:25:44 +08:00
0006_snapshot.json refactor(server): squash flux-audit-log into flux-ledger 2026-03-28 02:25:44 +08:00
0007_snapshot.json feat(server): refactor flux auditing to transaction logging 2026-03-28 02:25:44 +08:00
0008_snapshot.json feat(auth): OIDC (#1531) 2026-04-02 04:24:04 +08:00
0009_snapshot.json feat(auth): delete account (#1756) 2026-04-28 20:53:00 +08:00
0010_snapshot.json refactor(server): drop redis stream + worker role (#1792) 2026-05-08 21:14:01 +08:00
_journal.json refactor(server): drop redis stream + worker role (#1792) 2026-05-08 21:14:01 +08:00