Skip to content

fix: preserve learned provider facts across concurrent saves - #1824

Merged
ZeroPoint95 merged 6 commits into
devfrom
fix/quirks-restart-write-drain
Oct 14, 2026
Merged

ZeroPoint95 merged 6 commits into
devfrom
fix/quirks-restart-write-drain

Conversation

@ZeroPoint95

@ZeroPoint95 ZeroPoint95 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Concurrent learned-provider saves could lose a fact at restart: an older save could copy only fact A, a newer save could persist A and B, then the older snapshot could replace that newer file with A. Atomic replacement kept valid JSON but did not preserve save ordering.

A separate writer mutex now covers the snapshot through atomic replacement within one process. Fact recording and readers keep using the short-lived memo mutex, and requests continue to schedule saves in the background. A regression drives actual concurrent learning and persistence, drains completed writes, and verifies every fact in a fresh store. The manual and performance documentation state the in-process guarantee and retain the separate-process cache limitation.

Controlled diagnostic overlays reproduce old-snapshot fact loss and verify the repair while learning and reads remain responsive. Diagnostic hooks are absent from the patch. Required local gates against merged dev base 401a1e032af93fecdc4bd299c84c6c22d5c9be4d passed, including a fresh provider suite in 68.143 seconds with every selected test passing on its first run. Focused race-detector checks and independent review passed; the canonical build passed on the publication candidate. This repair is separate from the test-only restart-fixture ownership repair.

Maintainer review and merge are required. Any staging attempt must use the final merged release record and its successful exact-SHA Full check. This PR performs no promotion; stable and production are outside scope.

Final candidate: a4804de6ce0d1d1e674e86c27f54f30c725eae57, including its assigned-number change entry for #1824. Independent final-entry review passed; production source matches the reviewed publication candidate.

@ZeroPoint95
ZeroPoint95 marked this pull request as ready for review October 14, 2026 06:21
@ZeroPoint95
ZeroPoint95 merged commit c68873a into dev Oct 14, 2026
6 checks passed
@ZeroPoint95
ZeroPoint95 deleted the fix/quirks-restart-write-drain branch October 14, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant