mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 08:10:26 +00:00
2fc47df47c
The cached inverse source-target index assumed a clean viewsDirty flag meant current mappings, but batch ingests release the registry lock between records and only mark views dirty in their epilogue. A reader interleaving mid-batch was served pre-batch metrics targets from the cache, where the pre-index code always scanned live state. Every bySource mutation path now drops the cache inside its critical section, sending mid-batch readers to the live scan until the next view rebuild, which restores the exact pre-index freshness. A test pins the invalidation to the mutation itself rather than the epilogue flag. Contract-Neutral: staleness fix inside the cache lifecycle, resolved values and selection semantics unchanged