mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-04 07:34:25 +02:00
#1 sort default: missing sort_by, unknown sort_by, and illegal sort_direction all collapse to created_at DESC, id DESC (was ASC). Order-asserting test cases added for every degenerate input. #2 onboarding position: extract nextIssuePosition helper. Welcome issue + sub-issues + the existing CreateIssue path all route through it instead of inheriting Go's Position=0 default. This consolidates the three create call-sites so a fourth path cannot regress. #3 rebalance hot path: replace full-bucket scan with a neighbor-only SQL query (GetIssueNeighborGap) used by MaybeEnqueueRebalance. Hot path stays O(1); worker still does the full bucket scan when actually rebalancing. Bucket-edge issues use COALESCE sentinels so missing neighbours never trigger spurious rebalances. #4 migration: up is now order-preserving (position ASC, created_at DESC, id DESC) and idempotent (skips buckets that are already sparse). down drops only the index; data restore is per runbook snapshot so a destructive UPDATE issue SET position = 0 cannot wipe drag edits. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>