Skip to content

perf(db): index token_ledger and collapse the balance read to one statement - #17908

Merged
diegosouzapw merged 15 commits into
cheaper-inference:release/v3.8.53from
oyi77:work/audit-20261022b
Nov 4, 2026
Merged

diegosouzapw merged 15 commits into
cheaper-inference:release/v3.8.53from
oyi77:work/audit-20261022b

Conversation

@oyi77

@oyi77 oyi77 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What

token_ledger has had no index since 060_create_gamification.sql created it. This adds the two indexes the balance and history reads need, and collapses getBalance from two full scans into one statement.

Why

Read Before After
getBalance SCAN token_ledger ×2 SEARCH ... USING INDEX idx_token_ledger_to_created / ..._from_created
getHistory MULTI-INDEX OR (already fine) unchanged

Measured with sqlite 3.46.1 via EXPLAIN QUERY PLAN.

transferTokens calls getBalance inside its own write transaction (src/lib/db/gamification.ts), and the ledger is append-only, so the scan cost was unbounded write-lock hold time — a correctness-adjacent problem, not only a latency one.

Why not UNION ALL

The obvious rewrite of getHistory into a UNION ALL of two indexed branches measures worse: MERGE plus two USE TEMP B-TREE FOR LAST TERM OF ORDER BY. The existing WHERE from = ? OR to = ? ORDER BY created_at DESC already plans as MULTI-INDEX OR over both new indexes. So getHistory is untouched.

getBalance is different: a single SUM(...) WHERE from = ? OR to = ? cannot use either index (it has to scan and filter). Splitting it into two scalar subqueries is what makes the indexes reachable, and it is also one round trip instead of two.

Test

tests/unit/migration-213-token-ledger-indexes.test.ts — 5 tests that pin both the plan and the behaviour:

  • index names exist after migration
  • getBalance plan uses each index and does not SCAN token_ledger
  • getHistory plan still resolves MULTI-INDEX OR (guards against a future UNION ALL regression)
  • net balance across credit and debit
  • overdraft rejected, then accepted at exactly the balance

Gates

docs-counts        EXIT=0
docs-sync          EXIT=0   (66 llm.txt mirrors match root)
doc-links          EXIT=0   (1251 links)
migration-numbering EXIT=0   (210)
file-size          EXIT=0
dead-code          EXIT=0   (367 <= 377)
cycles (ratchet)   EXIT=0   (14/14)
boundary (ratchet) EXIT=0   (774/774)
typecheck:core     EXIT=0   (0 errors)
eslint (changed)   EXIT=0
unit 213 + 20 gamification suites  229/229 pass

Known red, not from this branch

check-open-sse-typecheck.mjs reports 11 errors (browser-worker.ts TS2353 ×7, chatgpt-session.ts TS2353 ×3, token-estimate.ts TS2307 tiktoken). They reproduce on a clean HEAD worktree containing none of this branch's files, and they vanish when packages/browser-pool is removed — inherited tip drift in the signal member of the browser-pool page type.

Docs

Migration count 209 → 210 in README.md, AGENTS.md, llm.txt, and the 69 translated README rows. The 66 docs/i18n/<locale>/llm.txt files are byte-exact mirrors of root llm.txt (check-docs-sync.mjs compares the body), so they carry the same four sites. Each mirror is exactly 4 4 in --numstat and every removed line contains 209 — verified, not assumed.

docs/audit/AUDIT-2026-10-22.md carries the full audit this came out of, with §6 item 2 corrected to the index-only fix.

oyi77 added 3 commits October 22, 2026 12:03
…tement

token_ledger was created in 060 with no index. getBalance summed one column and
then the other (two full scans), and getHistory filtered on one of two columns
and sorted by created_at (scan + temp B-tree). transferTokens calls getBalance
inside its own write transaction, so the scan was write-lock hold time on an
append-only table.

