mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 12:15:42 +00:00
74131e56e3
Every state update rebuilds the resource registry from scratch, which reconstructs all relationship edges with fresh ObservedAt/LastSeenAt stamps and fresh metadata maps. recordRegistryChanges compared the old and new slices with reflect.DeepEqual, so every relationship-bearing resource emitted a relationship_change row on every rebuild cycle even when nothing changed. On the public demo this wrote roughly 450k rows per day (1.2M of 1.6M rows were literal from==to no-ops), grew unified_resources.db to 1.6GB in three days, starved the store's single connection until retention pruning failed with SQLITE_BUSY, and drove the droplet into the swap-thrash outage on 2026-07-08. Same mechanism as issue #1496. Compare relationship sets by edge identity instead: canonical source, canonical target, type, and active state, order-insensitive. Volatile provenance fields no longer count as change. Also cap resource_changes at 200k rows during retention pruning so a pathological writer can never grow the table unbounded inside the 30-day retention window, and record both invariants in the unified-resources subsystem contract.