mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-08 11:53:43 +02:00
Address the status-management API review (comment e5db7038).
P0:
- CreateCustomIssueStatus now takes a FOR KEY SHARE workspace existence gate
(mirrors Ensure), so a create that races a workspace delete inserts zero
rows instead of leaving an orphan status. Zero rows -> pgx.ErrNoRows -> 404.
- Extract issuestatus.LockWorkspaceForStatusWrite / WorkspaceLockKey as the
single canonical lock protocol, keyed on the canonical workspace UUID (not
the raw request string), so differently-cased UUIDs can no longer take
distinct advisory locks and bypass mutual exclusion. All catalog writes
route through it; the archive census/reassign/archive stays under it.
P1:
- Reserved-alias rule applies to custom statuses only; a built-in may be
renamed back to its reserved default name ("Todo", ...).
- Immutable fields (category/system_key/workspace_id) are rejected on field
presence in the raw JSON, so an explicit null is a 400, not a silent 200.
- include_archived=true is gated to owner/admin (rejects agents); the active
catalog stays readable by any member/agent.
Tests: create-after-delete orphan gate, canonical-key equality, controlled-
concurrency lock serialization + archive/assignment closure (no issue
stranded on an archived status), immutable-null 400, built-in reserved
rename, admin-only archived view, cross-workspace 404. Scope unchanged:
status_id still not read on machine paths, no issue-write path is locked.
Co-authored-by: multica-agent <github@multica.ai>