Two indexes, one per direction. getBalance becomes a single row with two scalar
subqueries: a single SUM over  cannot use either index, but
each correlated subquery can. getHistory is untouched - EXPLAIN QUERY PLAN shows
the existing OR already plans as MULTI-INDEX OR over both new indexes, and a
UNION ALL rewrite measured slower (MERGE plus two temp B-trees).

Measured with sqlite 3.46.1 via EXPLAIN QUERY PLAN:
  before: SCAN token_ledger / SCAN token_ledger
  after:  SEARCH token_ledger USING INDEX idx_token_ledger_to_created
          SEARCH token_ledger USING INDEX idx_token_ledger_from_created

tests/unit/migration-213-token-ledger-indexes.test.ts pins the plan and the
behaviour (net balance, newest-first history, overdraft rejected then accepted
at the exact balance).
…and mirrors

Migration 213 lands in this branch, so the four English surfaces that state the
count (README.md, AGENTS.md, llm.txt) and the 69 translated README rows move from
209 to 210. check-docs-counts-sync.mjs fails without this; it passes after.

The 66 docs/i18n/<locale>/llm.txt files are exact-copy mirrors of root llm.txt
(check-docs-sync.mjs compares the body byte-for-byte), so they carry the same
four substitution sites. Rewritten from the root body, not by a blind regex: each
mirror is 4 lines added, 4 removed, and no removed line lacks "209".
…ecord

Eleven findings across security, performance, orchestration and structure, every
one citing path:line plus a verbatim snippet. Numbers are re-measured in-session
and the commands live in section 9, which separates the read-only audit against
the pristine tip from the remediation run on the tree that carries migration 213.

Section 6 item 2 records what the fix actually is: indexes only. The UNION ALL
rewrite that the finding originally implied measured slower (MERGE plus two temp
B-trees per branch) because the existing OR already plans as MULTI-INDEX OR over
both new indexes. What does need to change is getBalance, whose single SUM over
 cannot reach either index.

Known-red gates are recorded rather than papered over: the open-sse typecheck
gate fails with eleven errors that reproduce on a clean HEAD worktree with none
of this branch's files, so they are inherited tip drift.
oyi77 and others added 11 commits October 25, 2026 19:15
Take the tip's README/AGENTS/llm.txt and i18n mirrors (migration-count bumps are left to the cycle bump), drop the dangling poolOrdering.ts reference from the audit doc, add the changelog fragment.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…e audit report

Migration 213 is taken on release/v3.8.53 by 213_api_key_preferred_connections, and the runner refuses version collisions, so every DB test failed. Move the token_ledger indexes to the next free slot (218), rename the test and changelog reference to match, drop docs/audit/AUDIT-2026-10-22.md (out of scope for this PR) and bump the README migration count to 215.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…llision with release 217)

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…nted migration count to 221

