gabriel / musehub public
refactor BREAKING coord task/coord-genesis-ids #1 / 1
AI Agent gabriel · 44 days ago · May 4, 2026 · Diff

refactor(coord): genesis IDs for task + reservation; fix composite PK bug

task_id and reservation_id were the last two UUID surrogates. Both now use genesis-addressed IDs deterministic from their creation context.

task_id = sha256(repo_id NUL queue NUL created_by NUL created_at_iso) reservation_id = sha256(repo_id NUL agent_id NUL sorted_addresses NUL created_at_iso)

This also fixes a latent bug in _materialize_reservation: the old PK was reservation_id alone, so session.get(PK) on loop iteration 2+ found the first row and skipped all subsequent addresses. Only the first symbol was ever stored.

Fix: composite PK (reservation_id, symbol_address) — one row per address per reservation. session.get now uses (reservation_id, address) tuple. extend_reservation updated to use UPDATE WHERE instead of single-row get. Alembic 0023 migrates live.

TDD: test_reservation_multi_address_stores_all_rows (was red, now green) test_task_id_canonical, test_reservation_id_canonical

sha256:a735c8de3c86c03bfb32bc069810dcd5a8699a6cf7296799c40108d296cdaa3b sha
sha256:aa3a08f7fee5b502f24ea8519856ef6bea8710ae0cf8db406149a1008ba6d726 snapshot
← Older Oldest on task/coord-genesis-ids
All commits
Newer → Latest on task/coord-genesis-ids

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:a735c8de3c86c03bfb32bc069810dcd5a8699a6cf7296799c40108d296cdaa3b --body "your comment"