Commit graph

11 commits

Author SHA1 Message Date
RainbowBird
f259e7eb92
feat(server): replace legacy health endpoints with K8s-style /livez and /readyz probes
Some checks are pending
Cloudflare Workers (server-dev) / Deploy - stage-web (server-dev) (push) Waiting to run
2026-05-15 19:02:57 +08:00
RainbowBird
f8d1fa7a64
refactor(server): drop redis stream + worker role (#1792)
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
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
RainbowBird
eab60d0bdb feat(server): reimplement message queue, drop outbox 2026-03-28 02:25:44 +08:00
RainbowBird
ba3d66de86 feat(server-protocol): introduce shared protocol types for AIRI server clients and frontends
- Added package.json for @proj-airi/server-protocol with necessary configurations.
- Implemented chat event types including WireMessage, SendMessagesRequest, and PullMessagesRequest.
- Defined WebSocket event types and structures for better integration with AIRI components.
- Updated server-runtime and server-sdk to utilize the new server-protocol package.
- Refactored imports across various packages to replace server-shared types with server-protocol types.
- Enhanced type definitions and added TypeScript configurations for better development experience.
2026-03-28 02:25:44 +08:00
RainbowBird
889a1e0800 feat(server): redis, config kv integration 2026-03-28 02:25:44 +08:00
RainbowBird
7bab092592
chore(server): apply env to docker compose 2026-02-26 18:10:25 +08:00
RainbowBird
b34f7ea5f8
fix(docker): server dockerfile 2026-01-14 14:22:26 +08:00
Neko Ayaka
ba77b9e7ba
fix(server): database with duplicated index 2026-01-05 16:27:10 +08:00
Neko Ayaka
ca45b0dfb6
fix(server): dockerfile & railway fix 2026-01-05 16:26:44 +08:00
Neko Ayaka
8cbdb6be2e
fix(server): docker-compose fix 2026-01-05 16:26:44 +08:00
RainbowBird
d064a959cf
feat(server): with api server, service-lize (#807)
Co-authored-by: Neko Ayaka <neko@ayaka.moe>
Co-authored-by: Lovehsigure_520 <1260907335@qq.com>
2026-01-05 16:24:03 +08:00