Tip has 220 migrations and gaps at 226/227 for 228; next free slot is 224. Count-only bumps (220 to 221) in README, AGENTS.md, llm.txt and their i18n mirrors.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
# Conflicts:
#	docs/i18n/am/README.md
#	docs/i18n/ar/README.md
#	docs/i18n/az/README.md
#	docs/i18n/bg/README.md
#	docs/i18n/bn/README.md
#	docs/i18n/bs/README.md
#	docs/i18n/cs/README.md
#	docs/i18n/da/README.md
#	docs/i18n/de/README.md
#	docs/i18n/el/README.md
#	docs/i18n/es/README.md
#	docs/i18n/et/README.md
#	docs/i18n/fa/README.md
#	docs/i18n/fi/README.md
#	docs/i18n/fr/README.md
#	docs/i18n/ga/README.md
#	docs/i18n/gu/README.md
#	docs/i18n/ha/README.md
#	docs/i18n/he/README.md
#	docs/i18n/hi/README.md
#	docs/i18n/hr/README.md
#	docs/i18n/hu/README.md
#	docs/i18n/hy/README.md
#	docs/i18n/id/README.md
#	docs/i18n/ig/README.md
#	docs/i18n/ja/README.md
#	docs/i18n/ka/README.md
#	docs/i18n/km/README.md
#	docs/i18n/kn/README.md
#	docs/i18n/ko/README.md
#	docs/i18n/lt/README.md
#	docs/i18n/lv/README.md
#	docs/i18n/ml/README.md
#	docs/i18n/mr/README.md
#	docs/i18n/ms/README.md
#	docs/i18n/mt/README.md
#	docs/i18n/my/README.md
#	docs/i18n/ne/README.md
#	docs/i18n/nl/README.md
#	docs/i18n/no/README.md
#	docs/i18n/or/README.md
#	docs/i18n/pa/README.md
#	docs/i18n/phi/README.md
#	docs/i18n/pl/README.md
#	docs/i18n/pt-BR/README.md
#	docs/i18n/pt/README.md
#	docs/i18n/ro/README.md
#	docs/i18n/ru/README.md
#	docs/i18n/si/README.md
#	docs/i18n/sk/README.md
#	docs/i18n/sl/README.md
#	docs/i18n/sr/README.md
#	docs/i18n/sv/README.md
#	docs/i18n/sw/README.md
#	docs/i18n/ta/README.md
#	docs/i18n/te/README.md
#	docs/i18n/th/README.md
#	docs/i18n/tr/README.md
#	docs/i18n/uk-UA/README.md
#	docs/i18n/ur/README.md
#	docs/i18n/uz/README.md
#	docs/i18n/vi/README.md
#	docs/i18n/yo/README.md
#	docs/i18n/zh-CN/README.md
#	docs/i18n/zh-TW/README.md
…ollision

