Phase 904: export mesh row helper extract + platform mixin builder (v0.8.871)

Non-breaking refactor — gossip-rpc-export-mesh-row-audit.js and
gossip-rpc-export-mesh-row-digest.js extract getLocalRow/tryRpc/ingestRpc
from registry entries; buildPlatformExportMeshFetchMixins() consolidates
platform mixin construction; platform-export-mesh-fetch-mixin.js reduced to
single builder call. Default gossip v1 unchanged; fleet v2 cutover still deferred.

Verification: test:ci-phase904, pear run boot, pearcord.log scan.
This commit is contained in:
Raven Scott
2026-06-04 19:52:36 -04:00
parent 9ded6fc090
commit 45a8c2a524
8 changed files with 83 additions and 31 deletions
+2
View File
@@ -92,6 +92,8 @@ Application facade: one `PearcordPlatform` class that wires identity, database,
**Phase 822 (v0.8.789):** Triple-peer topology via `guild-mesh-topology` + `getMeshStabilityStats`. Bundle: `npm run test:ci-phase822`. **Phase 822 (v0.8.789):** Triple-peer topology via `guild-mesh-topology` + `getMeshStabilityStats`. Bundle: `npm run test:ci-phase822`.
**Phase 904 (v0.8.871):** Export mesh row helper extract + platform mixin builder. Bundle: `npm run test:ci-phase904`.
**Phase 903 (v0.8.870):** Export mesh format helper extract + mixin method registry. Bundle: `npm run test:ci-phase903`. **Phase 903 (v0.8.870):** Export mesh format helper extract + mixin method registry. Bundle: `npm run test:ci-phase903`.
**Phase 902 (v0.8.869):** Export mesh view snapshot + mixin pick helper + RPC import consolidation. Bundle: `npm run test:ci-phase902`. **Phase 902 (v0.8.869):** Export mesh view snapshot + mixin pick helper + RPC import consolidation. Bundle: `npm run test:ci-phase902`.
+17
View File
@@ -68,10 +68,27 @@ function pickGuildExportMeshFetchMixinMethods (entry, mixin) {
} }
} }
/** Build consolidated + named platform export mesh fetch mixins (Phase 904). */
function buildPlatformExportMeshFetchMixins (registry) {
const platformExportMeshFetchMixin = buildGuildExportMeshFetchMixinsFromRegistry(registry)
return {
platformExportMeshFetchMixin,
platformAuditExportMeshFetchMixin: pickGuildExportMeshFetchMixinMethods(
registry.auditExportArchive,
platformExportMeshFetchMixin
),
platformAutomationDigestMeshFetchMixin: pickGuildExportMeshFetchMixinMethods(
registry.automationDigestSnapshot,
platformExportMeshFetchMixin
)
}
}
module.exports = { module.exports = {
buildGuildExportMeshFetchMixin, buildGuildExportMeshFetchMixin,
buildGuildExportMeshFetchMixinsFromRegistry, buildGuildExportMeshFetchMixinsFromRegistry,
pickGuildExportMeshFetchMixinMethods, pickGuildExportMeshFetchMixinMethods,
buildPlatformExportMeshFetchMixins,
buildGuildExportMeshGossipRequestBase, buildGuildExportMeshGossipRequestBase,
buildGuildExportMeshGossipWaitCallback buildGuildExportMeshGossipWaitCallback
} }
+9 -4
View File
@@ -8,8 +8,13 @@ const {
formatAuditExportArchiveMeshGossipResult, formatAuditExportArchiveMeshGossipResult,
sendAuditExportArchiveMeshGossipRequest sendAuditExportArchiveMeshGossipRequest
} = require('./gossip-rpc-export-mesh-format-audit') } = require('./gossip-rpc-export-mesh-format-audit')
const {
getAuditExportArchiveMeshLocalRow,
tryFetchAuditExportArchiveMeshRpc,
ingestAuditExportArchiveMeshRpc
} = require('./gossip-rpc-export-mesh-row-audit')
/** Audit export archive mesh fetch registry entry (Phase 901903). */ /** Audit export archive mesh fetch registry entry (Phase 901904). */
const auditExportArchiveMeshFetchEntry = { const auditExportArchiveMeshFetchEntry = {
pullConfigKey: 'auditExportArchive', pullConfigKey: 'auditExportArchive',
resolveWaiterMethod: '_resolveAuditArchiveFetchWaiter', resolveWaiterMethod: '_resolveAuditArchiveFetchWaiter',
@@ -22,9 +27,9 @@ const auditExportArchiveMeshFetchEntry = {
validateLocal: isValidAuditExportArchiveMeshRow, validateLocal: isValidAuditExportArchiveMeshRow,
waiterMode: 'append', waiterMode: 'append',
timeoutErrorMessage: 'audit archive fetch timed out', timeoutErrorMessage: 'audit archive fetch timed out',
getLocalRow: (platform, archiveId) => platform.deliveryReceipts.getAuditExportArchive(archiveId), getLocalRow: getAuditExportArchiveMeshLocalRow,
tryRpc: (platform, archiveId, opts) => platform._tryFetchAuditExportArchiveFromMeshRpc(archiveId, opts), tryRpc: tryFetchAuditExportArchiveMeshRpc,
ingestRpc: (platform, rpc) => platform.deliveryReceipts.ingestAuditExportArchive(rpc), ingestRpc: ingestAuditExportArchiveMeshRpc,
formatLocalHit: formatAuditExportArchiveMeshLocalHit, formatLocalHit: formatAuditExportArchiveMeshLocalHit,
formatRpcHit: formatAuditExportArchiveMeshRpcHit, formatRpcHit: formatAuditExportArchiveMeshRpcHit,
formatGossipResult: formatAuditExportArchiveMeshGossipResult, formatGossipResult: formatAuditExportArchiveMeshGossipResult,
+9 -6
View File
@@ -8,8 +8,13 @@ const {
formatAutomationDigestSnapshotMeshGossipResult, formatAutomationDigestSnapshotMeshGossipResult,
sendAutomationDigestSnapshotMeshGossipRequest sendAutomationDigestSnapshotMeshGossipRequest
} = require('./gossip-rpc-export-mesh-format-digest') } = require('./gossip-rpc-export-mesh-format-digest')
const {
getAutomationDigestSnapshotMeshLocalRow,
tryFetchAutomationDigestSnapshotMeshRpc,
ingestAutomationDigestSnapshotMeshRpc
} = require('./gossip-rpc-export-mesh-row-digest')
/** Automation digest snapshot mesh fetch registry entry (Phase 901903). */ /** Automation digest snapshot mesh fetch registry entry (Phase 901904). */
const automationDigestSnapshotMeshFetchEntry = { const automationDigestSnapshotMeshFetchEntry = {
pullConfigKey: 'automationDigestSnapshot', pullConfigKey: 'automationDigestSnapshot',
resolveWaiterMethod: '_resolveAutomationDigestSnapshotFetchWaiter', resolveWaiterMethod: '_resolveAutomationDigestSnapshotFetchWaiter',
@@ -22,11 +27,9 @@ const automationDigestSnapshotMeshFetchEntry = {
validateLocal: isValidAutomationDigestSnapshotMeshRow, validateLocal: isValidAutomationDigestSnapshotMeshRow,
waiterMode: 'replace', waiterMode: 'replace',
timeoutErrorMessage: 'automation digest snapshot fetch timed out', timeoutErrorMessage: 'automation digest snapshot fetch timed out',
getLocalRow: (platform, snapshotId) => getLocalRow: getAutomationDigestSnapshotMeshLocalRow,
platform.deliveryReceipts.getAutomationDigestExportSnapshot(snapshotId), tryRpc: tryFetchAutomationDigestSnapshotMeshRpc,
tryRpc: (platform, snapshotId, opts) => ingestRpc: ingestAutomationDigestSnapshotMeshRpc,
platform._tryFetchAutomationDigestSnapshotFromMeshRpc(snapshotId, opts),
ingestRpc: (platform, rpc) => platform.deliveryReceipts.ingestAutomationDigestExportSnapshot(rpc),
formatLocalHit: formatAutomationDigestSnapshotMeshLocalHit, formatLocalHit: formatAutomationDigestSnapshotMeshLocalHit,
formatRpcHit: formatAutomationDigestSnapshotMeshRpcHit, formatRpcHit: formatAutomationDigestSnapshotMeshRpcHit,
formatGossipResult: formatAutomationDigestSnapshotMeshGossipResult, formatGossipResult: formatAutomationDigestSnapshotMeshGossipResult,
+19
View File
@@ -0,0 +1,19 @@
'use strict'
function getAuditExportArchiveMeshLocalRow (platform, archiveId) {
return platform.deliveryReceipts.getAuditExportArchive(archiveId)
}
function tryFetchAuditExportArchiveMeshRpc (platform, archiveId, opts) {
return platform._tryFetchAuditExportArchiveFromMeshRpc(archiveId, opts)
}
function ingestAuditExportArchiveMeshRpc (platform, rpc) {
return platform.deliveryReceipts.ingestAuditExportArchive(rpc)
}
module.exports = {
getAuditExportArchiveMeshLocalRow,
tryFetchAuditExportArchiveMeshRpc,
ingestAuditExportArchiveMeshRpc
}
+19
View File
@@ -0,0 +1,19 @@
'use strict'
function getAutomationDigestSnapshotMeshLocalRow (platform, snapshotId) {
return platform.deliveryReceipts.getAutomationDigestExportSnapshot(snapshotId)
}
function tryFetchAutomationDigestSnapshotMeshRpc (platform, snapshotId, opts) {
return platform._tryFetchAutomationDigestSnapshotFromMeshRpc(snapshotId, opts)
}
function ingestAutomationDigestSnapshotMeshRpc (platform, rpc) {
return platform.deliveryReceipts.ingestAutomationDigestExportSnapshot(rpc)
}
module.exports = {
getAutomationDigestSnapshotMeshLocalRow,
tryFetchAutomationDigestSnapshotMeshRpc,
ingestAutomationDigestSnapshotMeshRpc
}
+5 -1
View File
@@ -14,6 +14,8 @@ const meshRegistryLookup = require('./gossip-rpc-export-mesh-registry-lookup')
const meshRegistryValidate = require('./gossip-rpc-export-mesh-registry-validate') const meshRegistryValidate = require('./gossip-rpc-export-mesh-registry-validate')
const meshFormatAudit = require('./gossip-rpc-export-mesh-format-audit') const meshFormatAudit = require('./gossip-rpc-export-mesh-format-audit')
const meshFormatDigest = require('./gossip-rpc-export-mesh-format-digest') const meshFormatDigest = require('./gossip-rpc-export-mesh-format-digest')
const meshRowAudit = require('./gossip-rpc-export-mesh-row-audit')
const meshRowDigest = require('./gossip-rpc-export-mesh-row-digest')
module.exports = { module.exports = {
...attempt, ...attempt,
@@ -28,5 +30,7 @@ module.exports = {
...meshRegistryLookup, ...meshRegistryLookup,
...meshRegistryValidate, ...meshRegistryValidate,
...meshFormatAudit, ...meshFormatAudit,
...meshFormatDigest ...meshFormatDigest,
...meshRowAudit,
...meshRowDigest
} }
@@ -1,24 +1,7 @@
'use strict' 'use strict'
const { const { buildPlatformExportMeshFetchMixins } = require('../../../gossip-rpc-export-mesh-bind')
buildGuildExportMeshFetchMixinsFromRegistry,
pickGuildExportMeshFetchMixinMethods
} = require('../../../gossip-rpc-export-mesh-bind')
const { exportMeshFetchRegistry } = require('../../../gossip-rpc-export-mesh-registry') const { exportMeshFetchRegistry } = require('../../../gossip-rpc-export-mesh-registry')
/** Consolidated export mesh fetch mixins from registry entries (Phase 900902). */ /** Consolidated export mesh fetch mixins from registry entries (Phase 900904). */
const platformExportMeshFetchMixin = buildGuildExportMeshFetchMixinsFromRegistry(exportMeshFetchRegistry) module.exports = buildPlatformExportMeshFetchMixins(exportMeshFetchRegistry)
const platformAuditExportMeshFetchMixin = pickGuildExportMeshFetchMixinMethods(
exportMeshFetchRegistry.auditExportArchive,
platformExportMeshFetchMixin
)
const platformAutomationDigestMeshFetchMixin = pickGuildExportMeshFetchMixinMethods(
exportMeshFetchRegistry.automationDigestSnapshot,
platformExportMeshFetchMixin
)
module.exports = {
platformExportMeshFetchMixin,
platformAuditExportMeshFetchMixin,
platformAutomationDigestMeshFetchMixin
}