Phase 957: gossip outbox stats build extract (v0.8.924)

Add guild-mesh-gossip-outbox-stats-build with lane alert thresholds,
outbox stats resolve, and replication diagnostics gossip slice. Gossip
view and partition-heal mixins delegate without behavior change.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-04 23:13:43 -04:00
co-authored by Cursor
parent eb5f18fba5
commit d70925d4fc
4 changed files with 79 additions and 34 deletions
@@ -1,38 +1,18 @@
'use strict'
const { getListingTtlMs } = require('pearcord-discovery')
const {
buildGossipLaneAlertThresholds,
buildGossipLaneAlertsFromCounts
} = require('../../../guild-mesh-gossip-outbox-stats-build')
const platformGuildSyncGossipViewMixin = {
_gossipLaneAlertThresholds () {
return {
message: Math.max(
8,
Number(process.env.PEARCORD_GOSSIP_LANE_ALERT_MESSAGE) || 48
),
presence: Math.max(
8,
Number(process.env.PEARCORD_GOSSIP_LANE_ALERT_PRESENCE) || 32
),
audit: Math.max(8, Number(process.env.PEARCORD_GOSSIP_LANE_ALERT_AUDIT) || 24),
default: Math.max(8, Number(process.env.PEARCORD_GOSSIP_LANE_ALERT_DEFAULT) || 16)
}
return buildGossipLaneAlertThresholds()
},
_gossipLaneAlertsFromCounts (laneCounts = {}) {
const thresholds = this._gossipLaneAlertThresholds()
const alerts = []
for (const lane of ['message', 'presence', 'audit', 'default']) {
const count = Number(laneCounts[lane]) || 0
const threshold = thresholds[lane] || 16
if (count < threshold) continue
alerts.push({
lane,
count,
threshold,
severity: count >= threshold * 2 ? 'high' : 'warn'
})
}
return alerts
return buildGossipLaneAlertsFromCounts(laneCounts, this._gossipLaneAlertThresholds())
},
_sparseAckSyncRowsForView (guildId) {