You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
port/audit upstream PR 2284: fix(analytics): preserve distance invalidation during an active build #622
Port or audit of upstream Kpa-clawbot/CoreScope PR 2284 ("fix(analytics): preserve distance invalidation during an active build"). Read the upstream PR and its linked issue for details (read only; never comment there).
What upstream fixed
Upstream: background-fill completion could reset an active sync.Once, causing a fatal mutex unlock or letting an older distance build mark an incomplete index ready. Fix: build admission under the existing mutex plus a generation check.
What to do here
Audit first. Find out whether our fork has the same defect. Our code has diverged in several places; do not cherry-pick blindly.
If it applies: port the fix adapted to our code, with a red test before and green after, plus a mutant that the test kills. Include perf numbers where the change touches a hot path.
We made distance indexing lazy (#558/#589) and chunked. Check whether our lazy build, background fill loader and invalidation can race the same way (stale completion consuming an invalidation, or a Once reset while active). Use -race and a deterministic interleaving test.
Constraints: no SQL under PacketStore.mu; cmd/server stays read-only; no new map[string]interface (Kpa-clawbot#1383); CSS variables only for UI changes.
Activity
test(distance): fix the file header's test count (#622)
dborup commentedon Oct 28, 2026
Fixed by #636 (merged as
264f3fb82eadcb69061185cb1cb2ef3dec8171cb).