Migration 0002 adds sequence_sessions and archive_folders. New repository
methods: folder scan state, session-key mapping, sequence locations and
relocation, frame sync from sidecars, duplicate and candidate lookups, folder
rebase, integrity updates and verifiable card import history.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
Additive repository methods the server needs: upload state transitions,
pending bytes, per-day and per-user upload counts, render-result uploads;
job claim by id, node progress and completion, priority, queue counts and
requeue of numbered workers; sequence edits with settings_version
optimistic concurrency; audit filter by action; latest token per user.
Migration 0005 adds session_key, job_id and render_json to uploads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
- SQLite restore holds every pool slot instead of the write lock first,
removing a lock-order deadlock with sessions that begin to write.
- PostgreSQL sessions always return their connection on dispose, a
rollback while disposing never masks the original exception, and a
busy session keeps its transaction until it is discarded.
- The pool disposes a connection whose health check the caller cancels.
- Listener commands keep their lock until the server answers and never
tear a write with the caller's token; closing and pending no longer race.
- Tag replacement locks the sequence and the tag row; unused-tag cleanup
locks candidates and re-checks them with a fresh snapshot; render
counts and stats refreshes lock the sequence row on PostgreSQL.
- Sequence upserts keep rendered_count, which renders maintain.
- AuthenticationOk after an unfinished SCRAM exchange is rejected.
- Oversized read buffers are released; failed backups leave no .tmp;
a zero idle lifetime is rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
Embedded per-dialect migrations applied in one transaction and recorded
in schema_migrations (advisory lock on PostgreSQL, newer schemas
refused). Schema for every BRIEF section 5 entity plus import history and
uploads. Hand-written repositories for archives, sequences (filters,
keyset paging, Archive statistics), frames (bulk insert and updates),
renders, jobs (exclusive claiming, checkpoints, crash recovery), media
cards, users, tokens, render nodes, settings, tags, audit and uploads.
TitanoDatabase opens, migrates and exposes them, also bound to a
transaction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC