Session: invoice-number-sequences — 2026-10-08

ledger-api · Codex · branch feat/invoice-numbers · gpt-5-codex · 2026-10-08 13:50 · 1 msgs · 3 tools · 1 min read · updated 3 weeks ago

tools: Bash, Write
← ledger-api Download .md .txt .json
Tool calls
Write Write: 2 calls (66.7%) 2 Bash Bash: 1 call (33.3%) 1
Token usage56.0K total
Input6.0K
Cache creation12.0K
Cache read36.0K
Output2.0K
Cache hit ratio67%· warming up

Project: ledger-api · Branch: feat/invoice-numbers · Mode: default · Model: gpt-5-codex

Summary

Gap-free invoice numbers per legal entity and year, allocated from a Postgres row lock instead of a sequence, because sequences can skip numbers on rollback.

Conversation

Turn 1 — User

Accounting needs invoice numbers without gaps.

Turn 1 — Assistant

Postgres sequences are not gap-free. Use a numbering table per entity and year, SELECT … FOR UPDATE inside the invoice transaction.

Tools used in this turn:

  • Write: ledger/numbering.py
  • Write: migrations/versions/0007_numbering.py
  • Bash: pytest tests/test_numbering.py -q — 5 passed

Connections

  • [[ledger-api]]
  • [[PostgreSQL]]
  • [[RowLocks]]

Keyboard shortcuts

⌘K / Ctrl+KOpen command palette
/Focus search
g hGo to home
g pGo to projects
g sGo to sessions
j / kNext / prev row (tables)
?Show this help
EscClose dialogs

Structured queries

Mix key:value filters with free text in the palette:

type:sessionOnly session pages
project:llm-wikiFilter by project name (substring)
model:claudeFilter by model name (substring)
date:>2026-03-01Sessions after a date
date:<2026-04-01Sessions before a date
tags:rustPages mentioning a tag/topic
sort:dateSort results by date (newest first)

Example: type:session project:llm-wiki date:>2026-04 sort:date