The tip gained 224_proxy_logs_egress_ip_families.sql (cheaper-inference#17326). Rename this PR's migration, its test and changelog text to 225 and bump the documented migration count 221 to 222 (digits only).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Performance

    • Token balance lookups and transfers now use indexed ledger data, reducing unnecessary full-table scans.
  • Bug Fixes

    • Balance calculations remain unchanged, and transfers that exceed the available balance continue to be rejected without altering the ledger. A transfer equal to the available balance succeeds.

Migration 225 adds two indexes for token-ledger lookups. The getBalance function calculates received minus sent tokens in one query. Unit tests cover query plans, balance and history results, and transfer outcomes.

Changes: Token Ledger Balance

Layer / File(s) Summary
Indexes and balance lookup
src/lib/db/migrations/225_token_ledger_balance_indexes.sql, src/lib/db/gamification.ts, changelog.d/fixes/17908-token-ledger-balance-indexes.md, AGENTS.md, README.md, llm.txt
Migration 225 adds indexes for incoming and outgoing ledger entries. getBalance calculates the net balance in one query. The changelog describes these changes, and the documentation updates the migration count to 222.
Index and transfer tests
tests/unit/migration-225-token-ledger-indexes.test.ts
Tests check index creation, query plans, balance and history results, and transfers that exceed or equal the available balance.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Merge Risk: Minimal · previous review 1ece0

No merge-blocking issue is established by the supplied evidence.

Security architecture risk: Minimal · up to 1ece0

The indexes and consolidated balance query preserve the existing transfer controls and ledger structure. No material security risk introduced or worsened by this change was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior affects balance reads and transfers backed by the existing token-ledger database. The inspected changes do not expand the set of caller-selectable accounts, introduce another service or datastore, or grant additional authority.

Trust Boundaries and Controls

  • observed — Both transfer-route handlers retain their management-authorization gate. POST validates source and destination identifiers and a positive amount; the unchanged sharing layer additionally rejects self-transfers and non-finite amounts before the database transaction. The query rewrite does not bypass these controls.

Resilience and Maintainability Implications

  • observed — Database retries with the same explicit idempotency key remain deduplicated. End-to-end HTTP retry idempotency is a pre-existing limitation: the route does not accept a reusable key, so the sharing layer generates a fresh key for each call. Neither this behavior nor its exposure changes in this PR.
Pre-merge checks: Passed 7
Check name Status Explanation
Title check Passed The title uses the Conventional Commits form with type perf and scope db. It matches the main change: a new index set on token_ledger and a single-statement getBalance read. The changeset contains bot…
Description check Passed The description covers the What, Why, Test, and Gates sections, and it explains the migration count and docs updates. It omits several template items: the Related Issues section, the Target Branch che…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Tests For Production Code Passed The PR changes production code under src/lib/db/gamification.ts and adds src/lib/db/migrations/225_token_ledger_balance_indexes.sql. It also adds `tests/unit/migration-225-token-ledger-indexes.tes…
No Ai Attribution Passed No prohibited AI attribution found. The reviewed commit range contains six standard Co-authored-by: diegosouzapw trailers, which identify a human contributor. No trailer names an AI assistant or bot…
Full details: Title check

Explanation

The title uses the Conventional Commits form with type perf and scope db. It matches the main change: a new index set on token_ledger and a single-statement getBalance read. The changeset contains both parts, so the title is accurate and specific.

Full details: Description check

Explanation

The description covers the What, Why, Test, and Gates sections, and it explains the migration count and docs updates. It omits several template items: the Related Issues section, the Target Branch checklist (base branch release/v3.8.x and v4-feature label), the Validation change-type selection, the Tests Added Or Updated list, the Coverage Notes for src/ changes, and the Reviewer Notes on the migration risk. The Test section also names tests/unit/migration-213-token-ledger-indexes.test.ts, but the changed file in the summary is tests/unit/migration-225-token-ledger-indexes.test.ts, and the migration is 225 in the summary, not 213. Because most of the template is present, the description is mostly complete, but the missing sections and the file-name mismatch need fixing.

Resolution

Add or complete these items: Related Issues (or state none); Target Branch checkbox confirmation; the change type under Validation; the list of changed test files under Tests Added Or Updated, with the correct name tests/unit/migration-225-token-ledger-indexes.test.ts; Coverage Notes for the src/lib/db/gamification.ts change; and Reviewer Notes on the migration 225 risk and the transferTokens write-lock behavior. Correct the test file name and migration number references from 213 to 225.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (5 skipped: 5 unsupported.)

Full details: Tests For Production Code

Explanation

The PR changes production code under src/lib/db/gamification.ts and adds src/lib/db/migrations/225_token_ledger_balance_indexes.sql. It also adds tests/unit/migration-225-token-ledger-indexes.test.ts, covering the new indexes, query plans, balance/history behavior, and transfers.

Full details: No Ai Attribution

Explanation

No prohibited AI attribution found. The reviewed commit range contains six standard Co-authored-by: diegosouzapw trailers, which identify a human contributor. No trailer names an AI assistant or bot, and no commit contains an AI-generation footer. The authored PR body also contains neither prohibited form.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 090f889 and 1ece018.

Files ignored due to path filters: 132
  • docs/i18n/am/README.md is excluded by !docs/i18n/**
  • docs/i18n/am/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ar/README.md is excluded by !docs/i18n/**
  • docs/i18n/ar/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/az/README.md is excluded by !docs/i18n/**
  • docs/i18n/az/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/bg/README.md is excluded by !docs/i18n/**
  • docs/i18n/bg/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/bn/README.md is excluded by !docs/i18n/**
  • docs/i18n/bn/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/bs/README.md is excluded by !docs/i18n/**
  • docs/i18n/bs/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/cs/README.md is excluded by !docs/i18n/**
  • docs/i18n/cs/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/da/README.md is excluded by !docs/i18n/**
  • docs/i18n/da/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/de/README.md is excluded by !docs/i18n/**
  • docs/i18n/de/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/el/README.md is excluded by !docs/i18n/**
  • docs/i18n/el/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/es/README.md is excluded by !docs/i18n/**
  • docs/i18n/es/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/et/README.md is excluded by !docs/i18n/**
  • docs/i18n/et/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/fa/README.md is excluded by !docs/i18n/**
  • docs/i18n/fa/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/fi/README.md is excluded by !docs/i18n/**
  • docs/i18n/fi/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/fr/README.md is excluded by !docs/i18n/**
  • docs/i18n/fr/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ga/README.md is excluded by !docs/i18n/**
  • docs/i18n/ga/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/gu/README.md is excluded by !docs/i18n/**
  • docs/i18n/gu/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ha/README.md is excluded by !docs/i18n/**
  • docs/i18n/ha/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/he/README.md is excluded by !docs/i18n/**
  • docs/i18n/he/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/hi/README.md is excluded by !docs/i18n/**
  • docs/i18n/hi/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/hr/README.md is excluded by !docs/i18n/**
  • docs/i18n/hr/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/hu/README.md is excluded by !docs/i18n/**
  • docs/i18n/hu/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/hy/README.md is excluded by !docs/i18n/**
  • docs/i18n/hy/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/id/README.md is excluded by !docs/i18n/**
  • docs/i18n/id/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ig/README.md is excluded by !docs/i18n/**
  • docs/i18n/ig/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/it/README.md is excluded by !docs/i18n/**
  • docs/i18n/it/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ja/README.md is excluded by !docs/i18n/**
  • docs/i18n/ja/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ka/README.md is excluded by !docs/i18n/**
  • docs/i18n/ka/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/km/README.md is excluded by !docs/i18n/**
  • docs/i18n/km/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/kn/README.md is excluded by !docs/i18n/**
  • docs/i18n/kn/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ko/README.md is excluded by !docs/i18n/**
  • docs/i18n/ko/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/lt/README.md is excluded by !docs/i18n/**
  • docs/i18n/lt/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/lv/README.md is excluded by !docs/i18n/**
  • docs/i18n/lv/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ml/README.md is excluded by !docs/i18n/**
  • docs/i18n/ml/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/mr/README.md is excluded by !docs/i18n/**
  • docs/i18n/mr/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ms/README.md is excluded by !docs/i18n/**
  • docs/i18n/ms/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/mt/README.md is excluded by !docs/i18n/**
  • docs/i18n/mt/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/my/README.md is excluded by !docs/i18n/**
  • docs/i18n/my/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ne/README.md is excluded by !docs/i18n/**
  • docs/i18n/ne/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/nl/README.md is excluded by !docs/i18n/**
  • docs/i18n/nl/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/no/README.md is excluded by !docs/i18n/**
  • docs/i18n/no/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/or/README.md is excluded by !docs/i18n/**
  • docs/i18n/or/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/pa/README.md is excluded by !docs/i18n/**
  • docs/i18n/pa/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/phi/README.md is excluded by !docs/i18n/**
  • docs/i18n/phi/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/pl/README.md is excluded by !docs/i18n/**
  • docs/i18n/pl/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/pt-BR/README.md is excluded by !docs/i18n/**
  • docs/i18n/pt-BR/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/pt/README.md is excluded by !docs/i18n/**
  • docs/i18n/pt/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ro/README.md is excluded by !docs/i18n/**
  • docs/i18n/ro/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ru/README.md is excluded by !docs/i18n/**
  • docs/i18n/ru/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/si/README.md is excluded by !docs/i18n/**
  • docs/i18n/si/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/sk/README.md is excluded by !docs/i18n/**
  • docs/i18n/sk/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/sl/README.md is excluded by !docs/i18n/**
  • docs/i18n/sl/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/sr/README.md is excluded by !docs/i18n/**
  • docs/i18n/sr/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/sv/README.md is excluded by !docs/i18n/**
  • docs/i18n/sv/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/sw/README.md is excluded by !docs/i18n/**
  • docs/i18n/sw/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ta/README.md is excluded by !docs/i18n/**
  • docs/i18n/ta/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/te/README.md is excluded by !docs/i18n/**
  • docs/i18n/te/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/th/README.md is excluded by !docs/i18n/**
  • docs/i18n/th/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/tr/README.md is excluded by !docs/i18n/**
  • docs/i18n/tr/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/uk-UA/README.md is excluded by !docs/i18n/**
  • docs/i18n/uk-UA/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/ur/README.md is excluded by !docs/i18n/**
  • docs/i18n/ur/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/uz/README.md is excluded by !docs/i18n/**
  • docs/i18n/uz/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/vi/README.md is excluded by !docs/i18n/**
  • docs/i18n/vi/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/yo/README.md is excluded by !docs/i18n/**
  • docs/i18n/yo/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/zh-CN/README.md is excluded by !docs/i18n/**
  • docs/i18n/zh-CN/llm.txt is excluded by !docs/i18n/**
  • docs/i18n/zh-TW/README.md is excluded by !docs/i18n/**
  • docs/i18n/zh-TW/llm.txt is excluded by !docs/i18n/**
Files selected for processing: 7
  • AGENTS.md
  • README.md
  • changelog.d/fixes/17908-token-ledger-balance-indexes.md
  • llm.txt
  • src/lib/db/gamification.ts
  • src/lib/db/migrations/225_token_ledger_balance_indexes.sql
  • tests/unit/migration-225-token-ledger-indexes.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

diegosouzapw added a commit to shevar0/OmniRoute that referenced this pull request Nov 3, 2026
…ip collision

The tip gained 224_proxy_logs_egress_ip_families.sql (cheaper-inference#17326) and cheaper-inference#17908 takes 225. Move the fence migration, its rehome rows and tests to 226 and bump the documented migration count to 223 (digits only; assumes cheaper-inference#17908 lands first).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
# Conflicts:
#	docs/i18n/am/README.md
#	docs/i18n/ar/README.md
#	docs/i18n/az/README.md
#	docs/i18n/bg/README.md
#	docs/i18n/bs/README.md
#	docs/i18n/cs/README.md
#	docs/i18n/da/README.md
#	docs/i18n/de/README.md
#	docs/i18n/el/README.md
#	docs/i18n/et/README.md
#	docs/i18n/fa/README.md
#	docs/i18n/fi/README.md
#	docs/i18n/fr/README.md
#	docs/i18n/ga/README.md
#	docs/i18n/gu/README.md
#	docs/i18n/ha/README.md
#	docs/i18n/he/README.md
#	docs/i18n/hi/README.md
#	docs/i18n/hr/README.md
#	docs/i18n/hu/README.md
#	docs/i18n/hy/README.md
#	docs/i18n/id/README.md
#	docs/i18n/ig/README.md
#	docs/i18n/ja/README.md
#	docs/i18n/ka/README.md
#	docs/i18n/km/README.md
#	docs/i18n/kn/README.md
#	docs/i18n/ko/README.md
#	docs/i18n/lt/README.md
#	docs/i18n/lv/README.md
#	docs/i18n/ml/README.md
#	docs/i18n/mr/README.md
#	docs/i18n/ms/README.md
#	docs/i18n/mt/README.md
#	docs/i18n/my/README.md
#	docs/i18n/ne/README.md
#	docs/i18n/nl/README.md
#	docs/i18n/no/README.md
#	docs/i18n/or/README.md
#	docs/i18n/pa/README.md
#	docs/i18n/phi/README.md
#	docs/i18n/pl/README.md
#	docs/i18n/pt/README.md
#	docs/i18n/ro/README.md
#	docs/i18n/ru/README.md
#	docs/i18n/si/README.md
#	docs/i18n/sk/README.md
#	docs/i18n/sl/README.md
#	docs/i18n/sr/README.md
#	docs/i18n/sv/README.md
#	docs/i18n/sw/README.md
#	docs/i18n/ta/README.md
#	docs/i18n/te/README.md
#	docs/i18n/th/README.md
#	docs/i18n/tr/README.md
#	docs/i18n/uk-UA/README.md
#	docs/i18n/ur/README.md
#	docs/i18n/uz/README.md
#	docs/i18n/vi/README.md
#	docs/i18n/yo/README.md
#	docs/i18n/zh-CN/README.md
#	docs/i18n/zh-TW/README.md
@diegosouzapw
diegosouzapw merged commit c59f4a0 into cheaper-inference:release/v3.8.53 Nov 4, 2026
3 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants