gabriel / musehub public
refactor BREAKING task/rename-record-uuid-to-record-id #1 / 1
AI Agent gabriel · 131 days ago · May 4, 2026 · Diff

refactor: rename record_uuid → record_id, widen String(36) → String(128)

MusehubCoordRecord.record_uuid was a misnomer — the field stores sha256 genesis IDs (sha256:<64-hex>, 71 chars) and opaque run_id strings, not UUID4 (36 chars). The String(36) column width was also too narrow.

- db/coord_models.py: rename column, widen type, update UniqueConstraint and docstrings - models/coord.py: rename field in CoordRecordIn/Out, replace UUID4 validator with _SAFE_RECORD_ID_RE (accepts sha256: prefix + opaque ids) - services/musehub_coord.py: update all ORM attribute references - services/musehub_coord_server.py: update materialize function params - api/routes/coord.py: update docstrings - alembic/versions/0027: RENAME COLUMN + ALTER TYPE migration - tests/test_coord_record_id.py: TDD guard for the rename and new width

sha256:5f659985c9aaf7fb0d3e6b007b6a753aff99807c34de998900cad2019fe13787 sha
+22 ~10 −3 symbols
sha256:0a7dac217f39dd0a00ea69a5d1aff716257a66998b3a100ad68c2820f3626901 snapshot
+22
symbols added
~10
symbols modified
−3
symbols removed
0
dead code introduced
Semantic Changes 35 symbols
+ branch_labels variable variable branch_labels L18–18
+ depends_on variable variable depends_on L19–19
+ down_revision variable variable down_revision L17–17
+ downgrade function function downgrade L33–41
+ annotations import import annotations L11–11
+ op import import op L14–14
+ sa import import sa L13–13
+ revision variable variable revision L16–16
+ upgrade function function upgrade L22–30
~ tests/test_coord_record_id.py .py 10 symbols added
+ _col function function _col L15–16
+ MusehubCoordRecord import import MusehubCoordRecord L12–12
+ String import import String L10–10
+ annotations import import annotations L7–7
+ pytest import import pytest L9–9
+ test_record_id_column_exists function function test_record_id_column_exists L19–20
+ test_record_id_is_string_128 function function test_record_id_is_string_128 L27–30
+ test_record_id_not_nullable function function test_record_id_not_nullable L33–34
+ test_record_uuid_column_gone function function test_record_uuid_column_gone L23–24
+ test_unique_constraint_uses_record_id function function test_unique_constraint_uses_record_id L37–44
~ musehub/api/routes/coord.py .py 1 symbol modified
~ musehub/models/coord.py .py 3 symbols added, 3 symbols removed, 2 symbols modified
_validate_record_uuid method method _validate_record_uuid L85–86
_UUID4_RE variable variable _UUID4_RE L41–44
_validate_uuid4 function function _validate_uuid4 L47–50
+ _validate_record_id_field method method _validate_record_id_field L87–88
+ _SAFE_RECORD_ID_RE variable variable _SAFE_RECORD_ID_RE L44–44
+ _validate_record_id function function _validate_record_id L47–50
← Older Oldest on task/rename-record-uuid-to-record-id
All commits
Newer → Latest on task/rename-record-uuid-to-record-id

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:5f659985c9aaf7fb0d3e6b007b6a753aff99807c34de998900cad2019fe13787 --body "your comment"