Fix #97: star gate lock-across-store #106

Merged
crueber merged 1 commit from fix/issue-97 into main 2026-09-05 03:31:21 +00:00
Owner

Route (b): the #70 process-global star gate serialized ALL Stars instance-wide with store calls inside. Pure CAS (route a) was rejected with justification: the create-path bump must stay unconditional (conditioning it undercounts nonzero-star repos — TestStarUnstarIdempotent pins bob to 2) and a late observer cannot distinguish a just-created record from a stale one.

This change shards the gate: 64 fixed FNV-1a stripes keyed by (repo, principal), Star-only, never nested, documented hold bound (1 GET + 1 PUT + one <=8-attempt CAS loop, control-plane JSON only). Zero Service still skips the gate (CAS alone).

Tests: #69 stress tests (8-way same-principal resync, 16-way converge, unstar decrement) green -race -count=20, plus new TestStarSlowStoreDoesNotStallUnrelatedRepo (wedged store op on o/slow while o/quick Star completes; both converge to 1). Coverage 99.5% on internal/social; gofmt/vet clean; internal/notify green. Docs: 07 section 4 concurrency paragraph + Decisions #97 entry updated (law 12); 13_concurrency untouched (gate is feature-level, documented in 07 as the #69 exception was).

Fixes #97.

Route (b): the #70 process-global star gate serialized ALL Stars instance-wide with store calls inside. Pure CAS (route a) was rejected with justification: the create-path bump must stay unconditional (conditioning it undercounts nonzero-star repos — TestStarUnstarIdempotent pins bob to 2) and a late observer cannot distinguish a just-created record from a stale one. This change shards the gate: 64 fixed FNV-1a stripes keyed by (repo, principal), Star-only, never nested, documented hold bound (1 GET + 1 PUT + one <=8-attempt CAS loop, control-plane JSON only). Zero Service still skips the gate (CAS alone). Tests: #69 stress tests (8-way same-principal resync, 16-way converge, unstar decrement) green -race -count=20, plus new TestStarSlowStoreDoesNotStallUnrelatedRepo (wedged store op on o/slow while o/quick Star completes; both converge to 1). Coverage 99.5% on internal/social; gofmt/vet clean; internal/notify green. Docs: 07 section 4 concurrency paragraph + Decisions #97 entry updated (law 12); 13_concurrency untouched (gate is feature-level, documented in 07 as the #69 exception was). Fixes #97.
Sign in to join this conversation.
No description provided.